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
This commit is contained in:

committed by
Elijah Newren

parent
cffe7e9566
commit
63e1624bd7
34
src/core.c
34
src/core.c
@@ -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
|
||||
|
Reference in New Issue
Block a user