diff -u compizconfig-backend-gconf-0.8.4/debian/changelog compizconfig-backend-gconf-0.8.4/debian/changelog --- compizconfig-backend-gconf-0.8.4/debian/changelog +++ compizconfig-backend-gconf-0.8.4/debian/changelog @@ -1,3 +1,11 @@ +compizconfig-backend-gconf (0.8.4-0ubuntu2.1) lucid-proposed; urgency=low + + * debian/patches/resize-with-right-button.patch: + - honor resize_with_right_button gconf key (LP: #207065) + Thanks to Guido Iribarren + + -- Brian Murray Wed, 12 Oct 2011 16:12:30 -0700 + compizconfig-backend-gconf (0.8.4-0ubuntu2) lucid; urgency=low * rebuild rest of main for armel armv7/thumb2 optimization; only in patch2: unchanged: --- compizconfig-backend-gconf-0.8.4.orig/settings-backend/gconf.c +++ compizconfig-backend-gconf-0.8.4/settings-backend/gconf.c @@ -166,6 +166,9 @@ METACITY "/window_keybindings/activate_window_menu", OptionSpecial}, {"mouse_button_modifier", NULL, FALSE, METACITY "/general/mouse_button_modifier", OptionSpecial}, + /* integration of the new Metacity's option to swap mouse buttons */ + {"resize_with_right_button", NULL, FALSE, + METACITY "/general/resize_with_right_button", OptionSpecial}, {"visual_bell", "fade", TRUE, METACITY "/general/visual_bell", OptionBool}, @@ -544,8 +547,10 @@ if (num < 0) break; - if (strcmp (specialOptions[num].settingName, - "mouse_button_modifier") == 0) + if ((strcmp (specialOptions[num].settingName, + "mouse_button_modifier") == 0) || + (strcmp (specialOptions[num].settingName, + "resize_with_right_button") == 0)) { CCSSetting *s; @@ -955,6 +960,27 @@ return modMask; } +static unsigned int +getButtonBindingForSetting (CCSContext *context, + const char *plugin, + const char *setting) +{ + CCSSetting *s; + CCSSettingButtonValue value; + + s = findDisplaySettingForPlugin (context, (char*) plugin, (char*) setting); + if (!s) + return 0; + + if (s->type != TypeButton) + return 0; + + value = s->value->value.asButton; + + return value.button; +} + + static Bool readIntegratedOption (CCSContext *context, CCSSetting *setting, @@ -1086,15 +1112,21 @@ ((strcmp (settingName, "window_menu_button") == 0) && (strcmp (pluginName, "core") == 0))) { + gboolean resizeWithRightButton; CCSSettingButtonValue button; memset (&button, 0, sizeof (CCSSettingButtonValue)); ccsGetButton (setting, &button); button.buttonModMask = getGnomeMouseButtonModifier (); + + resizeWithRightButton = gconf_client_get_bool (client, + METACITY "/general/resize_with_right_button", + &err); + if (strcmp (settingName, "window_menu_button") == 0) - button.button = 3; + button.button = resizeWithRightButton ? 2 : 3; else if (strcmp (pluginName, "resize") == 0) - button.button = 2; + button.button = resizeWithRightButton ? 3 : 2; else button.button = 1; @@ -1611,6 +1643,24 @@ (strcmp (pluginName, "core") == 0))) { unsigned int modMask; + Bool resizeWithRightButton = FALSE; + gboolean currentValue; + + if (( getButtonBindingForSetting (context, "resize", "initiate_button") == 3 ) || + ( getButtonBindingForSetting (context, "core", "window_menu_button") == 2 )) + { + resizeWithRightButton = TRUE; + } + + currentValue = gconf_client_get_bool (client, + METACITY "/general/resize_with_right_button", + &err); + + if (!err && ((currentValue && !resizeWithRightButton) || + (!currentValue && resizeWithRightButton))) + gconf_client_set_bool (client, + METACITY "/general/resize_with_right_button", + resizeWithRightButton, NULL); modMask = setting->value->value.asButton.buttonModMask; if (setGnomeMouseButtonModifier (modMask)) @@ -1618,10 +1668,11 @@ setButtonBindingForSetting (context, "move", "initiate_button", 1, modMask); setButtonBindingForSetting (context, "resize", - "initiate_button", 2, modMask); + "initiate_button", + resizeWithRightButton ? 3 : 2, modMask); setButtonBindingForSetting (context, "core", "window_menu_button", - 3, modMask); + resizeWithRightButton ? 2 : 3, modMask); } } }