Bug 317068 - keepInArea does not work if window dimensions match the area dimensions
Summary: keepInArea does not work if window dimensions match the area dimensions
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Unclassified
Component: core (show other bugs)
Version: 4.10.1
Platform: Gentoo Packages Linux
: NOR normal (vote)
Target Milestone: 4.10.2
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-20 09:12 UTC by Alexander Mezin
Modified: 2013-03-25 07:51 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.10.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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