From 6f3440396417bd3a5f6e8c679fa57f4ff40d145c Mon Sep 17 00:00:00 2001 From: Gwendal Le Bihan Date: Mon, 29 Aug 2011 15:41:36 +0200 Subject: [PATCH 1/5] Get the window manager from the GDMSESSION environment variable, fallback to GNOME if it's not set --- usr/lib/linuxmint/mintMenu/mintMenu.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index 3e81f7d..bfdbe62 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -54,8 +54,11 @@ ICON = "/usr/lib/linuxmint/mintMenu/visualisation-logo.png" sys.path.append( os.path.join( PATH , "plugins") ) -# FIXME: Get the windowmanager from somewhere, don't take GNOME for granted -xdg.Config.setWindowManager( "GNOME" ) +# FIX: Get the window manager from the GDMSESSION environment variable, fallback to GNOME if it's not set +windowManager = os.getenv("GDMSESSION").upper() +if not windowManager: + windowManager = "GNOME" +xdg.Config.setWindowManager( windowManager ) from easybuttons import iconManager from easygconf import EasyGConf From e719f985d821adc72b093deba0caa73206498757 Mon Sep 17 00:00:00 2001 From: Gwendal Le Bihan Date: Mon, 29 Aug 2011 15:44:29 +0200 Subject: [PATCH 2/5] Corrected bug: .upper() would fail if GDMSESSION variable was not set --- usr/lib/linuxmint/mintMenu/mintMenu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index bfdbe62..1daa32f 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -55,10 +55,10 @@ ICON = "/usr/lib/linuxmint/mintMenu/visualisation-logo.png" sys.path.append( os.path.join( PATH , "plugins") ) # FIX: Get the window manager from the GDMSESSION environment variable, fallback to GNOME if it's not set -windowManager = os.getenv("GDMSESSION").upper() +windowManager = os.getenv("GDMSESSION") if not windowManager: windowManager = "GNOME" -xdg.Config.setWindowManager( windowManager ) +xdg.Config.setWindowManager( windowManager.upper() ) from easybuttons import iconManager from easygconf import EasyGConf From 01d95a69b319a88b1f38c8b7416d64dbd3cd4710 Mon Sep 17 00:00:00 2001 From: Gwendal Le Bihan Date: Mon, 29 Aug 2011 17:55:26 +0200 Subject: [PATCH 3/5] Corrected bug preventing "Hover" option changes to be taken into account immediately --- usr/lib/linuxmint/mintMenu/plugins/applications.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 3668634..4218cbb 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -432,7 +432,7 @@ class pluginclass( object ): startId = child.connect( "enter", self.StartFilter, child.filter ) stopId = child.connect( "leave", self.StopFilter ) child.mouseOverHandlerIds = ( startId, stopId ) - elif self.categories_mouse_over and child.mouseOverHandlerIds: + elif not self.categories_mouse_over and child.mouseOverHandlerIds: child.disconnect( child.mouseOverHandlerIds[0] ) child.disconnect( child.mouseOverHandlerIds[1] ) child.mouseOverHandlerIds = None @@ -1617,6 +1617,8 @@ class pluginclass( object ): startId = item["button"].connect( "enter", self.StartFilter, item["filter"] ) stopId = item["button"].connect( "leave", self.StopFilter ) item["button"].mouseOverHandlerIds = ( startId, stopId ) + else: + item["button"].mouseOverHandlerIds = None item["button"].connect( "clicked", self.Filter, item["filter"] ) item["button"].connect( "focus-in-event", self.categoryBtnFocus, item["filter"] ) From 918c6fbed3e4e0e60a2e82e0156814023ae422c1 Mon Sep 17 00:00:00 2001 From: Gwendal Le Bihan Date: Fri, 2 Sep 2011 20:16:12 +0200 Subject: [PATCH 4/5] Patch for bug #704240 (https://bugs.launchpad.net/linuxmint/+bug/704240) --- usr/lib/linuxmint/mintMenu/plugins/applications.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 4218cbb..a900347 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -983,9 +983,12 @@ class pluginclass( object ): startupMenuItem.set_active( False ) startupMenuItem.connect( "toggled", self.onAddToStartup, widget ) + mTree.get_widget( "applicationsMenu" ).connect( 'deactivate', self.onMenuPopupDeactivate) mTree.get_widget( "applicationsMenu" ).popup( None, None, None, event.button, event.time ) - self.mintMenuWin.grab() + def onMenuPopupDeactivate( self, widget): + self.mintMenuWin.grab() + def searchPopup( self, widget=None, event=None ): menu = gtk.Menu() @@ -1677,7 +1680,7 @@ class pluginclass( object ): item["button"] = MenuApplicationLauncher( item["entry"].get_desktop_file_path(), self.iconSize, item["category"], self.showapplicationcomments, highlight=(True and menu_has_changed) ) if item["button"].appExec: self.mintMenuWin.setTooltip( item["button"], item["button"].getTooltip() ) - item["button"].connect( "button-release-event", self.menuPopup ) + item["button"].connect( "button-press-event", self.menuPopup ) item["button"].connect( "focus-in-event", self.scrollItemIntoView ) item["button"].connect( "clicked", lambda w: self.mintMenuWin.hide() ) if self.activeFilter[0] == 0: From 2d4f2754ed69c8bb8560d5f42bdd3152401b9aa6 Mon Sep 17 00:00:00 2001 From: Gwendal Le Bihan Date: Fri, 2 Sep 2011 23:21:38 +0200 Subject: [PATCH 5/5] Patch for bug #809104 (https://bugs.launchpad.net/linuxmint/+bug/809104) --- usr/lib/linuxmint/mintMenu/plugins/applications.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index a900347..dea60bb 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -821,13 +821,16 @@ class pluginclass( object ): #print "CATFILTER" self.activeFilter = (1, category) if category == "": + listedDesktopFiles = [] for i in self.applicationsBox.get_children(): - i.show_all() + if not i.desktop_file_path in listedDesktopFiles: + listedDesktopFiles.append( i.desktop_file_path ) + i.show_all() + else: + i.hide() else: for i in self.applicationsBox.get_children(): i.filterCategory( category ) - for i in self.applicationsBox.get_children(): - i.filterCategory( category ) for i in self.categoriesBox.get_children(): i.set_relief( gtk.RELIEF_NONE ) @@ -1687,6 +1690,7 @@ class pluginclass( object ): item["button"].filterText( self.activeFilter[1] ) else: item["button"].filterCategory( self.activeFilter[1] ) + item["button"].desktop_file_path = item["entry"].get_desktop_file_path() sortedApplicationList.append( ( item["button"].appName.upper(), item["button"] ) ) self.applicationList.append( item ) else: