Bug 82272 - kwin crashes when loading kmyfirewall as root
Summary: kwin crashes when loading kmyfirewall as root
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: RedHat Enterprise Linux Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-26 22:44 UTC by Eduardo Robles Elvira
Modified: 2004-05-28 13:34 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 Eduardo Robles Elvira 2004-05-26 22:44:45 UTC
Version:            (using KDE KDE 3.2.2)
Installed from:    RedHat RPMs

kwin crashes when loading kmyfirewall as root - with my normal user it donesn't happen.  I'm using kmyfirewall 0.9.2 (lastest version). 

It's a kwin _crash_. The title bars of the windows dissapear, they cannot be moved and so on.. when restarting KDE, kwin is then shown.

Reproducible: Always.

[BTW, when kwin crashes, there's no debug window talking about it, and it's not reestarted automatically, which makes KDE unsuable. I'll search if this there's alrady a bug about this filled and if not, I'll send it.]
Comment 1 Eduardo Robles Elvira 2004-05-26 22:45:58 UTC
Sorry, the kmyfirewall version is not accurate, there's a typo error: the actual version is 0.9.6.2.
Comment 2 Lubos Lunak 2004-05-28 13:34:26 UTC
CVS commit by lunakl: 

Backport fix for #82272.
CCMAIL: 82272-done@bugs.kde.org


  M +2 -0      client.cpp   1.404.2.13
  M +1 -0      client.h   1.133.2.10
  M +14 -3     group.cpp   2.19.2.10


--- kdebase/kwin/client.cpp  #1.404.2.12:1.404.2.13
@@ -126,4 +126,5 @@ Client::Client( Workspace *ws )
     urgency = false;
     ignore_focus_stealing = false;
+    check_active_modal = false;
 
     Pdeletewindow = 0;
@@ -156,4 +157,5 @@ Client::~Client()
     assert( decoration == NULL );
     assert( block_geometry == 0 );
+    assert( !check_active_modal );
     delete info;
     delete bridge;

--- kdebase/kwin/client.h  #1.133.2.9:1.133.2.10
@@ -447,4 +447,5 @@ class Client : public QObject, public KD
         uint urgency : 1; // XWMHints, UrgencyHint
         uint ignore_focus_stealing : 1; // don't apply focus stealing prevention to this client
+        uint check_active_modal : 1; // see Client::addTransient()
         void getWMHints();
         void readIcons();

--- kdebase/kwin/group.cpp  #2.19.2.9:2.19.2.10
@@ -418,5 +418,5 @@ void Client::setTransient( Window new_tr
             assert( transient_for != NULL ); // verifyTransient() had to check this
             transient_for->addTransient( this );
-            }
+            } // checkGroup() will check 'check_active_modal'
         checkGroup( NULL, true ); // force, because transiency has changed
         workspace()->updateClientLayer( this );
@@ -627,5 +627,5 @@ void Client::addTransient( Client* cl )
     transients_list.append( cl );
     if( workspace()->mostRecentlyActivatedClient() == this && cl->isModal())
-        workspace()->activateClient( findModal());
+        check_active_modal = true;
 //    kdDebug() << "ADDTRANS:" << this << ":" << cl << endl;
 //    kdDebug() << kdBacktrace() << endl;
@@ -860,4 +860,15 @@ void Client::checkGroup( Group* set_grou
         }
     checkGroupTransients();
+    // if the active window got new modal transient, activate it
+    // cannot be done in AddTransient(), because there may temporarily
+    // exist loops, breaking findModal
+    Client* check_modal = workspace()->mostRecentlyActivatedClient();
+    if( check_modal != NULL && check_modal->check_active_modal )
+        {
+        Client* new_modal = check_modal->findModal();
+        if( new_modal != NULL && new_modal != check_modal )
+            workspace()->activateClient( new_modal );
+        check_modal->check_active_modal = false;
+        }
     workspace()->updateClientLayer( this );
     }