[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwin
Subject:    [Bug 117169] context switching with keyboard (alt+tab) is dog slow
From:       Lubos Lunak <l.lunak () kde ! org>
Date:       2006-07-31 9:50:13
Message-ID: 20060731095013.15761.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=117169         
l.lunak kde org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From l.lunak kde org  2006-07-31 11:50 -------
SVN commit 568154 by lunakl:

The workaround for #117169 (probably X bug, see comment #34).
Not committing to trunk in hope that the problem will be gone
by the time of KDE4 and also because KGlobalAccel is different,
in the worst case if the problem persists it will have to
be ported.
BUG: 117169



 M  +15 -15    kdebase/kwin/tabbox.cpp  
 M  +6 -6      kdebase/kwin/useractions.cpp  
 M  +3 -0      kdelibs/kdecore/kglobalaccel.cpp  
 M  +6 -0      kdelibs/kdecore/kglobalaccel.h  
 M  +10 -1     kdelibs/kdecore/kglobalaccel_x11.cpp  
 M  +2 -0      kdelibs/kdecore/kglobalaccel_x11.h  


--- branches/KDE/3.5/kdebase/kwin/tabbox.cpp #568153:568154
 @ -881,9 +881,9  @
     if( !establishTabBoxGrab())
         return false;
     tab_grab        = TRUE;
-    keys->setEnabled( false );
-    disable_shortcuts_keys->setEnabled( false );
-    client_keys->setEnabled( false );
+    keys->suspend( true );
+    disable_shortcuts_keys->suspend( true );
+    client_keys->suspend( true );
     tab_box->setMode( TabBox::WindowsMode );
     tab_box->reset();
     return TRUE;
 @ -894,9 +894,9  @
     if( !establishTabBoxGrab())
         return false;
     control_grab = TRUE;
-    keys->setEnabled( false );
-    disable_shortcuts_keys->setEnabled( false );
-    client_keys->setEnabled( false );
+    keys->suspend( true );
+    disable_shortcuts_keys->suspend( true );
+    client_keys->suspend( true );
     tab_box->setMode( (TabBox::Mode) mode );
     tab_box->reset();
     return TRUE;
 @ -1064,9 +1064,9  @
     {
     removeTabBoxGrab();
     tab_box->hide();
-    keys->setEnabled( true );
-    disable_shortcuts_keys->setEnabled( true );
-    client_keys->setEnabled( true );
+    keys->suspend( false );
+    disable_shortcuts_keys->suspend( false );
+    client_keys->suspend( false );
     tab_grab = FALSE;
     control_grab = FALSE;
     }
 @ -1113,9 +1113,9  @
         {
         removeTabBoxGrab();
         tab_box->hide();
-        keys->setEnabled( true );
-        disable_shortcuts_keys->setEnabled( true );
-        client_keys->setEnabled( true );
+        keys->suspend( false );
+        disable_shortcuts_keys->suspend( false );
+        client_keys->suspend( false );
         tab_grab = false;
         if( Client* c = tab_box->currentClient())
             {
 @ -1128,9 +1128,9  @
         {
         removeTabBoxGrab();
         tab_box->hide();
-        keys->setEnabled( true );
-        disable_shortcuts_keys->setEnabled( true );
-        client_keys->setEnabled( true );
+        keys->suspend( false );
+        disable_shortcuts_keys->suspend( false );
+        client_keys->suspend( false );
         control_grab = False;
         if ( tab_box->currentDesktop() != -1 )
             {
--- branches/KDE/3.5/kdebase/kwin/useractions.cpp #568153:568154
 @ -281,9 +281,9  @
 void Workspace::setupWindowShortcut( Client* c )
     {
     assert( client_keys_dialog == NULL );
-    keys->setEnabled( false );
-    disable_shortcuts_keys->setEnabled( false );
-    client_keys->setEnabled( false );
+    keys->suspend( true );
+    disable_shortcuts_keys->suspend( true );
+    client_keys->suspend( true );
     client_keys_dialog = new ShortcutDialog( c->shortcut());
     client_keys_client = c;
     connect( client_keys_dialog, SIGNAL( dialogDone( bool )), SLOT( setupWindowShortcutDone( bool )));
 @ -302,9 +302,9  @
 
 void Workspace::setupWindowShortcutDone( bool ok )
     {
-    keys->setEnabled( true );
-    disable_shortcuts_keys->setEnabled( true );
-    client_keys->setEnabled( true );
+    keys->suspend( false );
+    disable_shortcuts_keys->suspend( false );
+    client_keys->suspend( false );
     if( ok )
         {
         client_keys_client->setShortcut( KShortcut( client_keys_dialog->shortcut()).toString());
--- branches/KDE/3.5/kdelibs/kdecore/kglobalaccel.cpp #568153:568154
 @ -65,6 +65,9  @
 void KGlobalAccel::setEnabled( bool bEnabled )
 	{ d->setEnabled( bEnabled ); }
 
+void KGlobalAccel::suspend( bool s )
+	{ d->suspend( s ); }
+
 void KGlobalAccel::blockShortcuts( bool block )
         { KGlobalAccelPrivate::blockShortcuts( block ); }
 
--- branches/KDE/3.5/kdelibs/kdecore/kglobalaccel.h #568153:568154
 @ -215,6 +215,12  @
          *  internal
          */
         void disableBlocking( bool disable );
+        
+        /**
+         *  internal
+         */
+        // like setEnabled(), but doesn't ungrab (see in KGlobalAccelPrivate)
+        void suspend( bool s );
 
 private:
 
--- branches/KDE/3.5/kdelibs/kdecore/kglobalaccel_x11.cpp #568153:568154
 @ -82,6 +82,7  @
 : KAccelBase( KAccelBase::NATIVE_KEYS )
 , m_blocked( false )
 , m_blockingDisabled( false )
+, m_suspended( false )
 {
         if( all_accels == NULL )
             all_accels = new QValueList< KGlobalAccelPrivate* >;
 @ -133,6 +134,13  @
         return KAccelBase::isEnabled() && !m_blocked;
 }
 
+// see #117169 - the bug is hard to reproduce, probably somewhere in X, testcase would be probably
+// difficult to make, and so on - just don't release the grabs and only ignore the events instead
+void KGlobalAccelPrivate::suspend( bool s )
+{
+	m_suspended = s;
+}
+
 bool KGlobalAccelPrivate::emitSignal( Signal )
 {
 	return false;
 @ -267,7 +275,7  @
                 XFlush( qt_xdisplay()); // avoid X(?) bug
         }
 
-	if( !isEnabledInternal())
+	if( !isEnabledInternal() || m_suspended )
 		return false;
 
 	CodeMod codemod;
 @ -317,6 +325,7  @
 #endif
 		return false;
 	}
+        
 	KAccelAction* pAction = m_rgCodeModToAction[codemod];
 
 	if( !pAction ) {
--- branches/KDE/3.5/kdelibs/kdecore/kglobalaccel_x11.h #568153:568154
 @ -96,12 +96,14  @
 	virtual bool isEnabledInternal() const;
 	static void blockShortcuts( bool block );
 	void disableBlocking( bool disable );
+        void suspend( bool s );
 
  protected slots:
 	void slotActivated( int iAction );
  private:
 	bool m_blocked;
 	bool m_blockingDisabled;
+        bool m_suspended;
 };
 
 #endif // _KGLOBALACCEL_X11_H
_______________________________________________
Kwin mailing list
Kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic