Bug 317068

Summary: keepInArea does not work if window dimensions match the area dimensions
Product: [Plasma] kwin Reporter: Alexander Mezin <mezin.alexander>
Component: coreAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 4.10.1   
Target Milestone: 4.10.2   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 4.10.2

Description Alexander Mezin 2013-03-20 09:12:52 UTC
If I configure KWin to automatically maximize new windows, dialogs, whose parent window isn't maximized are placed wrongly. They look and behave almost like maximized, but they are offset to the right and sometimes down. The size is correct, however, so part of the window is located off screen.

Steps to reproduce:
1. Set "New window placement" to "Maximize"
2. Open, for example, system settings
3. Unmaximize the window
4. Click on any button which opens new dialog window

Always reproducible.
Comment 1 Thomas Lübking 2013-03-20 13:16:19 UTC
Bug in Client::keepInArea()

-    if (geometry().right() > area.right() && width() < area.width())
+    if (geometry().right() > area.right() && width() <= area.width())
        move(area.right() - width() + 1, y());
-    if (geometry().bottom() > area.bottom() && height() < area.height())
+    if (geometry().bottom() > area.bottom() && height() <= area.height())
        move(x(), area.bottom() - height() + 1);
Comment 2 Alexander Mezin 2013-03-20 19:25:17 UTC
Seems that "+ 1" is wrong too
Comment 3 Alexander Mezin 2013-03-20 19:38:39 UTC
Oh, sorry, "by historical reasons" bottom = top + height - 1, and the same for "right", according to qt documentation, so everything's right.
Comment 4 Thomas Lübking 2013-03-20 21:19:16 UTC
Git commit 380bdf0c567ed98316b208652162fb55c9420145 by Thomas Lübking.
Committed on 20/03/2013 at 20:19.
Pushed by luebking into branch 'KDE/4.10'.

catch maximized windows in ::keepInArea
FIXED-IN: 4.10.2

M  +2    -2    kwin/geometry.cpp

http://commits.kde.org/kde-workspace/380bdf0c567ed98316b208652162fb55c9420145
Comment 5 Thomas Lübking 2013-03-20 21:24:37 UTC
Git commit 328775331c11f288d819491b95d5af8ee9e70cf8 by Thomas Lübking.
Committed on 20/03/2013 at 20:19.
Pushed by luebking into branch 'master'.

catch maximized windows in ::keepInArea
FIXED-IN: 4.10.2

M  +2    -2    kwin/geometry.cpp

http://commits.kde.org/kde-workspace/328775331c11f288d819491b95d5af8ee9e70cf8