mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
Add keyboard shortcut for Always on Top
This commit is contained in:
parent
ca5d115715
commit
b7e3f627f1
@ -3137,6 +3137,24 @@ handle_maximize_horizontally (MetaDisplay *display,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
handle_always_on_top (MetaDisplay *display,
|
||||||
|
MetaScreen *screen,
|
||||||
|
MetaWindow *window,
|
||||||
|
XIDeviceEvent *event,
|
||||||
|
MetaKeyBinding *binding,
|
||||||
|
gpointer dummy)
|
||||||
|
{
|
||||||
|
if (window->wm_state_above == FALSE)
|
||||||
|
{
|
||||||
|
meta_window_make_above (window);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
meta_window_unmake_above (window);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Move a window to a corner; to_bottom/to_right are FALSE for the
|
/* Move a window to a corner; to_bottom/to_right are FALSE for the
|
||||||
* top or left edge, or TRUE for the bottom/right edge. xchange/ychange
|
* top or left edge, or TRUE for the bottom/right edge. xchange/ychange
|
||||||
* are FALSE if that dimension is not to be changed, TRUE otherwise.
|
* are FALSE if that dimension is not to be changed, TRUE otherwise.
|
||||||
@ -4650,6 +4668,13 @@ init_builtin_key_bindings (MetaDisplay *display)
|
|||||||
META_KEYBINDING_ACTION_MAXIMIZE_HORIZONTALLY,
|
META_KEYBINDING_ACTION_MAXIMIZE_HORIZONTALLY,
|
||||||
handle_maximize_horizontally, 0);
|
handle_maximize_horizontally, 0);
|
||||||
|
|
||||||
|
add_builtin_keybinding (display,
|
||||||
|
"always-on-top",
|
||||||
|
mutter_keybindings,
|
||||||
|
META_KEY_BINDING_PER_WINDOW,
|
||||||
|
META_KEYBINDING_ACTION_ALWAYS_ON_TOP,
|
||||||
|
handle_always_on_top, 0);
|
||||||
|
|
||||||
add_builtin_keybinding (display,
|
add_builtin_keybinding (display,
|
||||||
"move-to-corner-nw",
|
"move-to-corner-nw",
|
||||||
common_keybindings,
|
common_keybindings,
|
||||||
|
@ -248,6 +248,7 @@ void meta_prefs_set_ignore_request_hide_titlebar (gboolean whether);
|
|||||||
* @META_KEYBINDING_ACTION_LOWER: FILLME
|
* @META_KEYBINDING_ACTION_LOWER: FILLME
|
||||||
* @META_KEYBINDING_ACTION_MAXIMIZE_VERTICALLY: FILLME
|
* @META_KEYBINDING_ACTION_MAXIMIZE_VERTICALLY: FILLME
|
||||||
* @META_KEYBINDING_ACTION_MAXIMIZE_HORIZONTALLY: FILLME
|
* @META_KEYBINDING_ACTION_MAXIMIZE_HORIZONTALLY: FILLME
|
||||||
|
* @META_KEYBINDING_ACTION_ALWAYS_ON_TOP: FILLME
|
||||||
* @META_KEYBINDING_ACTION_MOVE_TO_CORNER_NW: FILLME
|
* @META_KEYBINDING_ACTION_MOVE_TO_CORNER_NW: FILLME
|
||||||
* @META_KEYBINDING_ACTION_MOVE_TO_CORNER_NE: FILLME
|
* @META_KEYBINDING_ACTION_MOVE_TO_CORNER_NE: FILLME
|
||||||
* @META_KEYBINDING_ACTION_MOVE_TO_CORNER_SW: FILLME
|
* @META_KEYBINDING_ACTION_MOVE_TO_CORNER_SW: FILLME
|
||||||
@ -339,6 +340,7 @@ typedef enum _MetaKeyBindingAction
|
|||||||
META_KEYBINDING_ACTION_RAISE,
|
META_KEYBINDING_ACTION_RAISE,
|
||||||
META_KEYBINDING_ACTION_LOWER,
|
META_KEYBINDING_ACTION_LOWER,
|
||||||
META_KEYBINDING_ACTION_MAXIMIZE_VERTICALLY,
|
META_KEYBINDING_ACTION_MAXIMIZE_VERTICALLY,
|
||||||
|
META_KEYBINDING_ACTION_ALWAYS_ON_TOP,
|
||||||
META_KEYBINDING_ACTION_MAXIMIZE_HORIZONTALLY,
|
META_KEYBINDING_ACTION_MAXIMIZE_HORIZONTALLY,
|
||||||
META_KEYBINDING_ACTION_MOVE_TO_CORNER_NW,
|
META_KEYBINDING_ACTION_MOVE_TO_CORNER_NW,
|
||||||
META_KEYBINDING_ACTION_MOVE_TO_CORNER_NE,
|
META_KEYBINDING_ACTION_MOVE_TO_CORNER_NE,
|
||||||
|
@ -93,6 +93,14 @@
|
|||||||
</_description>
|
</_description>
|
||||||
</key>
|
</key>
|
||||||
|
|
||||||
|
<key name="always-on-top" type="s">
|
||||||
|
<default>'Super_W'</default>
|
||||||
|
<_summary>Modifier to toggle Always on Top status on windows</_summary>
|
||||||
|
<_description>
|
||||||
|
This key will toggle the "Always on Top" status of a window.
|
||||||
|
</_description>
|
||||||
|
</key>
|
||||||
|
|
||||||
<child name="keybindings" schema="org.gnome.mutter.keybindings"/>
|
<child name="keybindings" schema="org.gnome.mutter.keybindings"/>
|
||||||
|
|
||||||
</schema>
|
</schema>
|
||||||
|
Loading…
Reference in New Issue
Block a user