mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
window: Add a simple meta_window_get_toplevel_xwindow utility
To replace all the places where we do: window->frame ? window->frame->xwindow : window->xwindow or similar...
This commit is contained in:
parent
1b600f5867
commit
f0fa4d831a
@ -309,11 +309,9 @@ window_decorated_notify (MetaWindow *mw,
|
||||
{
|
||||
MetaWindowActor *self = META_WINDOW_ACTOR (data);
|
||||
MetaWindowActorPrivate *priv = self->priv;
|
||||
MetaFrame *frame = meta_window_get_frame (mw);
|
||||
MetaScreen *screen = priv->screen;
|
||||
MetaDisplay *display = meta_screen_get_display (screen);
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
Window new_xwindow;
|
||||
|
||||
/*
|
||||
* Basically, we have to reconstruct the the internals of this object
|
||||
@ -321,11 +319,6 @@ window_decorated_notify (MetaWindow *mw,
|
||||
*/
|
||||
priv->redecorating = TRUE;
|
||||
|
||||
if (frame)
|
||||
new_xwindow = meta_frame_get_xwindow (frame);
|
||||
else
|
||||
new_xwindow = meta_window_get_xwindow (mw);
|
||||
|
||||
if (!meta_is_wayland_compositor ())
|
||||
{
|
||||
meta_window_actor_detach_x11_pixmap (self);
|
||||
@ -343,7 +336,7 @@ window_decorated_notify (MetaWindow *mw,
|
||||
}
|
||||
}
|
||||
|
||||
priv->xwindow = new_xwindow;
|
||||
priv->xwindow = meta_window_get_toplevel_xwindow (priv->window);
|
||||
|
||||
/*
|
||||
* Recreate the contents.
|
||||
@ -1677,18 +1670,12 @@ meta_window_actor_new (MetaWindow *window)
|
||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||
MetaWindowActor *self;
|
||||
MetaWindowActorPrivate *priv;
|
||||
MetaFrame *frame;
|
||||
Window top_window = None;
|
||||
Window top_window;
|
||||
ClutterActor *window_group;
|
||||
|
||||
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11)
|
||||
{
|
||||
frame = meta_window_get_frame (window);
|
||||
if (frame)
|
||||
top_window = meta_frame_get_xwindow (frame);
|
||||
else
|
||||
top_window = meta_window_get_xwindow (window);
|
||||
|
||||
top_window = meta_window_get_toplevel_xwindow (window);
|
||||
meta_verbose ("add window: Meta %p, xwin 0x%x\n", window, (guint)top_window);
|
||||
}
|
||||
else
|
||||
|
@ -283,8 +283,7 @@ meta_core_lower_beneath_grab_window (Display *xdisplay,
|
||||
return;
|
||||
|
||||
changes.stack_mode = Below;
|
||||
changes.sibling = grab_window->frame ? grab_window->frame->xwindow
|
||||
: grab_window->xwindow;
|
||||
changes.sibling = meta_window_get_toplevel_xwindow (grab_window);
|
||||
|
||||
stack_window.any.type = META_WINDOW_CLIENT_TYPE_X11;
|
||||
stack_window.x11.xwindow = xwindow;
|
||||
|
@ -4204,7 +4204,7 @@ meta_display_begin_grab_op (MetaDisplay *display,
|
||||
* key grab on the RootWindow.
|
||||
*/
|
||||
if (grab_window)
|
||||
grab_xwindow = grab_window->frame ? grab_window->frame->xwindow : grab_window->xwindow;
|
||||
grab_xwindow = meta_window_get_toplevel_xwindow (grab_window);
|
||||
else
|
||||
grab_xwindow = screen->xroot;
|
||||
|
||||
|
@ -1277,7 +1277,7 @@ meta_window_grab_keys (MetaWindow *window)
|
||||
}
|
||||
|
||||
meta_window_change_keygrabs (window,
|
||||
window->frame ? window->frame->xwindow : window->xwindow,
|
||||
meta_window_get_toplevel_xwindow (window),
|
||||
TRUE);
|
||||
|
||||
window->keys_grabbed = TRUE;
|
||||
@ -1584,7 +1584,7 @@ meta_window_grab_all_keys (MetaWindow *window,
|
||||
window->desc);
|
||||
meta_window_focus (window, timestamp);
|
||||
|
||||
grabwindow = window->frame ? window->frame->xwindow : window->xwindow;
|
||||
grabwindow = meta_window_get_toplevel_xwindow (window);
|
||||
|
||||
meta_topic (META_DEBUG_KEYBINDINGS,
|
||||
"Grabbing all keys on window %s\n", window->desc);
|
||||
|
@ -754,5 +754,6 @@ void meta_window_ping (MetaWindow *window,
|
||||
void *user_data);
|
||||
void meta_window_pong (MetaWindow *window,
|
||||
guint32 timestamp);
|
||||
Window meta_window_get_toplevel_xwindow (MetaWindow *window);
|
||||
|
||||
#endif
|
||||
|
@ -12343,3 +12343,9 @@ meta_window_ping (MetaWindow *window,
|
||||
else
|
||||
meta_wayland_surface_ping (window->surface, timestamp);
|
||||
}
|
||||
|
||||
Window
|
||||
meta_window_get_toplevel_xwindow (MetaWindow *window)
|
||||
{
|
||||
return window->frame ? window->frame->xwindow : window->xwindow;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user