summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Lefebvre <[email protected]>2015-10-16 17:03:11 +0100
committerClement Lefebvre <[email protected]>2015-10-16 17:03:11 +0100
commit40c83f53afc9b84d2d9c877fc36dba01cb9a938f (patch)
tree2740a9b825765871b2fc4dc27d12623c08c2e428
parentc5ca0c2b71f4178341fc05e258d3541efc603761 (diff)
parentd952904cceb4e0380cfb1219a499c1abc4b77926 (diff)
downloadmate-panel-40c83f53afc9b84d2d9c877fc36dba01cb9a938f.tar.bz2
mate-panel-40c83f53afc9b84d2d9c877fc36dba01cb9a938f.tar.xz
Merge pull request #355 from clefebvre/locked-position
Don't change position/right-stick of locked applets
-rw-r--r--mate-panel/applet.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/mate-panel/applet.c b/mate-panel/applet.c
index df58e389..9fdadf53 100644
--- a/mate-panel/applet.c
+++ b/mate-panel/applet.c
@@ -1199,6 +1199,17 @@ mate_panel_applet_save_position (AppletInfo *applet_info,
"position" properties of an applet that may in fact be locked down.
So check if these are writable before attempting to write them */
+ locked = panel_widget_get_applet_locked (panel_widget, applet_info->widget) ? 1 : 0;
+ if (g_settings_get_boolean (applet_info->settings, PANEL_OBJECT_LOCKED_KEY) ? 1 : 0 != locked)
+ g_settings_set_boolean (applet_info->settings, PANEL_OBJECT_LOCKED_KEY, locked);
+
+ if (locked) {
+ // Until position calculations are refactored to fix the issue of the panel applets
+ // getting reordered on resolution changes...
+ // .. don't save position/right-stick on locked applets
+ return;
+ }
+
right_stick = panel_is_applet_right_stick (applet_info->widget) ? 1 : 0;
if (g_settings_is_writable (applet_info->settings, PANEL_OBJECT_PANEL_RIGHT_STICK_KEY) &&
(g_settings_get_boolean (applet_info->settings, PANEL_OBJECT_PANEL_RIGHT_STICK_KEY) ? 1 : 0) != right_stick)
@@ -1211,10 +1222,6 @@ mate_panel_applet_save_position (AppletInfo *applet_info,
if (g_settings_is_writable (applet_info->settings, PANEL_OBJECT_POSITION_KEY) &&
g_settings_get_int (applet_info->settings, PANEL_OBJECT_POSITION_KEY) != position)
g_settings_set_int (applet_info->settings, PANEL_OBJECT_POSITION_KEY, position);
-
- locked = panel_widget_get_applet_locked (panel_widget, applet_info->widget) ? 1 : 0;
- if (g_settings_get_boolean (applet_info->settings, PANEL_OBJECT_LOCKED_KEY) ? 1 : 0 != locked)
- g_settings_set_boolean (applet_info->settings, PANEL_OBJECT_LOCKED_KEY, locked);
}
const char *