Ok, I've had enough with Alt+Tab and mouse focus policies:

- use click to focus or focus follows mouse and I'll be fine
- with the remaining unreasonable focus policies only the CDE-style
  tabbox works that raises and lowers windows and ignores
  keep above/below windows
- if you don't like that, provide a patch for kwin/tabbox.cpp
- tabbox should be completely redesigned for KDE4
(#123890,#105263,#84424)


svn path=/trunk/KDE/kdebase/workspace/; revision=528579
This commit is contained in:
Luboš Luňák 2006-04-11 12:59:59 +00:00
parent 6dc0858b2c
commit 5d1255dd73
4 changed files with 33 additions and 7 deletions

View file

@ -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;
}

View file

@ -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)

View file

@ -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); }

View file

@ -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)