diff options
author | Elijah Newren <newren@gmail.com> | 2005-02-22 02:11:25 +0000 |
---|---|---|
committer | Elijah Newren <newren@src.gnome.org> | 2005-02-22 02:11:25 +0000 |
commit | 612507260a550ff2381bfcbbe32f9bab62650fd9 (patch) | |
tree | de776ecb45e5d1a64c6bce4109a089bb65da5ab2 /src/keybindings.c | |
parent | ad99427b49e80db15413aaa4ce65c540aff565b4 (diff) | |
download | metacity-612507260a550ff2381bfcbbe32f9bab62650fd9.tar.gz |
Handle keynav vs. mousenav in mouse and sloppy focus modes. Fixes #167545.
2005-02-21 Elijah Newren <newren@gmail.com>
Handle keynav vs. mousenav in mouse and sloppy focus modes. Fixes
#167545.
* doc/how-to-get-focus-right.txt: Update due to this new method
for handling keynav vs. mousenav, plus various other updates that
I previously forgot.
* src/display.h: (struct _MetaDisplay): add a mouse_mode boolean
* src/display.c: (meta_display_open): initialize mouse_mode to
true, (event_callback): have EnterNotify and LeaveNotify events
set mouse_mode to true when focusing a window
* src/keybindings.c: (process_tab_grab): set mouse_mode to false
when using alt-tab/alt-esc, (do_choose_window): likewise,
(do_handle_move_to_workspace): set mouse_mode to false on
move-window-to-workspace-<n> keybindings
* src/window.c (idle_calc_showing): if we're in keynav mode while
using sloppy or mouse focus, use metacity_sentinel to avoid
EnterNotify events being generated from events other than mouse
movement.
* src/workspace.c (meta_workspace_activate_with_focus): add a
FIXME in a potentially duplicate section of code,
(meta_workspace_focus_default_window): use the same focus choice
as click-to-focus if in keynav mode.
Diffstat (limited to 'src/keybindings.c')
-rw-r--r-- | src/keybindings.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/keybindings.c b/src/keybindings.c index 154920eb..ffbab6b4 100644 --- a/src/keybindings.c +++ b/src/keybindings.c @@ -2378,8 +2378,10 @@ process_tab_grab (MetaDisplay *display, meta_topic (META_DEBUG_KEYBINDINGS, "Activating target window\n"); - meta_topic (META_DEBUG_FOCUS, "Activating %s due to tab popup selection\n", + meta_topic (META_DEBUG_FOCUS, "Activating %s due to tab popup " + "selection and turning mouse_mode off\n", target_window->desc); + display->mouse_mode = FALSE; meta_window_activate (target_window, event->xkey.time); meta_topic (META_DEBUG_KEYBINDINGS, @@ -2993,8 +2995,11 @@ do_choose_window (MetaDisplay *display, /* If no modifiers, we can't do the "hold down modifier to keep * moving" thing, so we just instaswitch by one window. */ - meta_topic (META_DEBUG_FOCUS, "Activating %s due to switch/cycle windows with no modifiers\n", + meta_topic (META_DEBUG_FOCUS, + "Activating %s and turning off mouse_mode due to " + "switch/cycle windows with no modifiers\n", initial_selection->desc); + display->mouse_mode = FALSE; meta_window_activate (initial_selection, event->xkey.time); } else if (meta_display_begin_grab_op (display, @@ -3017,9 +3022,13 @@ do_choose_window (MetaDisplay *display, * before we establish the grab. must end grab * prior to trying to focus a window. */ - meta_topic (META_DEBUG_FOCUS, "Ending grab and activating %s due to switch/cycle windows where modifier was released prior to grab\n", + meta_topic (META_DEBUG_FOCUS, + "Ending grab, activating %s, and turning off " + "mouse_mode due to switch/cycle windows where " + "modifier was released prior to grab\n", initial_selection->desc); meta_display_end_grab_op (display, event->xkey.time); + display->mouse_mode = FALSE; meta_window_activate (initial_selection, event->xkey.time); } else @@ -3275,7 +3284,15 @@ do_handle_move_to_workspace (MetaDisplay *display, /* Activate second, so the window is never unmapped */ meta_window_change_workspace (window, workspace); if (flip) - meta_workspace_activate_with_focus (workspace, window, event->xkey.time); + { + meta_topic (META_DEBUG_FOCUS, + "Resetting mouse_mode to FALSE due to " + "do_handle_move_to_workspace() call with flip set.\n"); + workspace->screen->display->mouse_mode = FALSE; + meta_workspace_activate_with_focus (workspace, + window, + event->xkey.time); + } } else { |