From 23ac6a4381150450da14af3f341876514420f75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Fri, 16 Apr 2004 16:17:32 +0000 Subject: [PATCH] Initialize values needed for electric borders even in the only-move case. (#79252). svn path=/trunk/kdebase/kwin/; revision=304267 --- geometry.cpp | 6 +----- workspace.cpp | 28 +++++++++++++++++----------- workspace.h | 1 + 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index cefe1d3ea5..7051d47904 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -43,11 +43,7 @@ namespace KWinInternal void Workspace::desktopResized() { updateClientArea(); - if (options->electricBorders() == Options::ElectricAlways) - { // update electric borders - destroyBorderWindows(); - createBorderWindows(); - } + checkElectricBorders(); } /*! diff --git a/workspace.cpp b/workspace.cpp index 9ad6a894f2..abd809470d 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -171,8 +171,7 @@ Workspace::Workspace( bool restore ) void Workspace::init() { - if (options->electricBorders() == Options::ElectricAlways) - createBorderWindows(); + checkElectricBorders(); supportWindow = new QWidget; XLowerWindow( qt_xdisplay(), supportWindow->winId()); // see usage in layers.cpp @@ -758,10 +757,7 @@ void Workspace::slotReconfigure() forEachClient( CheckBorderSizesProcedure()); } - if (options->electricBorders() == Options::ElectricAlways) - createBorderWindows(); - else - destroyBorderWindows(); + checkElectricBorders(); if( options->topMenuEnabled() && !managingTopMenus()) { @@ -1646,12 +1642,8 @@ QWidget* Workspace::desktopWidget() // borders. Technically this is done with input only windows. Since // electric borders can be switched on and off, we have these two // functions to create and destroy them. -void Workspace::createBorderWindows() +void Workspace::checkElectricBorders() { - if ( electric_have_borders ) - return; - - electric_have_borders = true; electric_current_border = 0; QRect r = QApplication::desktop()->geometry(); @@ -1660,6 +1652,20 @@ void Workspace::createBorderWindows() electricLeft = r.left(); electricRight = r.right(); + if (options->electricBorders() == Options::ElectricAlways) + createBorderWindows(); + else + destroyBorderWindows(); + } + +void Workspace::createBorderWindows() + { + if ( electric_have_borders ) + return; + + electric_have_borders = true; + + QRect r = QApplication::desktop()->geometry(); XSetWindowAttributes attributes; unsigned long valuemask; attributes.override_redirect = True; diff --git a/workspace.h b/workspace.h index c1b390d460..b33d94ec91 100644 --- a/workspace.h +++ b/workspace.h @@ -386,6 +386,7 @@ class Workspace : public QObject, public KWinInterface, public KDecorationDefine void tabBoxKeyRelease( const XKeyEvent& ev ); // electric borders + void checkElectricBorders(); void createBorderWindows(); void destroyBorderWindows(); void electricBorder(XEvent * e);