From 7b1e57191954a817e38434b0bbfe5af56f1b5e85 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Wed, 22 Sep 2004 19:15:26 +0000 Subject: [PATCH] Focus the default window after the user dismisses the workspace switcher 2004-09-22 Elijah Newren * src/keybindings.c (process_workspace_switch_grab): Focus the default window after the user dismisses the workspace switcher popup (fixes #123803; note that an alternate fix was made independently by David Baron for sloppy and mouse focus users) --- ChangeLog | 7 +++++++ src/keybindings.c | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 42739db81..77c32c550 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-09-22 Elijah Newren + + * src/keybindings.c (process_workspace_switch_grab): Focus the + default window after the user dismisses the workspace switcher + popup (fixes #123803; note that an alternate fix was made + independently by David Baron for sloppy and mouse focus users) + 2004-09-22 Elijah Newren Fix some uninitialized variable errors reported by valgrind (see diff --git a/src/keybindings.c b/src/keybindings.c index e0038792c..8d364d770 100644 --- a/src/keybindings.c +++ b/src/keybindings.c @@ -2670,19 +2670,23 @@ process_workspace_switch_grab (MetaDisplay *display, meta_topic (META_DEBUG_KEYBINDINGS, "Ending workspace tab operation, primary modifier released\n"); - if (target_workspace) + + if (target_workspace == screen->active_workspace) { meta_topic (META_DEBUG_KEYBINDINGS, - "Ending grab early so we can focus the target workspace\n"); + "Ending grab so we can focus on the target workspace\n"); meta_display_end_grab_op (display, event->xkey.time); meta_topic (META_DEBUG_KEYBINDINGS, - "Activating target workspace\n"); + "Focusing default window on target workspace\n"); - meta_workspace_activate (target_workspace); + meta_workspace_focus_default_window (target_workspace, NULL); return TRUE; /* we already ended the grab */ } + + /* Workspace switching should have already occurred on KeyPress */ + meta_warning ("target_workspace != active_workspace. Some other event must have occurred.\n"); return FALSE; /* end grab */ } @@ -2753,7 +2757,10 @@ process_workspace_switch_grab (MetaDisplay *display, /* end grab */ meta_topic (META_DEBUG_KEYBINDINGS, - "Ending workspace tabbing, uninteresting key pressed\n"); + "Ending workspace tabbing & focusing default window; uninteresting key pressed\n"); + workspace = + (MetaWorkspace *) meta_ui_tab_popup_get_selected (screen->tab_popup); + meta_workspace_focus_default_window (workspace, NULL); return FALSE; }