@@ -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+
40754094static void
40764095handle_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 );
0 commit comments