summaryrefslogtreecommitdiff
path: root/src/core/keybindings.c
diff options
context:
space:
mode:
authorsparkida <[email protected]>2022-01-15 23:14:19 +0000
committerLuke from DC <[email protected]>2023-01-18 04:15:33 +0000
commitd83cb24a27b1864be035868354a806287dbfaa92 (patch)
tree1e8987cd34887cdde1d31ad59f1dabcf7d57dc85 /src/core/keybindings.c
parentdcd5d21e4c53f1670b33cec78c96bdd3da87037d (diff)
downloadmarco-d83cb24a27b1864be035868354a806287dbfaa92.tar.bz2
marco-d83cb24a27b1864be035868354a806287dbfaa92.tar.xz
Add setting to raise windows on alt+tab popup
Diffstat (limited to 'src/core/keybindings.c')
-rw-r--r--src/core/keybindings.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 2f782fa3..fb3131c2 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -2128,12 +2128,16 @@ process_tab_grab (MetaDisplay *display,
return TRUE;
key = meta_ui_tab_popup_get_selected (screen->tab_popup);
- prev_window = meta_display_lookup_x_window (display, (Window) key);
+ prev_window = meta_display_lookup_x_window (display, (Window) key);
action = display_get_keybinding_action (display,
keysym,
event->xkey.keycode,
display->grab_mask);
+ gboolean raise_windows;
+ raise_windows = meta_prefs_get_alt_tab_raise_windows ();
+ gboolean escaped_alt_tab = FALSE;
+
/* Cancel when alt-Escape is pressed during using alt-Tab, and vice
* versa.
*/
@@ -2153,6 +2157,15 @@ process_tab_grab (MetaDisplay *display,
case META_GRAB_OP_KEYBOARD_ESCAPING_DOCK:
/* carry on */
break;
+ case META_GRAB_OP_KEYBOARD_TABBING_NORMAL:
+ // handle escape pressed when using raise_windows with alt+tab
+ // in order to restore selected window in stack
+ if (raise_windows)
+ {
+ escaped_alt_tab = TRUE;
+ break;
+ }
+ return FALSE;
default:
return FALSE;
}
@@ -2223,7 +2236,7 @@ process_tab_grab (MetaDisplay *display,
case META_KEYBINDING_ACTION_CYCLE_WINDOWS:
case META_KEYBINDING_ACTION_CYCLE_GROUP:
popup_not_showing = TRUE;
- key_used = TRUE;
+ key_used = !escaped_alt_tab;
break;
case META_KEYBINDING_ACTION_CYCLE_PANELS_BACKWARD:
case META_KEYBINDING_ACTION_CYCLE_WINDOWS_BACKWARD:
@@ -2288,7 +2301,7 @@ process_tab_grab (MetaDisplay *display,
else if (direction == UP)
meta_ui_tab_popup_up (screen->tab_popup);
- if (popup_not_showing)
+ if (popup_not_showing || raise_windows)
{
/* We can't actually change window focus, due to the grab.
* but raise the window.