Bug 406573 - Windows of lower screen shrink when always visible taskbar is placed on upper screen in vertical dual screen setup
Summary: Windows of lower screen shrink when always visible taskbar is placed on upper...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: platform-x11-standalone (show other bugs)
Version: 5.15.4
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Vlad Zahorodnii
URL: https://phabricator.kde.org/D20987
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-15 17:48 UTC by Ike
Modified: 2019-05-15 08:07 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:
vlad.zahorodnii: ReviewRequest+


Attachments
The window on the lower screen is normal before moving the taskbar (1.30 MB, image/png)
2019-04-15 17:51 UTC, Ike
Details
The window on the lower screen is shrunk after moving the taskbar (1.31 MB, image/png)
2019-04-15 17:52 UTC, Ike
Details
Screenshot!!! (3.82 MB, image/png)
2019-05-03 15:43 UTC, Vlad Zahorodnii
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ike 2019-04-15 17:48:47 UTC
Hi there,

I have a dual monitor setup where the monitors are placed above each other (laptop monitor below external screen - see xrandr -q output below). If I now create a new taskbar and place it to the bottom corner of the upper screen, all the windows on the lower monitor are shrunk vertically while their horizontal size remains the same (see attached pictures). Same thing happens when moving an existing taskbar (which is set to "always visible") to this position. As soon as I move this taskbar to any other place, the windows resize back to their initial size. 
The bug also appears when switching from any task bar visibility mode to "always visible" and the windows also resize back to normal when switching back to another visibility mode.
So I guess it has something to do with the visibility setting "always visible". The bug doesn't happen if another visibility mode is used. 

STEPS TO REPRODUCE
1. Setup two monitors vertically
2. Open any window and place it on the lower screen
3. Do one of the following:
    - Create a taskbar at the bottom edge of the upper monitor
    - Move an existing taskbar (which is set to "always visible") from somewhere to the bottom edge of the upper monitor
    - Switch the visibility mode of an existing taskbar located at the bottom edge of the uppor monitor to the visibility mode "always visible"
4. Click at any free space on the desktop to apply the changes

OBSERVED RESULT
Windows in lower screen shrink vertically.

EXPECTED RESULT
The size of all windows should remain untouched.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian 10 Buster / KDE Plasma 5.14.5
(available in About System)
KDE Plasma Version: 5.14.5
KDE Frameworks Version: 5.54.0
Qt Version: 5.11.3

Bug also appears with the following setup:
Linux/KDE Plasma: Kubuntu 18.10 / KDE Plasma 5.13.5
(available in About System)
KDE Plasma Version: 5.13.5
KDE Frameworks Version: 5.50.0
Qt Version: 5.11.1

If you need any further information, I'm happy to provide it.

Regards,
Ike

Additional Information:
Output of xrandr -q:

