Skip to content

Commit 042e9d4

Browse files
committed
keybindings: Restore window opacity keybindings.
This was inadvertantly removed during the 5.4 rebase. Fixes linuxmint/cinnamon#11852.
1 parent 281551c commit 042e9d4

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

src/core/keybindings.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4072,6 +4072,25 @@ handle_rotate_monitor (MetaDisplay *display,
40724072
meta_monitor_manager_rotate_monitor (monitor_manager);
40734073
}
40744074

4075+
static void
4076+
handle_opacity (MetaDisplay *display,
4077+
MetaWindow *window,
4078+
ClutterKeyEvent *event,
4079+
MetaKeyBinding *binding,
4080+
gpointer dummy)
4081+
{
4082+
MetaKeyBindingAction action = meta_prefs_get_keybinding_action (binding->name);
4083+
4084+
if (action == META_KEYBINDING_ACTION_DECREASE_OPACITY)
4085+
{
4086+
meta_window_decrease_opacity (window);
4087+
}
4088+
else
4089+
{
4090+
meta_window_increase_opacity (window);
4091+
}
4092+
}
4093+
40754094
static void
40764095
handle_restore_shortcuts (MetaDisplay *display,
40774096
MetaWindow *window,
@@ -4925,6 +4944,20 @@ init_builtin_key_bindings (MetaDisplay *display)
49254944
META_KEYBINDING_ACTION_MOVE_TO_CENTER,
49264945
handle_move_to_center, 0);
49274946

4947+
add_builtin_keybinding (display,
4948+
"increase-opacity",
4949+
common_keybindings,
4950+
META_KEY_BINDING_PER_WINDOW,
4951+
META_KEYBINDING_ACTION_INCREASE_OPACITY,
4952+
handle_opacity, 0);
4953+
4954+
add_builtin_keybinding (display,
4955+
"decrease-opacity",
4956+
common_keybindings,
4957+
META_KEY_BINDING_PER_WINDOW,
4958+
META_KEYBINDING_ACTION_DECREASE_OPACITY,
4959+
handle_opacity, 0);
4960+
49284961
g_object_unref (common_keybindings);
49294962
g_object_unref (mutter_keybindings);
49304963
g_object_unref (mutter_wayland_keybindings);

src/meta/prefs.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ gboolean meta_prefs_get_invert_flip_direction (void);
374374
* @META_KEYBINDING_ACTION_MOVE_TO_SIDE_E: FILLME
375375
* @META_KEYBINDING_ACTION_MOVE_TO_SIDE_W: FILLME
376376
* @META_KEYBINDING_ACTION_MOVE_TO_CENTER: FILLME
377+
* META_KEYBINDING_ACTION_INCREASE_OPACITY: FILLME,
378+
* META_KEYBINDING_ACTION_DECREASE_OPACITY: FILLME,
377379
* @META_KEYBINDING_ACTION_OVERLAY_KEY: FILLME
378380
* @META_KEYBINDING_ACTION_LOCATE_POINTER_KEY: FILLME
379381
* @META_KEYBINDING_ACTION_ALWAYS_ON_TOP: FILLME
@@ -474,6 +476,8 @@ typedef enum _MetaKeyBindingAction
474476
META_KEYBINDING_ACTION_MOVE_TO_SIDE_E,
475477
META_KEYBINDING_ACTION_MOVE_TO_SIDE_W,
476478
META_KEYBINDING_ACTION_MOVE_TO_CENTER,
479+
META_KEYBINDING_ACTION_INCREASE_OPACITY,
480+
META_KEYBINDING_ACTION_DECREASE_OPACITY,
477481
META_KEYBINDING_ACTION_OVERLAY_KEY,
478482
META_KEYBINDING_ACTION_LOCATE_POINTER_KEY,
479483
META_KEYBINDING_ACTION_ISO_NEXT_GROUP,

0 commit comments

Comments
 (0)