diff --git a/events.cpp b/events.cpp index 5b5f434946..caa28d3984 100644 --- a/events.cpp +++ b/events.cpp @@ -402,15 +402,15 @@ bool Workspace::workspaceEvent( XEvent * e ) if ( e->xconfigurerequest.parent == root ) { XWindowChanges wc; - unsigned int value_mask = 0; - wc.border_width = 0; + wc.border_width = e->xconfigurerequest.border_width; wc.x = e->xconfigurerequest.x; wc.y = e->xconfigurerequest.y; wc.width = e->xconfigurerequest.width; wc.height = e->xconfigurerequest.height; wc.sibling = None; wc.stack_mode = Above; - value_mask = e->xconfigurerequest.value_mask | CWBorderWidth; + unsigned int value_mask = e->xconfigurerequest.value_mask + & ( CWX | CWY | CWWidth | CWHeight | CWBorderWidth ); XConfigureWindow( QX11Info::display(), e->xconfigurerequest.window, value_mask, &wc ); return true; } diff --git a/kcmkwin/kwinoptions/windows.cpp b/kcmkwin/kwinoptions/windows.cpp index b101775123..a02acd0106 100644 --- a/kcmkwin/kwinoptions/windows.cpp +++ b/kcmkwin/kwinoptions/windows.cpp @@ -233,6 +233,7 @@ KFocusConfig::KFocusConfig (bool _standAlone, KConfig *_config, KInstance *inst, " is pressed, with no popup widget. In addition, the previously" " activated window will be sent to the back in this mode."); altTabPopup->setWhatsThis( wtstr ); + connect(focusCombo, SIGNAL(activated(int)), this, SLOT(updateAltTabMode())); traverseAll = new QCheckBox( i18n( "&Traverse windows on all desktops" ), kbdBox ); kLay->addWidget( traverseAll ); @@ -284,6 +285,13 @@ void KFocusConfig::setFocus(int foc) // this will disable/hide the auto raise delay widget if focus==click setAutoRaiseEnabled(); + updateAltTabMode(); +} + +void KFocusConfig::updateAltTabMode() +{ + // not KDE-style Alt+Tab with unreasonable focus policies + altTabPopup->setEnabled( focusCombo->currentItem() == 0 || focusCombo->currentItem() == 1 ); } void KFocusConfig::setAutoRaiseInterval(int tb) diff --git a/kcmkwin/kwinoptions/windows.h b/kcmkwin/kwinoptions/windows.h index 991ecd5263..181980c0f5 100644 --- a/kcmkwin/kwinoptions/windows.h +++ b/kcmkwin/kwinoptions/windows.h @@ -85,6 +85,7 @@ private slots: void autoRaiseOnTog(bool);//CT 23Oct1998 void delayFocusOnTog(bool); void clickRaiseOnTog(bool); + void updateAltTabMode(); void changed() { emit KCModule::changed(true); } diff --git a/tabbox.cpp b/tabbox.cpp index 3986d8d90c..f6ad7c09da 100644 --- a/tabbox.cpp +++ b/tabbox.cpp @@ -760,7 +760,7 @@ void Workspace::slotWalkThroughWindows() return; if ( tab_grab || control_grab ) return; - if ( options->altTabStyle == Options::CDE ) + if ( options->altTabStyle == Options::CDE || !options->focusPolicyIsReasonable()) { //XUngrabKeyboard(QX11Info::display(), QX11Info::appTime()); // need that because of accelerator raw mode // CDE style raise / lower @@ -786,7 +786,7 @@ void Workspace::slotWalkBackThroughWindows() return; if( tab_grab || control_grab ) return; - if ( options->altTabStyle == Options::CDE ) + if ( options->altTabStyle == Options::CDE || !options->focusPolicyIsReasonable()) { // CDE style raise / lower CDEWalkThroughWindows( false ); @@ -923,7 +923,24 @@ void Workspace::walkThroughDesktops( bool forward ) void Workspace::CDEWalkThroughWindows( bool forward ) { - Client* c = activeClient(); + Client* c = NULL; +// this function find the first suitable client for unreasonable focus +// policies - the topmost one, with some exceptions (can't be keepabove/below, +// otherwise it gets stuck on them) + Q_ASSERT( block_stacking_updates == 0 ); + for( int i = stacking_order.size() - 1; + i >= 0 ; + --i ) + { + Client* it = stacking_order.at( i ); + if ( it->isOnCurrentDesktop() && !it->isSpecialWindow() + && it->isShown( false ) && it->wantsTabFocus() + && !it->keepAbove() && !it->keepBelow()) + { + c = it; + break; + } + } Client* nc = c; bool options_traverse_all; { @@ -949,7 +966,7 @@ void Workspace::CDEWalkThroughWindows( bool forward ) } } while (nc && nc != c && (( !options_traverse_all && !nc->isOnDesktop(currentDesktop())) || - nc->isMinimized() || !nc->wantsTabFocus() ) ); + nc->isMinimized() || !nc->wantsTabFocus() || nc->keepAbove() || nc->keepBelow() ) ); if (nc) { if (c && c != nc)