From 5f029342ed45202fe6c09f4d63304d36af22d29d Mon Sep 17 00:00:00 2001 From: Michael Webster Date: Wed, 13 Mar 2013 20:13:56 -0400 Subject: [PATCH] Fix focusSearchEntry - select_region is completely broken, even with ctypes - for a fix, just override the default 'select-all' by positioning the cursor at the end of any existing text, which is most likely what we want anyhow --- usr/lib/linuxmint/mintMenu/plugins/applications.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 4761d2f..a96ba87 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -577,12 +577,11 @@ class pluginclass( object ): self.buildButtonList() def focusSearchEntry( self ): - # grab_focus() does select all text, as this is an unwanted behaviour we restore the old selection - sel = self.searchEntry.get_selection_bounds() - if len(sel) == 0: # no selection - sel = ( self.searchEntry.get_position(), self.searchEntry.get_position() ) + # 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() - self.searchEntry.select_region( sel[0], sel[1] ) + gtk.gtk_editable_set_position(hash(self.searchEntry), -1) def buildButtonList( self ): if self.buildingButtonList: