Bug 409454 - Second screen rotated triggers Gwenview to appear on primary screen exceeding borders
Summary: Second screen rotated triggers Gwenview to appear on primary screen exceeding...
Status: REOPENED
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (show other bugs)
Version: 5.19.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 408947 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-07-03 12:16 UTC by Germano Massullo
Modified: 2023-02-20 10:32 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
screencast of a repro (2.59 MB, video/mp4)
2021-09-09 06:44 UTC, Oded Arbel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Germano Massullo 2019-07-03 12:16:02 UTC
SUMMARY
If the system has the second screen rotated, when the user opens some applications like Gwenview, they will appear with aspect ration of second screen rather than the aspect ratio of primary screen. This will lead applications exceeding primary screen borders


SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.16.2
KDE Frameworks 5.59.0
Qt 5.12.4

ADDITIONAL INFORMATION
$ qdbus org.kde.KWin /KWin supportInformation 

Version
=======
KWin version: 5.16.2
Qt Version: 5.12.4
Qt compile version: 5.12.4
XCB compile version: 1.13.1

Operation Mode: X11 only

Build Options
=============
KWIN_BUILD_DECORATIONS: yes
KWIN_BUILD_TABBOX: yes
KWIN_BUILD_ACTIVITIES: yes
HAVE_DRM: yes
HAVE_GBM: yes
HAVE_EGL_STREAMS: yes
HAVE_X11_XCB: yes
HAVE_EPOXY_GLX: yes
HAVE_WAYLAND_EGL: yes

X11
===
Vendor: Fedora Project
Vendor Release: 12005000
Protocol Version/Revision: 11/0
SHAPE: yes; Version: 0x11
RANDR: yes; Version: 0x14
DAMAGE: yes; Version: 0x11
Composite: yes; Version: 0x4
RENDER: yes; Version: 0xb
XFIXES: yes; Version: 0x50
SYNC: yes; Version: 0x31
GLX: yes; Version: 0x0

Decoration
==========
Plugin: org.kde.breeze
Theme: 
Blur: 0
onAllDesktopsAvailable: true
alphaChannelSupported: true
closeOnDoubleClickOnMenu: false
decorationButtonsLeft: 0, 2
decorationButtonsRight: 6, 3, 4, 5
borderSize: 3
gridUnit: 10
font: Noto Sans,10,-1,0,50,0,0,0,0,0,Regular
smallSpacing: 2
largeSpacing: 10

Platform
==========
Name: KWin::X11StandalonePlatform

Options
=======
focusPolicy: 0
nextFocusPrefersMouse: false
clickRaise: true
autoRaise: false
autoRaiseInterval: 0
delayFocusInterval: 0
shadeHover: false
shadeHoverInterval: 250
separateScreenFocus: false
placement: 4
focusPolicyIsReasonable: true
borderSnapZone: 10
windowSnapZone: 10
centerSnapZone: 0
snapOnlyWhenOverlapping: false
rollOverDesktops: true
focusStealingPreventionLevel: 1
legacyFullscreenSupport: false
operationTitlebarDblClick: 5000
operationMaxButtonLeftClick: 5000
operationMaxButtonMiddleClick: 5015
operationMaxButtonRightClick: 5014
commandActiveTitlebar1: 0
commandActiveTitlebar2: 30
commandActiveTitlebar3: 2
commandInactiveTitlebar1: 4
commandInactiveTitlebar2: 30
commandInactiveTitlebar3: 2
commandWindow1: 7
commandWindow2: 8
commandWindow3: 8
commandWindowWheel: 31
commandAll1: 10
commandAll2: 3
commandAll3: 14
keyCmdAllModKey: 16777251
showGeometryTip: false
condensedTitle: false
electricBorderMaximize: true
electricBorderTiling: true
electricBorderCornerRatio: 0.25
borderlessMaximizedWindows: false
killPingTimeout: 5000
hideUtilityWindowsForInactive: true
inactiveTabsSkipTaskbar: false
autogroupSimilarWindows: false
autogroupInForeground: true
compositingMode: 1
useCompositing: true
compositingInitialized: true
hiddenPreviews: 1
glSmoothScale: 2
xrenderSmoothScale: false
maxFpsInterval: 16666666
refreshRate: 0
vBlankTime: 6000000
glStrictBinding: true
glStrictBindingFollowsDriver: true
glCoreProfile: false
glPreferBufferSwap: 101
glPlatformInterface: 1
windowsBlockCompositing: true

Screen Edges
============
desktopSwitching: false
desktopSwitchingMovingClients: false
cursorPushBackDistance: 1x1
timeThreshold: 150
reActivateThreshold: 350
actionTopLeft: 0
actionTop: 0
actionTopRight: 0
actionRight: 0
actionBottomRight: 0
actionBottom: 0
actionBottomLeft: 0
actionLeft: 0

Screens
=======
Multi-Head: no
Active screen follows mouse:  no
Number of Screens: 2

Screen 0:
---------
Name: DP-2
Geometry: 1200,240,2560x1440
Scale: 1
Refresh Rate: 59.9506

Screen 1:
---------
Name: DP-1
Geometry: 0,0,1200x1920
Scale: 1
Refresh Rate: 59.9502


Compositing
===========
Compositing is active
Compositing Type: OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2) 
OpenGL version string: 3.0 Mesa 19.0.8
OpenGL platform interface: GLX
OpenGL shading language version string: 1.30
Driver: Intel
GPU class: Unknown
OpenGL version: 3.0
GLSL version: 1.30
Mesa version: 19.0.8
Linux kernel version: 5.1.15
Direct rendering: Requires strict binding: yes
GLSL shaders:  yes
Texture NPOT support:  yes
Virtual Machine:  no
OpenGL 2 Shaders are used
Painting blocks for vertical retrace:  no

Loaded Effects:
---------------
kwin4_effect_login
kwin4_effect_fadingpopups
kwin4_effect_logout
kwin4_effect_dialogparent
screenshot
colorpicker
highlightwindow
startupfeedback
kscreen

Currently Active Effects:
-------------------------

Effect Settings:
----------------
kwin4_effect_login:
isActiveFullScreenEffect: false

kwin4_effect_fadingpopups:
isActiveFullScreenEffect: false

kwin4_effect_logout:
isActiveFullScreenEffect: false

kwin4_effect_dialogparent:
isActiveFullScreenEffect: false

screenshot:

colorpicker:

highlightwindow:

startupfeedback:
type: 1

kscreen:
Comment 1 David Edmundson 2019-07-03 12:19:53 UTC
plasmashell is not involved in window sizing
Comment 2 David Edmundson 2019-07-03 12:22:04 UTC
Please open on gwenview and include output of "xprop" and clicking on that window.
Comment 3 Germano Massullo 2019-07-03 12:26:25 UTC
xprop output: this time I could not be able to reproduce Gwenview being opened in "vertical" aspect ratio, but it was still exceeding primary screen borders


XdndAware(ATOM) = BITMAP
WM_NAME(STRING) = "IMG_3792.CR2 - 4000x6000 - 29% "
_NET_WM_NAME(UTF8_STRING) = "IMG_3792.CR2 - 4000x6000 - 29%  — Gwenview"
_KDE_NET_WM_USER_CREATION_TIME(CARDINAL) = 14686953
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x3e, 0x7e, 0x0, 0x0
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_XEMBED_INFO(_XEMBED_INFO) = 0x0, 0x1
WM_CLIENT_LEADER(WINDOW): window id # 0x5c00008
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: True
                Initial state is Normal State.
                window id # of group leader: 0x5c00008
WM_CLIENT_MACHINE(STRING) = "office-machine"
_NET_WM_PID(CARDINAL) = 16712
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 96468999
WM_CLASS(STRING) = "gwenview", "gwenview"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_NORMAL_HINTS(WM_SIZE_HINTS):
                user specified size: 2560 by 1861
                program specified minimum size: 619 by 230
                window gravity: Static
Comment 4 Germano Massullo 2019-07-05 15:51:15 UTC
XdndAware(ATOM) = BITMAP
_KDE_NET_WM_USER_CREATION_TIME(CARDINAL) = 199844520
WM_NAME(STRING) = "IMG_3693.jpg - 2000x1333 - 60% "
_NET_WM_NAME(UTF8_STRING) = "IMG_3693.jpg - 2000x1333 - 60%  — Gwenview"
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x3e, 0x7e, 0x0, 0x0
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_XEMBED_INFO(_XEMBED_INFO) = 0x0, 0x1
WM_CLIENT_LEADER(WINDOW): window id # 0x3800008
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: True
                window id # of group leader: 0x3800008
WM_CLIENT_MACHINE(STRING) = "office-machine"
_NET_WM_PID(CARDINAL) = 13455
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 58720263
WM_CLASS(STRING) = "gwenview", "gwenview"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_NORMAL_HINTS(WM_SIZE_HINTS):
                user specified size: 1200 by 1861
                program specified minimum size: 619 by 230
                window gravity: Static
