diff options
author | Elijah Newren <newren@math.utah.edu> | 2004-09-16 00:06:38 +0000 |
---|---|---|
committer | Elijah Newren <newren@src.gnome.org> | 2004-09-16 00:06:38 +0000 |
commit | 63e1624bd7ffbeee93de345ec0dc6212dd6c3cef (patch) | |
tree | bae79b58f7846b5feaee10c15832040012765c83 | |
parent | cffe7e95667b92af5539c69147556169dd224781 (diff) | |
download | metacity-63e1624bd7ffbeee93de345ec0dc6212dd6c3cef.tar.gz |
Patch from Ken Harris in #135786 to focus a new default window when
2004-09-15 Elijah Newren <newren@math.utah.edu>
Patch from Ken Harris in #135786 to focus a new default window
when lowering via middle-click on the frame.
* src/core.[hc], src/frames.c: rename meta_core_user_lower to
meta_core_user_lower_and_unfocus
* src/core.c (meta_core_user_lower_and_unfocus): if in
click-to-focus mode then also move the window to the back of the
mru list and focus the new default window for the active workspace
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | src/core.c | 34 | ||||
-rw-r--r-- | src/core.h | 4 | ||||
-rw-r--r-- | src/frames.c | 2 |
4 files changed, 47 insertions, 5 deletions
@@ -1,5 +1,17 @@ 2004-09-15 Elijah Newren <newren@math.utah.edu> + Patch from Ken Harris in #135786 to focus a new default window + when lowering via middle-click on the frame. + + * src/core.[hc], src/frames.c: rename meta_core_user_lower to + meta_core_user_lower_and_unfocus + + * src/core.c (meta_core_user_lower_and_unfocus): if in + click-to-focus mode then also move the window to the back of the + mru list and focus the new default window for the active workspace + +2004-09-15 Elijah Newren <newren@math.utah.edu> + Focus the no_focus_window if no suitable window is in the mru list (should fix the almost contrived extra issue found in #147475) @@ -236,8 +236,8 @@ meta_core_user_raise (Display *xdisplay, } void -meta_core_user_lower (Display *xdisplay, - Window frame_xwindow) +meta_core_user_lower_and_unfocus (Display *xdisplay, + Window frame_xwindow) { MetaDisplay *display; MetaWindow *window; @@ -249,6 +249,36 @@ meta_core_user_lower (Display *xdisplay, meta_bug ("No such frame window 0x%lx!\n", frame_xwindow); meta_window_lower (window); + + if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK) + { + /* Move window to the back of the focusing workspace's MRU list. + * Do extra sanity checks to avoid possible race conditions. + * (Borrowed from window.c.) + */ + if (window->screen->active_workspace && + meta_window_visible_on_workspace (window, + window->screen->active_workspace)) + { + GList* link; + link = g_list_find (window->screen->active_workspace->mru_list, + window); + g_assert (link); + + window->screen->active_workspace->mru_list = + g_list_remove_link (window->screen->active_workspace->mru_list, + link); + g_list_free (link); + + window->screen->active_workspace->mru_list = + g_list_append (window->screen->active_workspace->mru_list, + window); + } + + /* focus on the (new) topmost window */ + if (window->has_focus) + meta_workspace_focus_default_window (window->screen->active_workspace, window); + } } void @@ -60,8 +60,8 @@ void meta_core_user_resize (Display *xdisplay, void meta_core_user_raise (Display *xdisplay, Window frame_xwindow); -void meta_core_user_lower (Display *xdisplay, - Window frame_xwindow); +void meta_core_user_lower_and_unfocus (Display *xdisplay, + Window frame_xwindow); void meta_core_user_focus (Display *xdisplay, Window frame_xwindow, diff --git a/src/frames.c b/src/frames.c index 56cd5e42..7d7353a9 100644 --- a/src/frames.c +++ b/src/frames.c @@ -1373,7 +1373,7 @@ meta_frames_button_press_event (GtkWidget *widget, } else if (event->button == 2) { - meta_core_user_lower (gdk_display, frame->xwindow); + meta_core_user_lower_and_unfocus (gdk_display, frame->xwindow); } else if (event->button == 3) { |