[kdebase-workspace] fix kwin + nvidia + twinview
Lukas Tinkl
ltinkl at fedoraproject.org
Wed Nov 16 12:37:09 UTC 2011
commit 4ef311dbe8b2c1663e05bba398b445ad76d34ef5
Author: Lukas Tinkl <lukas at kde.org>
Date: Wed Nov 16 13:36:42 2011 +0100
fix kwin + nvidia + twinview
kdebase-workspace-4.8.0-kwin-twinview.patch | 70 +++++++++++++++++++++++++++
kdebase-workspace.spec | 10 ++++-
2 files changed, 79 insertions(+), 1 deletions(-)
---
diff --git a/kdebase-workspace-4.8.0-kwin-twinview.patch b/kdebase-workspace-4.8.0-kwin-twinview.patch
new file mode 100644
index 0000000..09628b4
--- /dev/null
+++ b/kdebase-workspace-4.8.0-kwin-twinview.patch
@@ -0,0 +1,70 @@
+diff --git a/kwin/manage.cpp b/kwin/manage.cpp
+index d1b400f..ba5f8d2 100644
+--- a/kwin/manage.cpp
++++ b/kwin/manage.cpp
+@@ -365,6 +365,38 @@ bool Client::manage(Window w, bool isMapped)
+ placementDone = true;
+ }
+
++ // bugs #285967, #286146, #183694
++ // geometry() now includes the requested size and the decoration and is at the correct screen/position (hopefully)
++ // Maximization for oversized windows must happen NOW.
++ // If we effectively pass keepInArea(), the window will resizeWithChecks() - i.e. constrained
++ // to the combo of all screen MINUS all struts on the edges
++ // If only one screen struts, this will affect screens as a side-effect, the window is artificailly shrinked
++ // below the screen size and as result no more maximized what breaks KMainWindow's stupid width+1, height+1 hack
++ // TODO: get KMainWindow a correct state storage what will allow to store the restore size as well.
++
++ if (!session) { // has a better handling of this
++ geom_restore = geometry(); // Remember restore geometry
++ if (isMaximizable() && (width() >= area.width() || height() >= area.height())) {
++ // Window is too large for the screen, maximize in the
++ // directions necessary
++ if (width() >= area.width() && height() >= area.height()) {
++ dontKeepInArea = true;
++ maximize(Client::MaximizeFull);
++ geom_restore = QRect(); // Use placement when unmaximizing
++ } else if (width() >= area.width()) {
++ maximize(Client::MaximizeHorizontal);
++ geom_restore = QRect(); // Use placement when unmaximizing
++ geom_restore.setY(y()); // But only for horizontal direction
++ geom_restore.setHeight(height());
++ } else if (height() >= area.height()) {
++ maximize(Client::MaximizeVertical);
++ geom_restore = QRect(); // Use placement when unmaximizing
++ geom_restore.setX(x()); // But only for vertical direction
++ geom_restore.setWidth(width());
++ }
++ }
++ }
++
+ if ((!isSpecialWindow() || isToolbar()) && isMovable() && !dontKeepInArea)
+ keepInArea(area, partial_keep_in_area);
+
+@@ -430,26 +462,6 @@ bool Client::manage(Window w, bool isMapped)
+ geom_fs_restore = session->fsrestore;
+ }
+ } else {
+- geom_restore = geometry(); // Remember restore geometry
+- if (isMaximizable() && (width() >= area.width() || height() >= area.height())) {
+- // Window is too large for the screen, maximize in the
+- // directions necessary
+- if (width() >= area.width() && height() >= area.height()) {
+- maximize(Client::MaximizeFull);
+- geom_restore = QRect(); // Use placement when unmaximizing
+- } else if (width() >= area.width()) {
+- maximize(Client::MaximizeHorizontal);
+- geom_restore = QRect(); // Use placement when unmaximizing
+- geom_restore.setY(y()); // But only for horizontal direction
+- geom_restore.setHeight(height());
+- } else if (height() >= area.height()) {
+- maximize(Client::MaximizeVertical);
+- geom_restore = QRect(); // Use placement when unmaximizing
+- geom_restore.setX(x()); // But only for vertical direction
+- geom_restore.setWidth(width());
+- }
+- }
+-
+ // Window may want to be maximized
+ // done after checking that the window isn't larger than the workarea, so that
+ // the restore geometry from the checks above takes precedence, and window
diff --git a/kdebase-workspace.spec b/kdebase-workspace.spec
index 8a57852..d6da135 100644
--- a/kdebase-workspace.spec
+++ b/kdebase-workspace.spec
@@ -9,7 +9,7 @@
Summary: KDE Workspace
Name: kdebase-workspace
Version: 4.7.3
-Release: 9%{?dist}
+Release: 10%{?dist}
License: GPLv2
Group: User Interface/Desktops
@@ -88,6 +88,10 @@ Patch210: kdebase-workspace-4.5.90-no_HAL2.patch
## trunk patches
# Fix possible uninitialized variable use in ksplashx multi-screen code
Patch300: kde-workspace-4.7.3-ksplashx.patch
+# There are a bug in Kwin when using nVidia + TwinView + 2 monitors with
+# differents resolutions, see https://bugs.kde.org/show_bug.cgi?id=286146 and
+# https://bugs.kde.org/show_bug.cgi?id=285967
+Patch301: kdebase-workspace-4.8.0-kwin-twinview.patch
# multilib fixed in 4.6.3-5, see https://bugzilla.redhat.com/704840
Obsoletes: kdebase-workspace < 4.6.3-5
@@ -377,6 +381,7 @@ Requires: akonadi
# trunk patches
%patch300 -p1 -b .ksplashx
+%patch301 -p1 -b .twinview
%build
@@ -839,6 +844,9 @@ fi
%changelog
+* Wed Nov 16 2011 Lukas Tinkl <ltinkl at redhat.com> 4.7.3-10
+- fix kwin + twinview
+
* Tue Nov 15 2011 Rex Dieter <rdieter at fedoraproject.org> 4.7.3-9
- kdm-themes subpkg (#753409)
More information about the scm-commits
mailing list