User Tools

Site Tools


linux:advanced-mate-menu-favourites-cant-be-rearranged

Advanced Mate Menu: favourites cannot be reordered

In previous versions you could move icons simply dragging them around in the favourites menu. On the contrary, in recent versions the icons are unmovable.

First workaround

The first workaround is to rearrange them from
~/.config/mate-menu/applications.list

Better solution

The real solution is to fix the bug in the python plugin.

In my case Mate is on Debian 11, however this path should be the same almost in every distro.

sudo nano /usr/lib/python3/dist-packages/mate_menu/plugins/applications.py

~LINE 191

class pluginclass( object ):
    TARGET_TYPE_TEXT = 80
    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
 
    #------ REMOVED
    #toFav = ( Gtk.TargetEntry.new( "FAVORITES", 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 ) )
    #------------------
 
    # ----- ADDED (Rik)
    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("text/plain", Gtk.TargetFlags.SAME_APP, 81),  Gtk.TargetEntry.new("text/plain", Gtk.TargetFlags.SAME_APP, 81))
    #-------------------

Line 1371

def on_drag_data_received( self, widget, context, x, y, selection, info, time ):
        if info == self.TARGET_TYPE_FAV:
 
            #------- REMOVED
            #self.favoritesReorder( int(selection.get_data()), widget.position )</del>
            #------- ADDED (Rik)
            self.favoritesReorder(int(selection.get_data().decode()), widget.position)
 
def on_drag_data_get( self, widget, context, selection, targetType, time ):
        if targetType == self.TARGET_TYPE_FAV:
            #------- REMOVED
            #selection.set(Gdk.SELECTION_CLIPBOARD, 8, str(widget.position))</del>
            #------- ADDED (Rik)
            selection.set_text(str(widget.position), -1)

Save, reboot and the problem is solved.

linux/advanced-mate-menu-favourites-cant-be-rearranged.txt · Last modified: 2022/10/31 14:16 by rik