Bug 464047

Summary: Popup Windows open outside of screen, need to be moved using Taskbar-menu
Product: [Plasma] kwin Reporter: Henning <boredsquirrel>
Component: wayland-genericAssignee: xXPerditorXx <zocker>
Status: RESOLVED FIXED    
Severity: normal CC: kde, nate, xaver.hugl, zocker
Priority: NOR Flags: boredsquirrel: Wayland+
boredsquirrel: Intel+
Version: 5.26.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.27
Sentry Crash Report:
Attachments: Popup Windows outside screen

Description Henning 2023-01-09 12:44:42 UTC
SUMMARY
Popup windows like from Libreoffice always open right of my screen, I have to move them manually through the Taskbar.


STEPS TO REPRODUCE
1. Open a popup Window in Wayland session
2. it doesnt appear but in the taskbar
3. move it using the taskbar action

OBSERVED RESULT
popup windows open outside of screen but right from it, normal hight

EXPECTED RESULT
all windows have to open in the screen limits

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 37
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7
Kernel Version: 6.0.17-300.fc37.x86_64 (64-bit)
Graphics Platform: Wayland
Graphics Processor: Mesa IntelĀ® HD Graphics 4000
Comment 1 Nate Graham 2023-01-09 22:57:11 UTC
What kind of popup window? How do you make it open? Can you describe exactly what you're doing?
Comment 2 Henning 2023-01-10 12:42:39 UTC
(In reply to Nate Graham from comment #1)
> What kind of popup window? How do you make it open? Can you describe exactly
> what you're doing?

Any Popup window. In my case the Libreoffice flatpak popup windows for every settings, for restoring unsaved documents. These popup windows are also shown with the generic wayland logo.

I can file  a bug for the libreoffice flatpak, but I think opening windows should be handled by kwin right?
Comment 3 David Edmundson 2023-01-11 12:45:20 UTC
Can you attach output of:  qdbus org.kde.KWin  /KWin org.kde.KWin.supportInformation

Check if you have any window rules or scripts enabled that could be affecting this
Comment 4 Henning 2023-01-11 12:51:27 UTC
(In reply to David Edmundson from comment #3)
> Can you attach output of:  qdbus org.kde.KWin  /KWin
> org.kde.KWin.supportInformation
> 
> Check if you have any window rules or scripts enabled that could be
> affecting this

It seems to not occur when attaching a second display. So my laptop screen is primary and the second display is on the left. When using laptop only, it seems the popup window shows up right of the laptop screen. As If the Kwin coordinates would originate from the second display as main, while my laptop screen is set as that.

So a problem may be, that I set the kwin rules like that? and the coordinates say its on the right. But it should be normal, as my main screen is always there and where the rule says the window should be.
Comment 5 Zamundaaa 2023-01-11 13:29:52 UTC
Coordinates begin at the top left, the primary monitor setting has no impact on that. KWin shouldn't blindly apply the window rule though but also check if the window is still visible, and move it to a sane place if it's not
Comment 6 Bug Janitor Service 2023-01-11 13:38:09 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3423
Comment 7 Zamundaaa 2023-01-24 16:25:29 UTC
Git commit 11327da292ce248b93e75f583b1860d8a140bc55 by Xaver Hugl.
Committed on 24/01/2023 at 14:40.
Pushed by zamundaaa into branch 'master'.

xdgshellwindow: ignore window position rules placing windows outside of all screens

M  +24   -1    src/rules.cpp
M  +2    -0    src/rules.h
M  +1    -1    src/window.cpp
M  +1    -1    src/x11window.cpp
M  +1    -1    src/xdgshellwindow.cpp

https://invent.kde.org/plasma/kwin/commit/11327da292ce248b93e75f583b1860d8a140bc55
Comment 8 Nate Graham 2023-01-25 21:53:54 UTC
Git commit 09bb1298fa8334ccb5350f959e87724fa2613851 by Nate Graham, on behalf of Xaver Hugl.
Committed on 25/01/2023 at 21:53.
Pushed by ngraham into branch 'cherry-pick-11327da2'.

xdgshellwindow: ignore window position rules placing windows outside of all screens


(cherry picked from commit 11327da292ce248b93e75f583b1860d8a140bc55)

M  +24   -1    src/rules.cpp
M  +2    -0    src/rules.h
M  +1    -1    src/window.cpp
M  +1    -1    src/x11window.cpp
M  +1    -1    src/xdgshellwindow.cpp

https://invent.kde.org/plasma/kwin/commit/09bb1298fa8334ccb5350f959e87724fa2613851
Comment 9 xXPerditorXx 2023-12-26 13:39:33 UTC Comment hidden (spam)
Comment 10 xXPerditorXx 2023-12-26 13:41:07 UTC Comment hidden (spam)
Comment 11 xXPerditorXx 2023-12-26 13:45:33 UTC Comment hidden (spam)
Comment 12 Nate Graham 2024-01-10 00:33:46 UTC Comment hidden (spam)