From c765d03a3460649771486299aed4c8766838d7a0 Mon Sep 17 00:00:00 2001 From: Michael Webster Date: Sun, 10 Mar 2013 20:31:32 -0400 Subject: [PATCH] Fix onGrabBroken when dragging items or using popup menus (Yay!) --- usr/lib/linuxmint/mintMenu/mintMenu.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index 4e1a557..1060542 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -492,17 +492,19 @@ class MainWindow( object ): return True def onGrabBroken( self, widget, event ): - return if event.grab_broken.grab_window: try: - theft = event.grab_broken.grab_window.get_user_data() + win = event.grab_broken.grab_window + data = c_void_p() + gdk.gdk_window_get_user_data(hash(win), byref(data)) + theft = capi.get_widget(ctypes.cast(data, POINTER(capi._PyGObject_Functions))) theft.connect( "event", self.onGrabTheftEvent ) except Exception, detail: print detail - self.window.hide( True ) + self.window.hide() def onGrabTheftEvent( self, widget, event ): - if event.type == Gdk.UNMAP or event.type == Gdk.SELECTION_CLEAR: + if event.type == Gdk.EventType.UNMAP or event.type == Gdk.EventType.SELECTION_CLEAR: self.grab() def hide(self, forceHide = False):