actions: hide windows-display-* actions from the Shortcuts dialog

windows‑display* actions are used to switch open displays and are not
meant to be remapped. They are implemented so they can be reassigned
each time a display is opened, closed, or moved, in order to keep them
aligned with the order of displays. This commit hides them from the
Shortcuts dialog to prevent remapping and avoidinconsistent behavior.
To avoid hiding these actions completely and making them harder to discover,
this commit removes them only from the shortcuts dialog while still showing
them in the action search.
(see #11685)
This commit is contained in:
Gabriele Barbero 2025-05-07 20:00:46 +02:00 committed by Jehan
parent 95e32ebb34
commit ebd5e1966e
3 changed files with 26 additions and 1 deletions

View file

@ -318,7 +318,7 @@ gimp_action_history_search (Gimp *gimp,
gboolean gboolean
gimp_action_history_is_blacklisted_action (const gchar *action_name) gimp_action_history_is_blacklisted_action (const gchar *action_name)
{ {
if (gimp_action_is_gui_blacklisted (action_name)) if (gimp_action_is_action_search_blacklisted (action_name))
return TRUE; return TRUE;
return (g_str_has_suffix (action_name, "-set") || return (g_str_has_suffix (action_name, "-set") ||

View file

@ -758,6 +758,29 @@ gimp_action_name_compare (GimpAction *action1,
gboolean gboolean
gimp_action_is_gui_blacklisted (const gchar *action_name) gimp_action_is_gui_blacklisted (const gchar *action_name)
{
static const gchar *prefixes[] =
{
"windows-display-"
};
if (! (action_name && *action_name))
return TRUE;
for (guint i = 0; i < G_N_ELEMENTS (prefixes); i++)
{
if (g_str_has_prefix (action_name, prefixes[i]))
return TRUE;
}
if (gimp_action_is_action_search_blacklisted (action_name))
return TRUE;
return FALSE;
}
gboolean
gimp_action_is_action_search_blacklisted (const gchar *action_name)
{ {
static const gchar *prefixes[] = static const gchar *prefixes[] =
{ {

View file

@ -126,6 +126,8 @@ gint gimp_action_name_compare (GimpAction *action1,
GimpAction *action2); GimpAction *action2);
gboolean gimp_action_is_gui_blacklisted (const gchar *action_name); gboolean gimp_action_is_gui_blacklisted (const gchar *action_name);
gboolean gimp_action_is_action_search_blacklisted
(const gchar *action_name);
GimpContext * gimp_action_get_context (GimpAction *action); GimpContext * gimp_action_get_context (GimpAction *action);
GimpViewable * gimp_action_get_viewable (GimpAction *action); GimpViewable * gimp_action_get_viewable (GimpAction *action);