Bug 53158 - kwin crashes when switching windows
Summary: kwin crashes when switching windows
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Mandrake RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-19 14:55 UTC by Charlie Brooks
Modified: 2003-04-14 17:32 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Charlie Brooks 2003-01-19 14:55:26 UTC
Version:            (using KDE KDE 3.0.5)
Installed from:    Mandrake RPMs
OS:          Linux

After downloading KDE 3.0.5a from Mandrake (currently running Mandrake 9.0), kwin frequently segfaults. This occurs when running several applications shaded and in all desktops.Applications include kjots, jpilot, and gkrellm.  Crashes occur when switching between windows, or clicking on an icon in the panel for an application that is running on a different desktop. Also occurs when left-clicking in the titlebar of a window. 

The backtrace is as follows: 

0  0x4006d169 in KWinInternal::Client::mainClient() () from /usr/lib/kwin.so
(gdb) bt
#0  0x4006d169 in KWinInternal::Client::mainClient() () from /usr/lib/kwin.so
#1  0x4004956f in 
KWinInternal::Workspace::setActiveClient(KWinInternal::Client*) () from 
/usr/lib/kwin.so
#2  0x4004a724 in KWinInternal::Workspace::requestFocus(KWinInternal::Client*, 
bool) () from /usr/lib/kwin.so
#3  0x400507e0 in KWinInternal::Workspace::setCurrentDesktop(int) ()
   from /usr/lib/kwin.so
#4  0x40049cd0 in KWinInternal::Workspace::activateClient(KWinInternal::Client*, 
bool) () from /usr/lib/kwin.so
#5  0x4007d4b9 in KWinInternal::RootInfo::changeActiveWindow(unsigned long) ()
   from /usr/lib/kwin.so
#6  0x4030eda4 in NETRootInfo::event(_XEvent*) () from /usr/lib/libkdecore.so.4
#7  0x40045735 in KWinInternal::Workspace::workspaceEvent(_XEvent*) ()
   from /usr/lib/kwin.so
#8  0x40070f6e in Application::x11EventFilter(_XEvent*) () from /usr/lib/kwin.so
#9  0x405c3bfc in QApplication::x11ProcessEvent(_XEvent*) ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#10 0x405c38cf in QApplication::processNextEvent(bool) ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#11 0x4062e270 in QApplication::enter_loop() ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#12 0x405c332d in QApplication::exec() () from /usr/lib/qt3/lib/libqt-mt.so.3
#13 0x40071347 in kdemain () from /usr/lib/kwin.so
#14 0x0804855b in kdemain ()
#15 0x40d40082 in __libc_start_main () from /lib/i686/libc.so.6
Comment 1 Lubos Lunak 2003-04-14 16:50:26 UTC
Can you reproduce the problem also with KDE3.1? 
 
Comment 2 Lubos Lunak 2003-04-14 17:32:38 UTC
Subject: KDE_3_1_BRANCH: kdebase/kwin

CVS commit by lunakl: 

Backport r1.378, it should fix #52590,#53158 and #53323. I cannot actually
reproduce the problem, but this change removes code that appears
in the provided backtraces, so I suppose it will be fixed now.
CCMAIL:52590-done@bugs.kde.org
CCMAIL:53158-done@bugs.kde.org
CCMAIL:53323-done@bugs.kde.org


  M +8 -10     workspace.cpp   1.372.2.11


--- kdebase/kwin/workspace.cpp  #1.372.2.10:1.372.2.11
@@ -1663,5 +1663,5 @@ void Workspace::clientHidden( Client* c 
     if( popup )
         popup->close();
-    active_client = 0;
+    setActiveClient( NULL );
     should_get_focus = 0;
     c->setActive( FALSE ); // clear the state in the client
@@ -2181,6 +2181,4 @@ void Workspace::focusToNull(){
   }
   XSetInputFocus(qt_xdisplay(), null_focus_window, RevertToPointerRoot, qt_x_time );
-  if( !block_focus )
-      setActiveClient( 0 );
 }
 
@@ -2273,6 +2271,4 @@ void Workspace::setCurrentDesktop( int n
         return;
 
-    Client* old_active_client = active_client;
-    active_client = 0;
     if( popup )
         popup->close();
@@ -2325,7 +2321,6 @@ void Workspace::setCurrentDesktop( int n
         // Search in focus chain
 
-        if ( focus_chain.contains( old_active_client ) && old_active_client->isVisible() ) {
-            c = old_active_client;
-            active_client = c; // the requestFocus below will fail, as the client is already active
+        if ( focus_chain.contains( active_client ) && active_client->isVisible() ) {
+            c = active_client; // the requestFocus below will fail, as the client is already active
         }
 
@@ -2362,6 +2357,9 @@ void Workspace::setCurrentDesktop( int n
     // and active_client is sticky and under mouse (hence == old_active_client),
     // conserve focus (thanks to Volker Schatz <V.Schatz at thphys.uni-heidelberg.de>)
-    else if( old_active_client && old_active_client->isVisible() )
-      c= old_active_client;
+    else if( active_client && active_client->isVisible() )
+      c= active_client;
+
+    if( c != active_client )
+        setActiveClient( NULL );
 
     if ( c ) {