From 49d24e0f4cae95e58570c980e8df1f9a5122a596 Mon Sep 17 00:00:00 2001 From: Michael Webster Date: Wed, 8 May 2013 09:16:55 -0400 Subject: [PATCH] Really fix drag icons --- .../linuxmint/mintMenu/plugins/easybuttons.py | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py b/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py index a424371..b212e6d 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py +++ b/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py @@ -257,10 +257,15 @@ class ApplicationLauncher( easyButton ): gtk.gtk_drag_source_set(hash(self), Gdk.ModifierType.BUTTON1_MASK, targets, 2, Gdk.DragAction.COPY) icon = self.getIcon( Gtk.IconSize.DND ) - if icon and icon.get_storage_type() == Gtk.ImageType.PIXBUF: - pb = icon.get_pixbuf() - gtk.gtk_drag_source_set_icon_pixbuf( hash(self), hash(pb) ) - del icon + if icon: + if icon.get_storage_type() == Gtk.ImageType.PIXBUF: + pb = icon.get_pixbuf() + gtk.gtk_drag_source_set_icon_pixbuf( hash(self), hash(pb) ) + del icon + else: + if self.iconName: + c = c_char_p(self.iconName) + gtk.gtk_drag_source_set_icon_name( hash(self), c) self.connectSelf( "focus-in-event", self.onFocusIn ) self.connectSelf( "focus-out-event", self.onFocusOut ) @@ -375,10 +380,15 @@ class ApplicationLauncher( easyButton ): easyButton.iconChanged( self ) icon = self.getIcon( Gtk.IconSize.DND ) - if icon and icon.get_storage_type() == Gtk.ImageType.PIXBUF: - pb = icon.get_pixbuf() - gtk.gtk_drag_source_set_icon_pixbuf( hash(self), hash(pb) ) - del icon + if icon: + if icon.get_storage_type() == Gtk.ImageType.PIXBUF: + pb = icon.get_pixbuf() + gtk.gtk_drag_source_set_icon_pixbuf( hash(self), hash(pb) ) + del icon + else: + if self.iconName: + c = c_char_p(self.iconName) + gtk.gtk_drag_source_set_icon_name( hash(self), c) def startupFileChanged( self, *args ): self.inStartup = os.path.exists( self.startupFilePath )