app: "gtk-can-change-accels" feature is ignored since GTK+ 3.10.

We had this feature "can-change-accels" where people could change their shortcut
directly by browsing the menu. It was on the property "gtk-can-change-accels" in
GtkSettings. Unfortunately this got deprecated in GTK+ 3.10 (more accurately in
dev version 3.9.8, according to GTK's NEWS file), and is therefore ignored since
then. In other words, whether we check the box or not in our Preferences, it
doesn't do a difference.

If we want to get the feature back some day, we'll have to reimplement it with
custom code. In the meantime, there is no need to leave this visible in
Preferences.
This commit is contained in:
Jehan 2023-01-31 13:49:01 +01:00
parent 4f8357d7f6
commit 385b697a60
4 changed files with 14 additions and 23 deletions

View File

@ -217,6 +217,15 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
TRUE,
GIMP_PARAM_STATIC_STRINGS);
/* XXX: this is now ignored and unsed because we were relying on
* "gtk-can-change-accels" property of GtkSettings which is deprecated and
* ignored since GTK+ 3.10.
*
* Keeping the property around as a reminder of the regression in GIMP 3.
* Maybe we can reimplement this with custom code if there are requests. If we
* end up deciding to completely getting rid of the property, we must add
* update rules in gimp-user-install.c for the gimprc parsing not to break.
*/
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_CAN_CHANGE_ACCELS,
"can-change-accels",
"Can change accelerators",

View File

@ -53,7 +53,6 @@ struct _GimpGuiConfig
gboolean restore_session;
gboolean restore_monitor;
gboolean save_tool_options;
gboolean can_change_accels;
gboolean save_accels;
gboolean restore_accels;
gint last_opened_size;
@ -92,6 +91,11 @@ struct _GimpGuiConfig
gboolean show_tabs;
GimpPosition tabs_position;
gint last_tip_shown;
/* Currently ignored snce "gtk-can-change-accels" settings got deprecated in
* GTK+ 3.10.
*/
gboolean can_change_accels;
};
struct _GimpGuiConfigClass

View File

@ -1958,10 +1958,6 @@ prefs_dialog_new (Gimp *gimp,
vbox2 = prefs_frame_new (_("Keyboard Shortcuts"),
GTK_CONTAINER (vbox), FALSE);
prefs_check_button_add (object, "can-change-accels",
_("_Use dynamic keyboard shortcuts"),
GTK_BOX (vbox2));
button = prefs_button_add (GIMP_ICON_PREFERENCES_SYSTEM,
_("Configure _Keyboard Shortcuts..."),
GTK_BOX (vbox2));

View File

@ -44,7 +44,6 @@
/* local function prototypes */
static void menus_can_change_accels (GimpGuiConfig *config);
static void menus_remove_accels (gpointer data,
const gchar *accel_path,
guint accel_key,
@ -75,11 +74,6 @@ menus_init (Gimp *gimp,
/* We need to make sure the property is installed before using it */
g_type_class_ref (GTK_TYPE_MENU);
menus_can_change_accels (GIMP_GUI_CONFIG (gimp->config));
g_signal_connect (gimp->config, "notify::can-change-accels",
G_CALLBACK (menus_can_change_accels), NULL);
global_menu_factory = gimp_menu_factory_new (gimp, action_factory);
gimp_menu_factory_manager_register (global_menu_factory, "<Image>",
@ -413,10 +407,6 @@ menus_exit (Gimp *gimp)
g_object_unref (global_menu_factory);
global_menu_factory = NULL;
g_signal_handlers_disconnect_by_func (gimp->config,
menus_can_change_accels,
NULL);
}
void
@ -516,14 +506,6 @@ menus_remove (Gimp *gimp)
/* private functions */
static void
menus_can_change_accels (GimpGuiConfig *config)
{
g_object_set (gtk_settings_get_for_screen (gdk_screen_get_default ()),
"gtk-can-change-accels", config->can_change_accels,
NULL);
}
static void
menus_remove_accels (gpointer data,
const gchar *accel_path,