Initialize values needed for electric borders even in the only-move case.

(#79252).

svn path=/trunk/kdebase/kwin/; revision=304267
This commit is contained in:
Luboš Luňák 2004-04-16 16:17:32 +00:00
parent 425e10ed1d
commit 23ac6a4381
3 changed files with 19 additions and 16 deletions

View file

@ -43,11 +43,7 @@ namespace KWinInternal
void Workspace::desktopResized() void Workspace::desktopResized()
{ {
updateClientArea(); updateClientArea();
if (options->electricBorders() == Options::ElectricAlways) checkElectricBorders();
{ // update electric borders
destroyBorderWindows();
createBorderWindows();
}
} }
/*! /*!

View file

@ -171,8 +171,7 @@ Workspace::Workspace( bool restore )
void Workspace::init() void Workspace::init()
{ {
if (options->electricBorders() == Options::ElectricAlways) checkElectricBorders();
createBorderWindows();
supportWindow = new QWidget; supportWindow = new QWidget;
XLowerWindow( qt_xdisplay(), supportWindow->winId()); // see usage in layers.cpp XLowerWindow( qt_xdisplay(), supportWindow->winId()); // see usage in layers.cpp
@ -758,10 +757,7 @@ void Workspace::slotReconfigure()
forEachClient( CheckBorderSizesProcedure()); forEachClient( CheckBorderSizesProcedure());
} }
if (options->electricBorders() == Options::ElectricAlways) checkElectricBorders();
createBorderWindows();
else
destroyBorderWindows();
if( options->topMenuEnabled() && !managingTopMenus()) if( options->topMenuEnabled() && !managingTopMenus())
{ {
@ -1646,12 +1642,8 @@ QWidget* Workspace::desktopWidget()
// borders. Technically this is done with input only windows. Since // borders. Technically this is done with input only windows. Since
// electric borders can be switched on and off, we have these two // electric borders can be switched on and off, we have these two
// functions to create and destroy them. // 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; electric_current_border = 0;
QRect r = QApplication::desktop()->geometry(); QRect r = QApplication::desktop()->geometry();
@ -1660,6 +1652,20 @@ void Workspace::createBorderWindows()
electricLeft = r.left(); electricLeft = r.left();
electricRight = r.right(); 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; XSetWindowAttributes attributes;
unsigned long valuemask; unsigned long valuemask;
attributes.override_redirect = True; attributes.override_redirect = True;

View file

@ -386,6 +386,7 @@ class Workspace : public QObject, public KWinInterface, public KDecorationDefine
void tabBoxKeyRelease( const XKeyEvent& ev ); void tabBoxKeyRelease( const XKeyEvent& ev );
// electric borders // electric borders
void checkElectricBorders();
void createBorderWindows(); void createBorderWindows();
void destroyBorderWindows(); void destroyBorderWindows();
void electricBorder(XEvent * e); void electricBorder(XEvent * e);