Bug 486508 - On Wayland, some windows goes off the screen when attempting to tile a certain way
Summary: On Wayland, some windows goes off the screen when attempting to tile a certai...
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: Quick Tiling (show other bugs)
Version: 6.0.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland-only
: 484664 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-05-03 13:50 UTC by Anya
Modified: 2024-07-03 18:35 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screen recording of the bug (3.30 MB, video/mp4)
2024-05-03 13:50 UTC, Anya
Details
System title bar enabled, more strange behavior (1.82 MB, video/mp4)
2024-05-03 21:39 UTC, Anya
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anya 2024-05-03 13:50:17 UTC
Created attachment 169139 [details]
Screen recording of the bug

SUMMARY
Under certain circumstances, the Firefox window will go off screen and can't be interacted with anymore using the mouse (since you can't move the cursor off screen), tiling shortcuts or maximizing. The "Move" option from the window menu has to be used. This doesn't happen always, but I can consistently reproduce it when I log out and log back in. After attempting to tile Firefox once or twice the behavior goes back to normal/expected. Sometimes it's once, sometimes it continues to happen multiple times in the same session until it eventually goes back to normal. Might not be Wayland-specific.


STEPS TO REPRODUCE
1. Open Firefox, maximize it and close it so that it opens as maximized the next time
2. Log out and log back in
4. Start Firefox and attempt to click and drag from the title bar to the right edge of the screen

OBSERVED RESULT
Window positions itself off screen (to the right I think?) and becomes inaccessible, except when using the "Move" option in the window menu.

EXPECTED RESULT
Window tiles to the right edge of the screen.

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS 
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Kernel Version: 6.8.9-arch1-1 (64-bit)
Graphics Platform: Wayland
Graphics Processor: Mesa Intel® Graphics

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2024-05-03 19:20:54 UTC
I wonder if https://invent.kde.org/plasma/kwin/-/commit/33fe2114710085235d656c04c7d63be3828aefc9 could help.

Do you have multiple screens, or did you at some point recently before making this screen recording?

Does the issue still happen if you enable the system titlebar in Firefox and then restart it and try to reproduce the issue again?
Comment 2 Anya 2024-05-03 20:45:55 UTC
(In reply to Nate Graham from comment #1)
> I wonder if
> https://invent.kde.org/plasma/kwin/-/commit/
> 33fe2114710085235d656c04c7d63be3828aefc9 could help.
> 
> Do you have multiple screens, or did you at some point recently before
> making this screen recording?
> 
> Does the issue still happen if you enable the system titlebar in Firefox and
> then restart it and try to reproduce the issue again?

Hi! I'm very not used to applying patches to source code and compiling it, I might try it but it could take a while. There is only the one screen (it's a laptop), never plugged in an external one on this OS. I enabled the system title bars and I can still reproduce the behavior. For clarity, I right-clicked into the empty tab area at the top, clicked "Customize Toolbar...", and then ticked/enabled the "Title Bar" option in the bottom left.

Might be worth mentioning I use a 2x scaling factor because my screen is 3200x2000.

I also just tried the same thing with three other applications (Chromium, Thunderbird and an Electron app) and can reproduce the behavior with all of them.
Comment 3 Anya 2024-05-03 21:39:47 UTC
Created attachment 169164 [details]
System title bar enabled, more strange behavior

I noticed that, after I move the window back onto the screen, when I attempt to resize it (click and hold the window edge, without moving) the window size instantly completely changes to a weird shape. The window shape before that (after pulling it back in) seems to correspond to the last tiled shape but not sure.
Comment 4 Anya 2024-05-03 21:42:10 UTC
(In reply to Anya from comment #3)
> Created attachment 169164 [details]
> System title bar enabled, more strange behavior
> 
> I noticed that, after I move the window back onto the screen, when I attempt
> to resize it (click and hold the window edge, without moving) the window
> size instantly completely changes to a weird shape. The window shape before
> that (after pulling it back in) seems to correspond to the last tiled shape
> but not sure.

Sorry, actually click and hold the window edge and move it a tiny bit. The shape doesn't chage if I just click and hold without moving.
Comment 5 Nate Graham 2024-05-03 23:23:48 UTC
That's so weird, I can't reproduce the issue with any of those apps. Does it happen with Dolphin or Okular?

P.S. congratulations on choosing a laptop with a perfect screen resolution!
Comment 6 Anya 2024-05-04 10:57:21 UTC
(In reply to Nate Graham from comment #5)
> That's so weird, I can't reproduce the issue with any of those apps. Does it
> happen with Dolphin or Okular?
>
> P.S. congratulations on choosing a laptop with a perfect screen resolution!

Assuming that's not sarcasm, thanks :)

I can't reproduce it with Dolphin or Okular.

Couple other things I tried that didn't eliminate the behavior since I don't have a life anyway:
- Made a new user, deleted all the hidden folders and files in its home folder, and started a Wayland session
- Disabled "Maximize" animation effect
- Set scaling factor to 100% and setting it to something else between 100 and 200
- Changed refresh rate from 120hz to 60hz
- Changed edge tiling percentage

They might be harder to reproduce (not sure about that) but it's definitely non-zero times.

Can't reproduce it in an X session. Can't reproduce with Chromium unless it's running in Wayland mode (using the ozone command line arguments). Not sure if it's possible that EndeavourOS applies different KDE settings to fresh users even after wiping the hidden home folder files before logging in? It does apply a different color scheme and wallpaper, as well as a welcome-application that autostarts until you disable it. Would have to try a clean Arch installation or something like that.

Something tangentially related, I *am* able to move Dolphin (and other application) below the taskbar where it becomes inaccessible by mouse cursor, but then it can still be maximized and tiled, either through the taskbar right click menu or with keyboard shortcuts. Could be intended behavior though.

I took a look at recompiling kwin with the patch applied but it seems impossibly difficult to me.

I think that's it for now, hope I didn't forget anything. It's a bit of an annoyance when I want to tile firefox to the right so I can do other stuff on the left side of the screen, but it's obviously not critical.
Comment 7 Nate Graham 2024-05-04 23:15:11 UTC
It was not sarcasm! Thanks for the info.
Comment 8 Nate Graham 2024-05-04 23:15:15 UTC
*** Bug 484664 has been marked as a duplicate of this bug. ***
Comment 9 Anya 2024-05-27 08:50:24 UTC
KWin 6.0.5 landed in Arch repos and I made a new user to test again, and I can still reproduce the bug. Initially, before changing any settings, it was really tough to reproduce though. I think it's easier after it's happened once. That or after changing the display scaling factor from the default 175% it picked for my system, to the 200% that I prefer. I don't know for sure though. On my existing user the bug is essentially the same as on 6.0.4.

In case that helps.
Comment 10 Zamundaaa 2024-07-02 22:07:28 UTC
What's the frame geometry of the window when it's outside of the screen? You can check it with the kwin debug console (search for it in krunner)
Comment 11 Anya 2024-07-03 17:57:44 UTC
(In reply to Zamundaaa from comment #10)
> What's the frame geometry of the window when it's outside of the screen? You
> can check it with the kwin debug console (search for it in krunner)

I went to check but I can't reproduce the behavior anymore. I only noticed now so I wouldn't know what kwin version brought the change but I currently have 6.1.1 installed (6.1.1.2-1 on arch).
Comment 12 Steve Cossette 2024-07-03 18:29:09 UTC
Same here, I can't reproduce this anymore either.
Comment 13 Zamundaaa 2024-07-03 18:35:02 UTC
Great!