From 614764a7e83bf8c6b56de39078ea94f6934e73d1 Mon Sep 17 00:00:00 2001 From: Michael Webster Date: Thu, 7 Mar 2013 17:27:50 -0500 Subject: [PATCH] Fix popups, need to fix focus now --- .../mintMenu/plugins/applications.glade | 98 +++++++++++++------ .../mintMenu/plugins/applications.py | 28 +++--- usr/lib/linuxmint/mintMenu/plugins/places.py | 1 - 3 files changed, 84 insertions(+), 43 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.glade b/usr/lib/linuxmint/mintMenu/plugins/applications.glade index dfda8ba..1ccdf96 100644 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.glade +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.glade @@ -1,51 +1,43 @@ - + - - - - - - - - - - - - - - - 169 227 + False mouse static - + True + False True + False True + False False False 14 True + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True + False True True + False 0 15 10 @@ -53,6 +45,8 @@ True + True + True 1 @@ -62,10 +56,12 @@ True True False + False none True + False 1 0 0 @@ -73,24 +69,31 @@ True + False 2 True + False All _Applications True + True + True 0 True + False 5 gtk-go-forward + True + True 1 @@ -100,6 +103,8 @@ + True + True 5 end 1 @@ -115,12 +120,14 @@ True + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK queue none True + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -129,6 +136,8 @@ + True + True 1 @@ -140,13 +149,16 @@ True + False True + False True True + False 0 15 10 @@ -154,6 +166,8 @@ True + True + True 1 @@ -163,10 +177,12 @@ True True False + False none True + False 1 0 0 @@ -174,24 +190,31 @@ True + False 2 True + False _Favorites True + True + True 0 True + False 5 gtk-go-forward + True + True 1 @@ -201,6 +224,8 @@ + True + True 5 end 1 @@ -216,6 +241,7 @@ True + False True @@ -225,22 +251,27 @@ True + False none True + False + True + True 0 True + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -260,31 +291,42 @@ True + False none True + False + True + True 2 + True + True 1 + + 1 + + True + True 0 @@ -293,9 +335,11 @@ 227 30 True + False True + False <span weight="bold">Search:</span> True @@ -315,9 +359,15 @@ True True True - + False + False + True + True + + True + True 1 @@ -329,9 +379,10 @@ True True False + False none False - + True @@ -363,13 +414,4 @@ - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index b3a4b86..7c846a0 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -873,7 +873,9 @@ class pluginclass( object ): insertBefore = True if widget.type == "location": - mTree = self.builder.get_object( "favoritesMenu" ) + mTree = Gtk.Menu() + mTree.set_events(Gdk.EventMask.POINTER_MOTION_MASK | Gdk.EventMask.POINTER_MOTION_HINT_MASK | + Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK) #i18n desktopMenuItem = Gtk.MenuItem(_("Add to desktop")) @@ -919,12 +921,14 @@ class pluginclass( object ): mTree.show_all() - #mTree.popup( None, None, None, ev.button, ev.time ) - gtk.gtk_menu_popup(hash(mTree), None, None, None, None, None) + gtk.gtk_menu_popup(hash(mTree), None, None, None, ev.button, ev.time) # self.mintMenuWin.grab() else: - mTree = self.builder.get_object( "favoritesMenuExtra" ) + mTree = Gtk.Menu() + mTree.set_events(Gdk.EventMask.POINTER_MOTION_MASK | Gdk.EventMask.POINTER_MOTION_HINT_MASK | + Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK) + #i18n removeMenuItem = Gtk.MenuItem(_("Remove")) insertSpaceMenuItem = Gtk.MenuItem(_("Insert space")) @@ -937,14 +941,13 @@ class pluginclass( object ): removeMenuItem.connect( "activate", self.onFavoritesRemove, widget ) insertSpaceMenuItem.connect( "activate", self.onFavoritesInsertSpace, widget, insertBefore ) insertSeparatorMenuItem.connect( "activate", self.onFavoritesInsertSeparator, widget, insertBefore ) - #mTree.popup( None, None, None, ev.button, ev.time ) gtk.gtk_menu_popup(hash(mTree), None, None, None, ev.button, ev.time) # self.mintMenuWin.grab() return True def menuPopup( self, widget, event ): if event.button == 3: - mTree = self.builder.get_object ( "applicationsMenu" ) + mTree = Gtk.Menu() #i18n desktopMenuItem = Gtk.MenuItem(_("Add to desktop")) panelMenuItem = Gtk.MenuItem(_("Add to panel")) @@ -1003,13 +1006,10 @@ class pluginclass( object ): mTree.connect( 'deactivate', self.onMenuPopupDeactivate) gtk.gtk_menu_popup(hash(mTree), None, None, None, None, 0, 0) - #mTree.popup( None, None, None, None, event.button, event.time ) - print "sdfdfs" - return True - + def onMenuPopupDeactivate( self, widget): - print "what" - self.mintMenuWin.grab() + pass + #self.mintMenuWin.grab() def searchPopup( self, widget=None, event=None ): menu = Gtk.Menu() @@ -1084,9 +1084,9 @@ class pluginclass( object ): menu.append(menuItem) menu.show_all() - #menu.popup( None, None, self.pos_func, 3, 0) + gtk.gtk_menu_popup(hash(menu), None, None, None, None, 3, 0) - #menu.popup( None, None, None, 3, 0) + #menu.attach_to_widget(self.searchButton, None) #menu.reposition() #menu.reposition() diff --git a/usr/lib/linuxmint/mintMenu/plugins/places.py b/usr/lib/linuxmint/mintMenu/plugins/places.py index c625589..9f01b69 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/places.py +++ b/usr/lib/linuxmint/mintMenu/plugins/places.py @@ -259,7 +259,6 @@ class pluginclass( object ): trashMenu.show_all() emptyTrashMenuItem.connect ( "activate", self.emptyTrash, widget ) gtk.gtk_menu_popup(hash(trashMenu), None, None, None, None, 3, 0) - #trashMenu.popup( None, None, None, event.button, event.time ) #self.mintMenuWin.grab() return True