peterfajdiga / karousel

Scrollable tiling Kwin script
GNU General Public License v3.0
198 stars 3 forks source link

Can't go fullscreen with some apps #9

Closed Riebeck-one closed 10 months ago

Riebeck-one commented 11 months ago

Everything is working great except for one issue I encountered while trying to go fullscreen with Firefox (e.g., on YouTube or Twitch). The videos won't go fullscreen, and instead, the Firefox window becomes very large. To enter fullscreen mode, I have to first maximize Firefox, and only then am I able to go fullscreen with the video. I tried with VLC too and it seems fine with this one.

Edit : I also tried with other apps like Steam and Yuzu, and the behavior appears to be inconsistent. While it works well with Steam in Big Picture mode, it doesn't function the same way with Yuzu in fullscreen. It seems that Karourel prevents some apps from entering fullscreen and forces them to remain tiled.

peterfajdiga commented 11 months ago

Thanks for the report! On Youtube, how are you entering fullscreen mode? F11 or F or the fullscreen button in the web page or double click?

Riebeck-one commented 11 months ago

I'm using F and sometimes the fullscreen button and both don't work. What's happening is that the window go fullscreen for a fraction of a second, and then go back tiled. I recorded my screen as you can watch what's happening :

https://www.youtube.com/watch?v=BG62LD75nuw

peterfajdiga commented 11 months ago

Thanks for the explanation and the recording. Do you have any other scripts enabled? Or any special KWin settings enabled?

Riebeck-one commented 11 months ago

No, the only script that's enabled is Karousel. I've applied some window rules, including one specifically for Firefox, but even when I disable it, the issue persists. Interestingly, I discovered that if I untile Firefox, I can enter fullscreen mode without any problems.

Edit: I've made another observation—I cannot put any app into fullscreen mode when using the KDE fullscreen shortcut (which is Maj + F11 for me). All applications exhibit the same behavior, which is the same one as with Firefox.

peterfajdiga commented 11 months ago