Screen 0: minimum 8 x 8, current 1920 x 2160, maximum 32767 x 32767
eDP1 connected primary 1920x1080+0+1080 (normal left inverted right x axis y axis) 310mm x 170mm
   1920x1080     60.05*+  59.93  
   1680x1050     59.88  
   1600x1024     60.17  
   1400x1050     59.98  
   1600x900      60.00    59.95    59.82  
   1280x1024     60.02  
   1440x900      59.89  
   1400x900      59.96    59.88  
   1280x960      60.00  
   1368x768      60.00    59.88    59.85  
   1360x768      59.80    59.96  
   1280x800      59.81    59.91  
   1152x864      60.00  
   1280x720      59.86    60.00    59.74  
   1024x768      60.00  
   1024x576      60.00    59.90    59.82  
   960x540       60.00    59.63    59.82  
   800x600       60.32    56.25  
   864x486       60.00    59.92    59.57  
   640x480       59.94  
   720x405       59.51    60.00    58.99  
   640x360       59.84    59.32    60.00  
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 160mm x 90mm
   1920x1080     60.00*+  50.00    59.94  
   1920x1080i    60.00    50.00    59.94  
   1600x1200     60.00  
   1680x1050     59.88  
   1280x1024     60.02  
   1440x900      59.90  
   1280x960      60.00  
   1280x800      59.91  
   1280x720      60.00    50.00    59.94  
   1024x768      60.00  
   800x600       60.32    56.25  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       60.00    59.94  
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
Comment 1 Ike 2019-04-15 17:51:24 UTC
Created attachment 119423 [details]
The window on the lower screen is normal before moving the taskbar
Comment 2 Ike 2019-04-15 17:52:27 UTC
Created attachment 119424 [details]
The window on the lower screen is shrunk after moving the taskbar
Comment 3 Martin Flöser 2019-04-16 04:26:28 UTC
Please provide xprop of the panels.
Comment 4 Ike 2019-04-16 11:15:37 UTC
(In reply to Martin Flöser from comment #3)
> Please provide xprop of the panels.

Thanks for the quick reply! Here the xprop outputs of the panels (hope, that's what you wanted):

1) The xprop output of the panel (in "Always visible" mode) on the lower monitor corresponding to my first attachment:
_KDE_NET_WM_ACTIVITIES(STRING) = "00000000-0000-0000-0000-000000000000"
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_CHANGE_DESKTOP
WM_STATE(WM_STATE):
                window state: Normal
                icon window: 0x0
_NET_WM_STATE(ATOM) = 
_NET_WM_USER_TIME(CARDINAL) = 591040
_KDE_SLIDE(_KDE_SLIDE) = 0xffffffff, 0x1
_NET_WM_STRUT(CARDINAL) = 0, 0, 1126, 0
_NET_WM_STRUT_PARTIAL(CARDINAL) = 0, 0, 1126, 0, 0, 0, 0, 0, 0, 1919, 0, 0
_NET_WM_DESKTOP(CARDINAL) = 4294967295
_KDE_NET_WM_BACKGROUND_CONTRAST_REGION(_KDE_NET_WM_BACKGROUND_CONTRAST_REGION) = 0x3f16e617, 0xbd67a2a7, 0xbd67a2a7, 0x0, 0xbe42cf1c, 0x3ee958f5, 0xbe42cf1c, 0x0, 0xbc9d543a, 0xbc9d543a, 0x3f2075a0, 0x0, 0x3f428f5d, 0x3f428f5d, 0x3f428f5d, 0x3f800000
_KDE_NET_WM_BLUR_BEHIND_REGION(CARDINAL) = 
_KDE_NET_WM_SHADOW(CARDINAL) = 39846142, 39846143, 39846144, 39846145, 39846146, 39846147, 39846148, 39846149, 1, 1, 6, 1
_KDE_NET_WM_DESKTOP_FILE(UTF8_STRING) = "org.kde.plasmashell"
XdndAware(ATOM) = BITMAP
_KDE_NET_WM_USER_CREATION_TIME(CARDINAL) = 170711
WM_NAME(STRING) = 
_NET_WM_NAME(UTF8_STRING) = "Plasma"
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x4, 0x0, 0x0, 0x0
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DOCK
_XEMBED_INFO(_XEMBED_INFO) = 0x0, 0x1
WM_CLIENT_LEADER(WINDOW): window id # 0x260000e
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: False
                Initial state is Normal State.
_NET_WM_PID(CARDINAL) = 995
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 39845989
WM_CLASS(STRING) = "plasmashell", "plasmashell"
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 location: 0, 1080
                user specified size: 1920 by 46
                program specified minimum size: 1920 by 46
                program specified maximum size: 1920 by 46
                window gravity: Static

------------------------------------------------------------------
------------------------------------------------------------------

2) The xprop output of the panel (in "Always visible" mode) on the upper monitor  corresponding to my second attachment:
_KDE_NET_WM_ACTIVITIES(STRING) = "00000000-0000-0000-0000-000000000000"
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_CHANGE_DESKTOP
WM_STATE(WM_STATE):
                window state: Normal
                icon window: 0x0
_NET_WM_STATE(ATOM) = 
_NET_WM_USER_TIME(CARDINAL) = 510988
_KDE_SLIDE(_KDE_SLIDE) = 0xffffffff, 0x3
_NET_WM_STRUT(CARDINAL) = 0, 0, 0, 1126
_NET_WM_STRUT_PARTIAL(CARDINAL) = 0, 0, 0, 1126, 0, 0, 0, 0, 0, 0, 0, 1919
_NET_WM_DESKTOP(CARDINAL) = 4294967295
_KDE_NET_WM_BACKGROUND_CONTRAST_REGION(_KDE_NET_WM_BACKGROUND_CONTRAST_REGION) = 0x3f16e617, 0xbd67a2a7, 0xbd67a2a7, 0x0, 0xbe42cf1c, 0x3ee958f5, 0xbe42cf1c, 0x0, 0xbc9d543a, 0xbc9d543a, 0x3f2075a0, 0x0, 0x3f428f5d, 0x3f428f5d, 0x3f428f5d, 0x3f800000
_KDE_NET_WM_BLUR_BEHIND_REGION(CARDINAL) = 
_KDE_NET_WM_SHADOW(CARDINAL) = 39845934, 39845959, 39845960, 39845961, 39845962, 39845963, 39845964, 39845965, 6, 1, 1, 1
_KDE_NET_WM_DESKTOP_FILE(UTF8_STRING) = "org.kde.plasmashell"
XdndAware(ATOM) = BITMAP
_KDE_NET_WM_USER_CREATION_TIME(CARDINAL) = 170711
WM_NAME(STRING) = 
_NET_WM_NAME(UTF8_STRING) = "Plasma"
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x4, 0x0, 0x0, 0x0
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DOCK
_XEMBED_INFO(_XEMBED_INFO) = 0x0, 0x1
WM_CLIENT_LEADER(WINDOW): window id # 0x260000e
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: False
                Initial state is Normal State.
