From 492a4219c10697d9bb2f115cf08772eaf8ff9541 Mon Sep 17 00:00:00 2001 From: hordepfo Date: Wed, 22 Jan 2014 01:25:49 +0000 Subject: [PATCH 1/2] Fixed popup menus behaviour Some popups, like the right click menus on the Apps page or the Search button, pop up and back down immediately. Now they work as they should. Fixes #28 --- usr/lib/linuxmint/mintMenu/plugins/applications.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index c41ebcf..3d36e85 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -341,7 +341,7 @@ class pluginclass( object ): self.panel = "top" self.panel_position = -1 - self.builder.get_object("searchButton").connect( "button-release-event", self.searchPopup ) + self.builder.get_object("searchButton").connect( "button-press-event", self.searchPopup ) def refresh_apt_cache(self): if self.useAPT: @@ -1035,7 +1035,7 @@ class pluginclass( object ): startupMenuItem.connect( "toggled", self.onAddToStartup, widget ) mTree.connect( 'deactivate', self.onMenuPopupDeactivate) - gtk.gtk_menu_popup(hash(mTree), None, None, None, None, 0, 0) + gtk.gtk_menu_popup(hash(mTree), None, None, None, None, event.button, event.time) def onMenuPopupDeactivate( self, widget): self.mintMenuWin.grab() @@ -1348,7 +1348,7 @@ class pluginclass( object ): space = Gtk.EventBox() space.set_size_request( -1, 20 ) space.set_visible_window(False) - space.connect( "button_release_event", self.favPopup ) + space.connect( "button-press-event", self.favPopup ) space.type = "space" self.mintMenuWin.SetPaneColors( [ space ] ) @@ -1367,7 +1367,7 @@ class pluginclass( object ): box.type = "separator" box.add(separator) box.set_visible_window(False) - box.connect( "button_release_event", self.favPopup ) + box.connect( "button-press-event", self.favPopup ) box.show_all() return box @@ -1405,7 +1405,7 @@ class pluginclass( object ): if favButton.appExec: favButton.show() favButton.connect( "popup-menu", self.favPopup ) - favButton.connect( "button_release_event", self.favPopup ) + favButton.connect( "button-press-event", self.favPopup ) favButton.connect( "focus-in-event", self.scrollItemIntoView ) favButton.connect( "clicked", lambda w: self.mintMenuWin.hide() ) From 8ae0e15b001329be14633cda30c749cfb582049e Mon Sep 17 00:00:00 2001 From: hordepfo Date: Wed, 22 Jan 2014 01:27:26 +0000 Subject: [PATCH 2/2] Search button was clearing the search entry preemptively --- usr/lib/linuxmint/mintMenu/plugins/applications.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 3d36e85..fa0c961 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -1114,14 +1114,14 @@ class pluginclass( object ): menu.show_all() - gtk.gtk_menu_popup(hash(menu), None, None, None, None, 3, 0) + gtk.gtk_menu_popup(hash(menu), None, None, None, None, event.button, event.time) #menu.attach_to_widget(self.searchButton, None) #menu.reposition() #menu.reposition() #self.mintMenuWin.grab() menu.connect( 'deactivate', self.onMenuPopupDeactivate) - self.focusSearchEntry() + #self.focusSearchEntry() return True def pos_func(self, menu=None):