Hi, could you try installing this version of Karousel (I've added some logs): karousel_debug_issue9.tar.gz You can replace your currently installed version by running:

kpackagetool5 --type=KWin/Script --upgrade ./karousel_debug_issue9.tar.gz

Then, please make sure that only a single tiled window is on your current desktop, and set it to full-screen. Immediately afterwards, please retrieve the logs by running:

journalctl -t kwin_x11 -g '^qml:|^file://.*karousel' | tail -n 200

(the number of lines doesn't necessarily have to be 200)

Then, please post the logs here.

Riebeck-one commented 11 months ago

Thank you very much for your time. This is what I got running your last command :

août 02 20:36:26 archlinux kwin_x11[1441]: qml: script started août 02 20:36:33 archlinux kwin_x11[1441]: qml: script stopped août 02 20:36:34 archlinux kwin_x11[1441]: qml: script started août 02 20:37:08 archlinux kwin_x11[1441]: file:///home/david/.local/share/kwin/scripts/karousel/contents/code/main.js:1705: Error: Function.prototype.disconnect: cannot disconnect from deleted QObject août 02 23:01:56 archlinux kwin_x11[1441]: qml: script started -- Boot d9c5d8f6e7f4473f9bfd461c6b108e0a -- août 03 21:01:00 archlinux kwin_x11[1421]: qml: script started août 03 21:01:07 archlinux kwin_x11[1421]: qml: script stopped août 03 21:01:08 archlinux kwin_x11[1421]: qml: script started août 03 21:01:32 archlinux kwin_x11[1421]: qml: script stopped août 03 23:21:57 archlinux kwin_x11[1421]: qml: script started

Since I'm using Wayland, I also ran this command : journalctl -t kwin_wayland -g '^qml:|^file://.*karousel' | tail -n 200

This is what it returned :

-- Boot afe0dade687f4201a28d799694f5e78e -- août 04 20:18:48 archlinux kwin_wayland[1302]: qml: script started août 04 20:21:41 archlinux kwin_wayland[1302]: qml: script stopped août 04 20:21:43 archlinux kwin_wayland[1302]: qml: script started

Riebeck-one commented 11 months ago

I just rebooted and ran the procedure again, there is a lot more in logs now :

-- Boot 044731fad73540dd948ea2a6181c7d0a -- août 04 20:31:15 archlinux kwin_wayland[1301]: qml: script started août 04 20:31:19 archlinux kwin_wayland[1301]: qml: Grid.arrange août 04 20:31:24 archlinux kwin_wayland[1301]: qml: setFullScreen undefined false août 04 20:31:24 archlinux kwin_wayland[1301]: qml: setMaximize undefined false false août 04 20:31:24 archlinux kwin_wayland[1301]: qml: Grid.arrange août 04 20:31:24 archlinux kwin_wayland[1301]: qml: Column.arrange août 04 20:31:24 archlinux kwin_wayland[1301]: qml: Window.arrange undefined true août 04 20:31:24 archlinux kwin_wayland[1301]: qml: setMaximize undefined false false août 04 20:31:24 archlinux kwin_wayland[1301]: qml: setFullScreen undefined false août 04 20:31:24 archlinux kwin_wayland[1301]: qml: kwinClient.frameGeometryChanged undefined août 04 20:31:24 archlinux kwin_wayland[1301]: qml: Grid.arrange août 04 20:31:24 archlinux kwin_wayland[1301]: qml: Column.arrange août 04 20:31:24 archlinux kwin_wayland[1301]: qml: Window.arrange undefined true août 04 20:31:24 archlinux kwin_wayland[1301]: qml: setMaximize undefined false false août 04 20:31:24 archlinux kwin_wayland[1301]: qml: setFullScreen undefined false août 04 20:31:30 archlinux kwin_wayland[1301]: qml: kwinClient.frameGeometryChanged undefined août 04 20:31:30 archlinux kwin_wayland[1301]: qml: Grid.arrange août 04 20:31:30 archlinux kwin_wayland[1301]: qml: Column.arrange août 04 20:31:30 archlinux kwin_wayland[1301]: qml: Window.arrange undefined true août 04 20:31:30 archlinux kwin_wayland[1301]: qml: setMaximize undefined false false août 04 20:31:30 archlinux kwin_wayland[1301]: qml: setFullScreen undefined false août 04 20:31:30 archlinux kwin_wayland[1301]: qml: kwinClient.fullScreenChanged undefined août 04 20:31:30 archlinux kwin_wayland[1301]: qml: kwinClient.frameGeometryChanged undefined août 04 20:31:30 archlinux kwin_wayland[1301]: qml: kwinClient.fullScreenChanged undefined

peterfajdiga commented 11 months ago

Thank you so much for your help. It seems that the workspace.clientFullScreenSet signal is not firing. Weird. I guess I could work around this when I have some more time.

peterfajdiga commented 11 months ago

We should report this to KDE. I've prepared a minimal example here: fullscreen-test.tar.gz. Could you run it to confirm that this is really what happens?

You can install it with:

kpackagetool5 --type=KWin/Script --install ./fullscreen-test.tar.gz

After enabling it and toggling a window to or from fullscreen, view the logs with:

journalctl -t kwin_wayland -g 'fullscreen-test' | tail -n 50

Thank you!

Riebeck-one commented 11 months ago

I'm not sure if I did everything correctly. I have both Karousel and fullscreen-test enabled at the same time. I also rebooted to be sure. When I try to toggle a window to full screen and then check the logs I get that :

-- Boot 433e329cef5d470b933adddfdc806b8f -- août 05 10:36:14 archlinux kwin_wayland[1293]: qml: fullscreen-test: script started

peterfajdiga commented 11 months ago

You did everything correctly. This confirms that the workspace.clientFullScreenSet signal is not firing. Would you like to report this to the KDE bug tracker? Or shall I, but I'll need your Kwin version (run kwin_wayland --version)?

Riebeck-one commented 11 months ago

I'm still quite new to Linux, and I'm not very confident in handling bug reports yet. So, if you don't mind, I'd prefer to let you handle the reporting. I'm currently using kwin 5.27.7. Thanks again for all your help and hard work.

Just to confirm, does the behavior I'm experiencing make sense, given that I can toggle windows to fullscreen when un-tiling them?

peterfajdiga commented 11 months ago

Ok, no problem, I'll report the bug.

Yes, it makes sense. You can toggle windows to fullscreen, but the toggling isn't communicated to scripts, so they can't know it happened.

I have a few more questions, though. Does this also happen on X11? And can you tell me your installed version of KDE Plasma, KDE Frameworks, and Qt? You can see these versions in kinfocenter.

Riebeck-one commented 11 months ago

So indeed, it's working well on x11. I can toggle fullscreen without problems. I'm using KDE Plasma 5.27.7, KDE framework 5.108.0 and QT 5.15.10

peterfajdiga commented 11 months ago

I've created the bug report here: https://bugs.kde.org/show_bug.cgi?id=473115

Riebeck-one commented 11 months ago

Thank you very much. I'll keep an eye on the bug report to see if there are any questions asked.

peterfajdiga commented 10 months ago

Hi @Maxinova, there doesn't seem to be any progress on the Kwin bug. I've created a possible workaround for this issue. Can you try this version, please, and let me know if the problem persists?

Riebeck-one commented 10 months ago

Hi ! It is definetly better, yet the behavior isn't quite right, as shown in this screenshot of a YouTube video in fullscreen mode.

https://imgur.com/1WKWWgW

The video does enter fullscreen mode, but it doesn't entirely fill the screen space. Additionally, a new issue has emerged: all windows overlap with the top panel, as demonstrated at the top of the screen.

https://imgur.com/Je6ORx9

Riebeck-one commented 10 months ago

I tried fixing the second problem (the overlapping) by going to Karousel's settings and changing the margin. I'm not exactly sure what happened, but after making these changes (going from 18 px to 14 px for the "Top margin" setting, turning off and on Karousel, and then going back to 18 px), it looks like my issue has been fixed.

peterfajdiga commented 10 months ago

This (especially the second problem) sounds like a bug that crept into the version I've linked in my previous comment. This one has the bug fixed: karousel.tar.gz

Riebeck-one commented 10 months ago

Oh, it's definitely working much better now. There's no more overlapping, and when I switch an app to fullscreen, the app resizes to use the entire available width. It's still not true fullscreen, but it's a good temporary solution.

https://imgur.com/ILyefRO

peterfajdiga commented 10 months ago

It seems that clients also don't have a fullScreen property on your machine. I'll add this to the Kwin bug report. EDIT: I was wrong about this, you do have the fullScreen property.

peterfajdiga commented 10 months ago

I've created another workaround, this time for the missing fullScreen property: karousel.tar.gz

Riebeck-one commented 10 months ago

Hello. I'm still experiencing the same issue as mentioned in my previous message. Thanks for trying to help with my problem; I really appreciate it.

peterfajdiga commented 10 months ago

Damn, there must be even more inconsistencies between my and your Kwin behavior. May I ask you to try one more version and give me the logs you get after toggling a window to full-screen. You can get the logs by running journalctl -t kwin_wayland -g 'qml:' | tail -n 50. Thank you for all your help so far!

Riebeck-one commented 10 months ago

No problem at all! Here's the log after setting a window to fullscreen:

-- Boot fa3a9ab8d0dc40389d5fbf9272aee7be -- sept. 01 22:25:37 archlinux kwin_wayland[1546]: qml: script started sept. 01 22:27:53 archlinux kwin_wayland[1546]: qml: kwinClient.fullScreenChanged true sept. 01 22:27:53 archlinux kwin_wayland[1546]: qml: kwinClient.frameGeometry QRectF(0, 0, 5120, 1440) sept. 01 22:27:53 archlinux kwin_wayland[1546]: qml: PlacementArea QRectF(0, 27, 5120, 1413) sept. 01 22:27:53 archlinux kwin_wayland[1546]: qml: MovementArea QRectF(0, 0, 5120, 1440) sept. 01 22:27:53 archlinux kwin_wayland[1546]: qml: MaximizeArea QRectF(0, 27, 5120, 1413) sept. 01 22:27:53 archlinux kwin_wayland[1546]: qml: MaximizeFullArea QRectF(0, 0, 5120, 1440) sept. 01 22:27:53 archlinux kwin_wayland[1546]: qml: FullScreenArea QRectF(0, 0, 5120, 1440) sept. 01 22:27:53 archlinux kwin_wayland[1546]: qml: WorkArea QRectF(0, 27, 5120, 2493) sept. 01 22:27:53 archlinux kwin_wayland[1546]: qml: FullArea QRectF(0, 0, 5120, 2520) sept. 01 22:27:53 archlinux kwin_wayland[1546]: qml: ScreenArea QRectF(0, 0, 5120, 1440) sept. 01 22:27:54 archlinux kwin_wayland[1546]: qml: kwinClient.fullScreenChanged false sept. 01 22:27:54 archlinux kwin_wayland[1546]: qml: kwinClient.frameGeometry QRectF(1334, 41, 2451, 1385) sept. 01 22:27:54 archlinux kwin_wayland[1546]: qml: PlacementArea QRectF(0, 27, 5120, 1413) sept. 01 22:27:54 archlinux kwin_wayland[1546]: qml: MovementArea QRectF(0, 0, 5120, 1440) sept. 01 22:27:54 archlinux kwin_wayland[1546]: qml: MaximizeArea QRectF(0, 27, 5120, 1413) sept. 01 22:27:54 archlinux kwin_wayland[1546]: qml: MaximizeFullArea QRectF(0, 0, 5120, 1440) sept. 01 22:27:54 archlinux kwin_wayland[1546]: qml: FullScreenArea QRectF(0, 0, 5120, 1440) sept. 01 22:27:54 archlinux kwin_wayland[1546]: qml: WorkArea QRectF(0, 27, 5120, 2493) sept. 01 22:27:54 archlinux kwin_wayland[1546]: qml: FullArea QRectF(0, 0, 5120, 2520) sept. 01 22:27:54 archlinux kwin_wayland[1546]: qml: ScreenArea QRectF(0, 0, 5120, 1440)

peterfajdiga commented 10 months ago

Thank you.

peterfajdiga commented 10 months ago

Another possible cause would be that for you the frameGeometryChanged signal is emitted before fullScreenChanged or at least before the fullScreen property gets updated (for me it's the opposite). This version checks if this is the case. Could you please try it and again provide the logs? Please also test if maximizing works correctly. Thank you!

Riebeck-one commented 10 months ago

Well done, it's working now! I can now properly put a window in fullscreen mode, and maximizing windows still works as well.

-- Boot 24329d96b0ae42e4afd94aeb876623cc -- sept. 02 11:56:26 archlinux kwin_wayland[1560]: qml: script started sept. 02 11:56:40 archlinux kwin_wayland[1560]: qml: Karousel: kwinClient.frameGeometryChanged false sept. 02 11:56:40 archlinux kwin_wayland[1560]: qml: Karousel: kwinClient.frameGeometryChanged false sept. 02 11:56:42 archlinux kwin_wayland[1560]: qml: Karousel: kwinClient.frameGeometryChanged false sept. 02 11:56:48 archlinux kwin_wayland[1560]: qml: Karousel: kwinClient.frameGeometryChanged false sept. 02 11:56:48 archlinux kwin_wayland[1560]: qml: Karousel: kwinClient.fullScreenChanged true sept. 02 11:56:53 archlinux kwin_wayland[1560]: qml: Karousel: kwinClient.frameGeometryChanged true sept. 02 11:56:53 archlinux kwin_wayland[1560]: qml: Karousel: kwinClient.fullScreenChanged false

peterfajdiga commented 10 months ago

Glad to hear it, thanks again for all your help!