From 63b8a24527b9c80141cf18d6240537898161c7d0 Mon Sep 17 00:00:00 2001 From: hordepfo Date: Wed, 7 May 2014 15:54:39 +0100 Subject: [PATCH 1/2] Fixed search button The search button was clearing the search entry when clicked. --- usr/lib/linuxmint/mintMenu/plugins/applications.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index a14475d..8426ca3 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -590,12 +590,12 @@ class pluginclass( object ): self.mintMenuWin.stopHiding() return False - def focusSearchEntry( self ): + def focusSearchEntry( self, clear = True ): # grab_focus() does select all text, # restoring the original selection is somehow broken, so just select the end # of the existing text, that's the most likely candidate anyhow self.searchEntry.grab_focus() - if self.rememberFilter: + if self.rememberFilter or not clear: gtk.gtk_editable_set_position(hash(self.searchEntry), -1) else: self.searchEntry.set_text("") @@ -1124,7 +1124,7 @@ class pluginclass( object ): #menu.reposition() #menu.reposition() #self.mintMenuWin.grab() - self.focusSearchEntry() + self.focusSearchEntry(clear = False) return True def pos_func(self, menu=None): From b2d55634515b0177eb969c17e17c787421c6c22a Mon Sep 17 00:00:00 2001 From: hordepfo Date: Wed, 7 May 2014 16:32:18 +0100 Subject: [PATCH 2/2] Fixes an event cycle on the search entry When pasting a string on the search entry that triggers suggestions (google, etc) and this is done on the favorites tab, a cycle of changed events occurs. It throws an exception, although everything still seems to work. With this fix the search entry isn't modified when changing tabs. --- usr/lib/linuxmint/mintMenu/plugins/applications.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 8426ca3..72d6ad7 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -561,14 +561,14 @@ class pluginclass( object ): def onHideMenu( self ): self.settings.set( "int", "last-active-tab", self.lastActiveTab ) - def changeTab( self, tabNum ): + def changeTab( self, tabNum, clear = True ): notebook = self.builder.get_object( "notebook2" ) if tabNum == 0: notebook.set_current_page( 0 ) elif tabNum == 1: notebook.set_current_page( 1 ) - self.focusSearchEntry() + self.focusSearchEntry(clear) self.lastActiveTab = tabNum @@ -818,8 +818,7 @@ class pluginclass( object ): else: text = widget.get_text() if self.lastActiveTab != 1: - self.changeTab( 1 ) - widget.set_text( text ) + self.changeTab( 1, clear = False ) text = widget.get_text() showns = False # Are any app shown? shownList = []