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

List:       kde-commits
Subject:    kdeartwork/kwin-styles/cde
From:       Fredrik Höglund <fredrik () kde ! org>
Date:       2003-07-04 18:15:22
[Download RAW message or body]

CVS commit by fredrik: 

Call closeWindow() when the mouse button is released instead of when it's
pressed when the menu button is double-clicked. This prevents the mouse
release event from being sent to the widget underneath the window after
the window has been deleted.

Fixes bug reports #40125, #45621 and #46215, which are already closed.

Patch by Tim Stadelmann <t.stadelmann1@physics.ox.ac.uk>.


  M +10 -2     cdeclient.cpp   1.12
  M +3 -1      cdeclient.h   1.5


--- kdeartwork/kwin-styles/cde/cdeclient.cpp  #1.11:1.12
@@ -197,4 +197,5 @@ CdeClient::CdeClient( Workspace* ws, WId
 
     titlebarPressed = false;
+    closing = false;
 }
 
@@ -212,4 +213,5 @@ void CdeClient::addClientButtons( const 
                         button[BtnMenu] = new CdeButton( this, "menu", BtnMenu, i18n("Menu") );
                         connect( button[BtnMenu], SIGNAL(pressed()), SLOT(menuButtonPressed()) );
+                        connect( button[BtnMenu], SIGNAL(released()), SLOT(menuButtonReleased()) );
                         titleLayout->addWidget( button[BtnMenu] );
                     }
@@ -297,4 +299,10 @@ void CdeClient::menuButtonPressed()
     }
     else
+       closing = true;
+}
+
+void CdeClient::menuButtonReleased()
+{
+    if( closing )
         closeWindow();
 }

--- kdeartwork/kwin-styles/cde/cdeclient.h  #1.4:1.5
@@ -73,4 +73,5 @@ protected:
 protected slots:
     void menuButtonPressed();
+    void menuButtonReleased(); 
 
 private:
@@ -80,4 +81,5 @@ private:
     QSpacerItem* titlebar;
     bool titlebarPressed;
+    bool closing;
 };
 


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

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