From d7f650b79f814ace3cee620a0a15ac8a6f70ecbc Mon Sep 17 00:00:00 2001 From: Michael Webster Date: Wed, 17 Jun 2020 10:45:10 -0400 Subject: [PATCH] applications.py: Fix dnd for re-ordering/adding favorites. Fixes https://github.com/linuxmint/mint20-beta/issues/22 --- usr/lib/linuxmint/mintMenu/plugins/applications.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 0a9b757..959bc29 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -174,11 +174,11 @@ class pluginclass(object): toButton = (Gtk.TargetEntry.new("text/uri-list", 0, TARGET_TYPE_TEXT), Gtk.TargetEntry.new("text/uri-list", 0, TARGET_TYPE_TEXT)) TARGET_TYPE_FAV = 81 - toFav = (Gtk.TargetEntry.new("FAVORITES", Gtk.TargetFlags.SAME_APP, 81), + toFav = (Gtk.TargetEntry.new("text/plain", Gtk.TargetFlags.SAME_APP, 81), Gtk.TargetEntry.new("text/plain", 0, 100), Gtk.TargetEntry.new("text/uri-list", 0, 101)) - fromFav = (Gtk.TargetEntry.new("FAVORITES", Gtk.TargetFlags.SAME_APP, 81), - Gtk.TargetEntry.new("FAVORITES", Gtk.TargetFlags.SAME_APP, 81)) + fromFav = (Gtk.TargetEntry.new("text/plain", Gtk.TargetFlags.SAME_APP, 81), + Gtk.TargetEntry.new("text/plain", Gtk.TargetFlags.SAME_APP, 81)) #@print_timing def __init__(self, mintMenuWin, toggleButton, de): @@ -1413,12 +1413,11 @@ class pluginclass(object): def on_drag_data_get(self, widget, context, selection, info, time): if info == self.TARGET_TYPE_FAV: self.drag_origin = widget.position - # FIXME: This fails in python3: - selection.set(selection.get_target(), 8, str(widget.position)) + selection.set_text(str(widget.position), -1) def on_drag_data_received(self, widget, context, x, y, selection, info, time): if info == self.TARGET_TYPE_FAV: - self.favoritesReorder(int(selection.get_data()), widget.position) + self.favoritesReorder(int(selection.get_data().decode()), widget.position) # def on_icon_theme_changed(self, theme): # print("on_icon_theme_changed")