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:
Florian Müllner 2011-05-20 17:41:19 +02:00
parent 54b2fab849
commit 4a10c95e76
3 changed files with 14 additions and 14 deletions

View File

@ -261,25 +261,25 @@ meta_core_user_lower_and_unfocus (Display *xdisplay,
}
void
meta_core_lower_beneath_focus_window (Display *xdisplay,
Window xwindow,
guint32 timestamp)
meta_core_lower_beneath_grab_window (Display *xdisplay,
Window xwindow,
guint32 timestamp)
{
XWindowChanges changes;
MetaDisplay *display;
MetaScreen *screen;
MetaWindow *focus_window;
MetaWindow *grab_window;
display = meta_display_for_x_display (xdisplay);
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;
changes.stack_mode = Below;
changes.sibling = focus_window->frame ? focus_window->frame->xwindow
: focus_window->xwindow;
changes.sibling = grab_window->frame ? grab_window->frame->xwindow
: grab_window->xwindow;
meta_stack_tracker_record_lower_below (screen->stack_tracker,
xwindow,

View File

@ -116,9 +116,9 @@ void meta_core_user_focus (Display *xdisplay,
Window frame_xwindow,
guint32 timestamp);
void meta_core_lower_beneath_focus_window (Display *xdisplay,
Window xwindow,
guint32 timestamp);
void meta_core_lower_beneath_grab_window (Display *xdisplay,
Window xwindow,
guint32 timestamp);
void meta_core_minimize (Display *xdisplay,
Window frame_xwindow);

View File

@ -185,9 +185,9 @@ meta_tile_preview_show (MetaTilePreview *preview,
gtk_widget_show (preview->preview_window);
window = gtk_widget_get_window (preview->preview_window);
meta_core_lower_beneath_focus_window (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
GDK_WINDOW_XID (window),
gtk_get_current_event_time ());
meta_core_lower_beneath_grab_window (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
GDK_WINDOW_XID (window),
gtk_get_current_event_time ());
old_rect.x = old_rect.y = 0;
old_rect.width = preview->tile_rect.width;