Bug 335043

Summary: Window size incorrect in asymmetric multi-monitor setup
Product: [Plasma] kwin Reporter: Bernd Steinhauser <linux>
Component: xrandrAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: sebas
Priority: NOR Flags: thomas.luebking: ReviewRequest+
Version: 4.11.9   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
URL: https://git.reviewboard.kde.org/r/118412/
Latest Commit: Version Fixed In:

Description Bernd Steinhauser 2014-05-19 19:26:39 UTC
Not sure, if this is a bug in kwin or libkscreen.

I have a multi-monitor setup with two screens, with VGA-0 right of HDMI-0:
xrandr 
Screen 0: minimum 320 x 200, current 3520 x 1200, maximum 8192 x 8192
VGA-0 connected 1600x1200+1920+0 (normal left inverted right x axis y axis) 432mm x 324mm
   1600x1200     60.00*+
[...]
HDMI-0 connected primary 1920x1200+0+0 (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200     59.95*+
[...]

If the smaller screen (VGA-0) is active and I open a program (i.e. dolphin) that pops up maximized on that screen, the window size of this window is incorrect. It's not 1600x1200 (minus panel size), but 1920x1200 (minus panel size) instead (I guess it refers to the size of the primary screen). This is not bound to KDE(4) apps but happens with i.e. Firefox, too.
Maximizing the window resizes the window to the appropriate size on that screen.

This is present in both KDE4-based as well as KF5-based kwin (which I'm currently running).

Reproducible: Always
Comment 1 Martin Flöser 2014-05-19 20:05:02 UTC
can confirm. Observed the same just a few hours ago. Similar setup, smaller 
screen on the right, tried to open window on the right screen. Didn't check 
the size, though.
Comment 2 Thomas Lübking 2014-05-19 20:41:09 UTC
Source is https://git.reviewboard.kde.org/r/114484/

The client restores to the fomer size (resp. the one of the "wrong" primary screen) - but the oversize should be constrained (and the window set maximized)
Comment 3 Thomas Lübking 2014-05-19 20:57:05 UTC
Nope.
It's not constrained by (my ...) intention - there's heuristic for the special "+1" case and since the requested window size still fits into the combined screen, i took this as "window wants this size, but doesn't fit into the current screen - doesn't matter since there's enough space")
The client is (likely) still vertically maximized, since it will fit that "+1" case in this direction.

The bug here (in KWin) is that the new window can still partially drop out of the combined screen - that should not happen (needs a special keepInArea() call for the FullArea)
Comment 4 Martin Flöser 2014-05-20 05:25:29 UTC
> The client is (likely) still vertically maximized, since it will fit that
> "+1" case in this direction.

Correct:
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT
Comment 5 Thomas Lübking 2014-05-29 22:37:44 UTC
"fix" what should be fixed.
fix for the actual problem linked in comment #2, kdelibs defect
Comment 6 Thomas Lübking 2014-05-30 22:10:22 UTC
Git commit d7c2434a9e144dd2e7f1519d78b333e7d4d3bfc7 by Thomas Lübking.
Committed on 29/05/2014 at 20:40.
Pushed by luebking into branch 'KDE/4.11'.

keep oversized windows in fullscreen area

huge windows are not contrained to their initial screen
(the user might want to move them to the other instead),
but we must not let them drop out of the fullscreen area
either
REVIEW: 118412

M  +10   -3    kwin/manage.cpp

http://commits.kde.org/kde-workspace/d7c2434a9e144dd2e7f1519d78b333e7d4d3bfc7
Comment 7 Martin Flöser 2014-06-04 14:40:47 UTC
Git commit d6ea601005664bd86c46193d8e27de659d3dc479 by Martin Gräßlin, on behalf of Thomas Lübking.
Committed on 29/05/2014 at 20:40.
Pushed by graesslin into branch 'master'.

keep oversized windows in fullscreen area

huge windows are not contrained to their initial screen
(the user might want to move them to the other instead),
but we must not let them drop out of the fullscreen area
either

Forward port of d7c2434a9e144dd2e7f1519d78b333e7d4d3bfc7 from kde-workspace

M  +10   -3    manage.cpp

http://commits.kde.org/kwin/d6ea601005664bd86c46193d8e27de659d3dc479
Comment 8 Sebastian Kügler 2016-08-17 03:59:23 UTC
Fixed long ago, not sure why this bug isn't closed.