summaryrefslogtreecommitdiff
path: root/src/keybindings.c
diff options
context:
space:
mode:
authorRob Adams <robadams@ucla.edu>2003-06-27 14:49:56 +0000
committerRob Adams <readams@src.gnome.org>2003-06-27 14:49:56 +0000
commit34ec58af0a051443ec0f4bf9a0927858dd1638b0 (patch)
treeb3ddf5b4bb0fb66f168629fd08d910ede25fc03d /src/keybindings.c
parentb6389fbf60ae2347830b6fa5ce0ff9fa910e733d (diff)
downloadmetacity-34ec58af0a051443ec0f4bf9a0927858dd1638b0.tar.gz
Add keybinding to allow the user to toggle _NET_WM_STATE_ABOVE on windows.
2003-06-26 Rob Adams <robadams@ucla.edu> Add keybinding to allow the user to toggle _NET_WM_STATE_ABOVE on windows. Disabled by default. See #98387. * src/keybindings.c (handle_toggle_above): new function implements the keybinding * src/metacity.schemas.in: add toggle_above keybinding * src/prefs.[ch]: add toggle_above keybinding * src/window.[ch] (meta_window_make_above): new function to put a window into the above state (meta_window_unmake_above): new function takes a window out of the above state
Diffstat (limited to 'src/keybindings.c')
-rw-r--r--src/keybindings.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/keybindings.c b/src/keybindings.c
index 050733a7..50fc8d2c 100644
--- a/src/keybindings.c
+++ b/src/keybindings.c
@@ -84,6 +84,11 @@ static void handle_panel_keybinding (MetaDisplay *display,
MetaWindow *window,
XEvent *event,
MetaKeyBinding *binding);
+static void handle_toggle_above (MetaDisplay *display,
+ MetaScreen *screen,
+ MetaWindow *window,
+ XEvent *event,
+ MetaKeyBinding *binding);
static void handle_toggle_maximize (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
@@ -353,6 +358,7 @@ static const MetaKeyHandler screen_handlers[] = {
static const MetaKeyHandler window_handlers[] = {
{ META_KEYBINDING_WINDOW_MENU, handle_activate_menu, NULL },
{ META_KEYBINDING_TOGGLE_FULLSCREEN, handle_toggle_fullscreen, NULL },
+ { META_KEYBINDING_TOGGLE_ABOVE, handle_toggle_above, NULL },
{ META_KEYBINDING_TOGGLE_MAXIMIZE, handle_toggle_maximize, NULL },
{ META_KEYBINDING_MAXIMIZE, handle_maximize, NULL },
{ META_KEYBINDING_UNMAXIMIZE, handle_unmaximize, NULL },
@@ -2861,6 +2867,22 @@ handle_toggle_fullscreen (MetaDisplay *display,
}
static void
+handle_toggle_above (MetaDisplay *display,
+ MetaScreen *screen,
+ MetaWindow *window,
+ XEvent *event,
+ MetaKeyBinding *binding)
+{
+ if (window)
+ {
+ if (window->wm_state_above)
+ meta_window_unmake_above (window);
+ else
+ meta_window_make_above (window);
+ }
+}
+
+static void
handle_toggle_maximize (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,