File xdg-and-hotkeys.patch of Package mate-applet-dock
--- src/dock.in.orig 2021-08-31 18:35:16.000000000 +0300
+++ src/dock.in 2024-10-14 19:04:30.720851299 +0300
@@ -67,6 +67,7 @@ from gi.repository import GLib
from gi.repository import Notify
from gi.repository import Bamf
+import xdg.BaseDirectory as BaseDirectory
import os
import os.path
import sys
@@ -515,8 +516,12 @@ class Dock(object):
self.right_clicked_app = None # the app that most recently had a right click
self.settings_path = self.applet.get_preferences_path()
- self.settings = Gio.Settings.new_with_path("org.mate.panel.applet.dock",
- self.settings_path)
+
+ try:
+ self.settings = applet.settings_new("org.mate.panel.applet.dock")
+ except Exception as e:
+ self.settings = Gio.Settings.new_with_path("org.mate.panel.applet.dock",
+ self.settings_path)
# instantiate these - will be set up later
self.object_settings = None
@@ -2267,7 +2272,6 @@ class Dock(object):
dock_app = docked_app.DockedApp()
dock_app.desktop_file = desktop_file
- dock_app.read_info_from_desktop_file()
if dock_app.read_info_from_desktop_file():
if build_gtk2:
dock_app.applet_win = self.applet.window
@@ -2374,10 +2378,7 @@ class Dock(object):
exists or "" otherwise
"""
- srch_dirs = ["/usr/share/applications/",
- "/usr/local/share/applications/",
- "/var/lib/snapd/desktop/applications/",
- os.path.expanduser("~/.local/share/applications/")]
+ srch_dirs = map(lambda dir: os.path.join(dir, "applications"), BaseDirectory.xdg_data_dirs)
for srch_dir in srch_dirs:
for the_dir, dir_list, file_list in os.walk(srch_dir):
@@ -4161,11 +4162,11 @@ class Dock(object):
# rarely, the last active win does not end up as the active window
# if we activate here, so instead a workaround which seems to do
# the trick is use a timer as below
-
+
# fix for #176, don't send the current event time to the activation
# timer
GObject.timeout_add(20, win_activation_timer,
- [last_active_win, 0])
+ [last_active_win, 0])
else:
# minimize all windows and do the last active window last of all