Comment 5 Germano Massullo 2019-11-07 11:57:07 UTC
https://phabricator.kde.org/D25062#559530
Comment 6 Oded Arbel 2020-06-14 08:18:51 UTC
*** Bug 408947 has been marked as a duplicate of this bug. ***
Comment 7 Oded Arbel 2020-06-14 08:43:31 UTC
As of Plasma 5.19, this still seems to be an issue, though as discussed in the phabricator link - this is not limited to gwenview (I'm not sure if the patch discussed in the phabricator has landed or not, but if it did - it did not affect this issue).

System details:
OS: Kubuntu focal with Neon unstable repository
Plasma version: 5.19.80
KDE Frameworks version: 5.71.0
Qt Version: 5.14.2
Kernel version: 5.4.0-23
kwin --version: 5.19.80
dpkg -l kwin-x11: 4:5.19.0+p20.04+git20200613.0146-0

I can reproduce this issue with gwenview, okular, kate, gedit, dolphin and many others - this seems like a kwin issue it can be reproduced 100% of the time using the following process:

1. Have two screens connected, where one is vertical and one is horizontal (My setup has the vertical screen to the left of the horizontal one, but I don't think it matters).
2. Set the horizontal screen as the "primary" screen (gets the default panel).
3. Open some application - it doesn't really matter which, though there are some that make is hard to repro, such as System Settings, but even for that it still happens.
4. The application should show up on the primary screen. If it is not too big, proceed to step 5.
5. Move the application to the vertical screen and resize it so it is higher than the height of the horizontal screen, but not maximized.
6. Close the application and start it again - it will appear on the primary screen while exceeding the screen boundaries.

For completion, here's xprop of Okular experiencing this issue:

```
XdndAware(ATOM) = BITMAP
WM_NAME(STRING) = 
_NET_WM_NAME(UTF8_STRING) = "Okular"
_KDE_NET_WM_USER_CREATION_TIME(CARDINAL) = 8244042
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x3e, 0x7e, 0x0, 0x0
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_XEMBED_INFO(_XEMBED_INFO) = 0x0, 0x1
WM_CLIENT_LEADER(WINDOW): window id # 0xb600008
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: True
                window id # of group leader: 0xb600008
WM_CLIENT_MACHINE(STRING) = "vesho"
_NET_WM_PID(CARDINAL) = 36230
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 190840839
WM_CLASS(STRING) = "okular", "okular"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_NORMAL_HINTS(WM_SIZE_HINTS):
                user specified size: 1196 by 1247
                program specified minimum size: 182 by 349
                window gravity: Static
```

As such, and I hope I don't make a mess of things, I'm changing the component to kwin.
Comment 8 Germano Massullo 2021-09-08 08:37:41 UTC
I am no longer experiencing this problem

Plasma 5.22.4
KDE Frameworks 5.85.0
Qt 5.15.2
Comment 9 Oded Arbel 2021-09-09 06:44:19 UTC
Created attachment 141414 [details]
screencast of a repro

(In reply to Germano Massullo from comment #8)
> I am no longer experiencing this problem
> 
> Plasma 5.22.4
> KDE Frameworks 5.85.0
> Qt 5.15.2

I can still repro using the steps I outlined in comment #7 with latest neon developer: Plasma 5.22.80; Frameworks 5.86.0; Qt 5.15.3.

See attached screen cast (I had trouble capturing two screens with my normal tools, so this is an OBS scene that is scaled down and there are various artifacts such as the screens not being aligned properly and for some reason a double cursor on the right screen - not sure what is up with that, but this is 100% a legit capture of the process).
Comment 10 Oded Arbel 2021-09-18 13:03:23 UTC
The issue reported in Bug 366632 sounds related - though it doesn't appear to be multi-screen related and the fix there is narrowly tailored to the issue if restoring window geometry of previously maximized windows.
Comment 11 Oded Arbel 2021-09-18 13:05:30 UTC
(In reply to Oded Arbel from comment #10)
> The issue reported in Bug 366632 sounds related - though it doesn't appear
> to be multi-screen related and the fix there is narrowly tailored to the
> issue if restoring window geometry of previously maximized windows.

Also that issue is about the wayland platform while this issue - even though opened for X11 - is for both X11 and Wayland.

Should I open a new ticket with platform-wayland as the component, so hopefully we can get this issue addressed considering much more effort is going into Wayland these days (I'm considering switching myself - giving it another test run).
Comment 12 Oded Arbel 2023-02-20 10:32:40 UTC
Changing component to the much more relevant multi-screen.

BTW, still reproduceable with 5.27.80 from Neon unstable.