_NET_WM_PID(CARDINAL) = 995
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 39845989
WM_CLASS(STRING) = "plasmashell", "plasmashell"
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 location: 0, 1034
                user specified size: 1920 by 46
                program specified minimum size: 1920 by 46
                program specified maximum size: 1920 by 46
                window gravity: Static


------------------------------------------------------------------
------------------------------------------------------------------

3) Additionally, the xprop output of another panel (in "Windows can cover" mode)  placed on the upper monitor in the same spot as the one in my second attachment:
_KDE_NET_WM_ACTIVITIES(STRING) = "00000000-0000-0000-0000-000000000000"
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_CHANGE_DESKTOP
WM_STATE(WM_STATE):
                window state: Normal
                icon window: 0x0
_NET_WM_STATE(ATOM) = 
_NET_WM_USER_TIME(CARDINAL) = 171049
_KDE_SLIDE(_KDE_SLIDE) = 0xffffffff, 0x3
_NET_WM_STRUT(CARDINAL) = 0, 0, 0, 0
_NET_WM_STRUT_PARTIAL(CARDINAL) = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
_NET_WM_DESKTOP(CARDINAL) = 4294967295
_KDE_NET_WM_BACKGROUND_CONTRAST_REGION(_KDE_NET_WM_BACKGROUND_CONTRAST_REGION) = 0x3f16e617, 0xbd67a2a7, 0xbd67a2a7, 0x0, 0xbe42cf1c, 0x3ee958f5, 0xbe42cf1c, 0x0, 0xbc9d543a, 0xbc9d543a, 0x3f2075a0, 0x0, 0x3f428f5d, 0x3f428f5d, 0x3f428f5d, 0x3f800000
_KDE_NET_WM_BLUR_BEHIND_REGION(CARDINAL) = 
_KDE_NET_WM_SHADOW(CARDINAL) = 39845934, 39845959, 39845960, 39845961, 39845962, 39845963, 39845964, 39845965, 6, 1, 1, 1
_KDE_NET_WM_DESKTOP_FILE(UTF8_STRING) = "org.kde.plasmashell"
XdndAware(ATOM) = BITMAP
_KDE_NET_WM_USER_CREATION_TIME(CARDINAL) = 170711
WM_NAME(STRING) = 
_NET_WM_NAME(UTF8_STRING) = "Plasma"
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x4, 0x0, 0x0, 0x0
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DOCK
_XEMBED_INFO(_XEMBED_INFO) = 0x0, 0x1
WM_CLIENT_LEADER(WINDOW): window id # 0x260000e
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: False
                Initial state is Normal State.
_NET_WM_PID(CARDINAL) = 995
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 39845989
WM_CLASS(STRING) = "plasmashell", "plasmashell"
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 location: 0, 1034
                user specified size: 1920 by 46
                program specified minimum size: 1920 by 46
                program specified maximum size: 1920 by 46
                window gravity: Static
Comment 5 Vlad Zahorodnii 2019-05-03 15:43:01 UTC
Created attachment 119823 [details]
Screenshot!!!

BTW, while investigating this bug I found yet another issue. Struts are messed up when running plasma with PLASMA_USE_QT_SCALING=1.

Most likely, plasmashell needs fixing.
Comment 6 Vlad Zahorodnii 2019-05-15 08:07:23 UTC
Git commit 67b2746ecdfd4c343db9d3fca088ae86d80a57f0 by Vlad Zagorodniy.
Committed on 15/05/2019 at 08:07.
Pushed by vladz into branch 'master'.

Compute correct boundaries in checkWorkspacePosition

Summary:
When a client sets a strut, checkWorkspacePosition will be called to
bump clients that touch corresponding screen edge.

In order to do that, checkWorkspacePosition needs to calculate client
boundaries before and after the restricted move area was changed. As it
turns out, if the client reserves space "between" screens, calculated
boundaries can be incorrect, which may lead to some funky results, e.g.
shrunken clients.

For example, let's say that there is a dual-monitor setup. If a client
reserves some amount of space at the right border of the left screen,
then clients on the right monitor will have rightMax which is equal to
the x coordinate of screenArea.

To fix that, this change ensures that only restricted areas belonging
to the same screen as the client are taken into account when computing
the boundaries.
Related: bug 404837

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20987

M  +4    -9    geometry.cpp

https://commits.kde.org/kwin/67b2746ecdfd4c343db9d3fca088ae86d80a57f0