mirror of
https://github.com/brl/mutter.git
synced 2025-03-04 20:28:11 +00:00
core: Replace lower_beneath_focus_window()
The code assumed that the focus window was always the one at the top of the window stack, which is not true if an unfocused window has the above hint set. Rather than fixing this assumption, rename the function to lower_beneath_grab_window() and use the display's grab window - the function is only used for displaying the tile previews, which means that we want the grab window anyway. https://bugzilla.gnome.org/show_bug.cgi?id=650661
This commit is contained in:
parent
54b2fab849
commit
4a10c95e76
@ -261,25 +261,25 @@ meta_core_user_lower_and_unfocus (Display *xdisplay,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_core_lower_beneath_focus_window (Display *xdisplay,
|
meta_core_lower_beneath_grab_window (Display *xdisplay,
|
||||||
Window xwindow,
|
Window xwindow,
|
||||||
guint32 timestamp)
|
guint32 timestamp)
|
||||||
{
|
{
|
||||||
XWindowChanges changes;
|
XWindowChanges changes;
|
||||||
MetaDisplay *display;
|
MetaDisplay *display;
|
||||||
MetaScreen *screen;
|
MetaScreen *screen;
|
||||||
MetaWindow *focus_window;
|
MetaWindow *grab_window;
|
||||||
|
|
||||||
display = meta_display_for_x_display (xdisplay);
|
display = meta_display_for_x_display (xdisplay);
|
||||||
screen = meta_display_screen_for_xwindow (display, xwindow);
|
screen = meta_display_screen_for_xwindow (display, xwindow);
|
||||||
focus_window = meta_stack_get_top (screen->stack);
|
grab_window = display->grab_window;
|
||||||
|
|
||||||
if (focus_window == NULL)
|
if (grab_window == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
changes.stack_mode = Below;
|
changes.stack_mode = Below;
|
||||||
changes.sibling = focus_window->frame ? focus_window->frame->xwindow
|
changes.sibling = grab_window->frame ? grab_window->frame->xwindow
|
||||||
: focus_window->xwindow;
|
: grab_window->xwindow;
|
||||||
|
|
||||||
meta_stack_tracker_record_lower_below (screen->stack_tracker,
|
meta_stack_tracker_record_lower_below (screen->stack_tracker,
|
||||||
xwindow,
|
xwindow,
|
||||||
|
@ -116,9 +116,9 @@ void meta_core_user_focus (Display *xdisplay,
|
|||||||
Window frame_xwindow,
|
Window frame_xwindow,
|
||||||
guint32 timestamp);
|
guint32 timestamp);
|
||||||
|
|
||||||
void meta_core_lower_beneath_focus_window (Display *xdisplay,
|
void meta_core_lower_beneath_grab_window (Display *xdisplay,
|
||||||
Window xwindow,
|
Window xwindow,
|
||||||
guint32 timestamp);
|
guint32 timestamp);
|
||||||
|
|
||||||
void meta_core_minimize (Display *xdisplay,
|
void meta_core_minimize (Display *xdisplay,
|
||||||
Window frame_xwindow);
|
Window frame_xwindow);
|
||||||
|
@ -185,9 +185,9 @@ meta_tile_preview_show (MetaTilePreview *preview,
|
|||||||
|
|
||||||
gtk_widget_show (preview->preview_window);
|
gtk_widget_show (preview->preview_window);
|
||||||
window = gtk_widget_get_window (preview->preview_window);
|
window = gtk_widget_get_window (preview->preview_window);
|
||||||
meta_core_lower_beneath_focus_window (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
meta_core_lower_beneath_grab_window (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
||||||
GDK_WINDOW_XID (window),
|
GDK_WINDOW_XID (window),
|
||||||
gtk_get_current_event_time ());
|
gtk_get_current_event_time ());
|
||||||
|
|
||||||
old_rect.x = old_rect.y = 0;
|
old_rect.x = old_rect.y = 0;
|
||||||
old_rect.width = preview->tile_rect.width;
|
old_rect.width = preview->tile_rect.width;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user