window: Move get_toplevel_xwindow to window-x11

This commit is contained in:
Jasper St. Pierre 2014-06-16 18:25:40 -04:00
parent 86dae6d4c7
commit 3c0fae74f1
6 changed files with 15 additions and 13 deletions

View File

@ -34,6 +34,7 @@
#include "window-private.h" #include "window-private.h"
#include "meta-shaped-texture-private.h" #include "meta-shaped-texture-private.h"
#include "meta-cullable.h" #include "meta-cullable.h"
#include "x11/window-x11.h"
struct _MetaSurfaceActorX11Private struct _MetaSurfaceActorX11Private
{ {
@ -143,7 +144,7 @@ update_pixmap (MetaSurfaceActorX11 *self)
if (priv->pixmap == None) if (priv->pixmap == None)
{ {
Pixmap new_pixmap; Pixmap new_pixmap;
Window xwindow = meta_window_get_toplevel_xwindow (priv->window); Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
meta_error_trap_push (display); meta_error_trap_push (display);
new_pixmap = XCompositeNameWindowPixmap (xdisplay, xwindow); new_pixmap = XCompositeNameWindowPixmap (xdisplay, xwindow);
@ -312,7 +313,7 @@ sync_unredirected (MetaSurfaceActorX11 *self)
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self); MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
MetaDisplay *display = priv->display; MetaDisplay *display = priv->display;
Display *xdisplay = meta_display_get_xdisplay (display); Display *xdisplay = meta_display_get_xdisplay (display);
Window xwindow = meta_window_get_toplevel_xwindow (priv->window); Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
meta_error_trap_push (display); meta_error_trap_push (display);
@ -404,7 +405,7 @@ create_damage (MetaSurfaceActorX11 *self)
{ {
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self); MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
Display *xdisplay = meta_display_get_xdisplay (priv->display); Display *xdisplay = meta_display_get_xdisplay (priv->display);
Window xwindow = meta_window_get_toplevel_xwindow (priv->window); Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
priv->damage = XDamageCreate (xdisplay, xwindow, XDamageReportBoundingBox); priv->damage = XDamageCreate (xdisplay, xwindow, XDamageReportBoundingBox);
} }

View File

@ -57,6 +57,7 @@
#include "wayland/meta-wayland.h" #include "wayland/meta-wayland.h"
#include "backends/x11/meta-backend-x11.h" #include "backends/x11/meta-backend-x11.h"
#include "x11/window-x11.h"
#ifdef HAVE_NATIVE_BACKEND #ifdef HAVE_NATIVE_BACKEND
#include "backends/native/meta-backend-native.h" #include "backends/native/meta-backend-native.h"
@ -1223,7 +1224,7 @@ meta_window_grab_keys (MetaWindow *window)
} }
meta_window_change_keygrabs (window, meta_window_change_keygrabs (window,
meta_window_get_toplevel_xwindow (window), meta_window_x11_get_toplevel_xwindow (window),
TRUE); TRUE);
window->keys_grabbed = TRUE; window->keys_grabbed = TRUE;
@ -1437,7 +1438,7 @@ meta_window_grab_all_keys (MetaWindow *window,
window->desc); window->desc);
meta_window_focus (window, timestamp); meta_window_focus (window, timestamp);
grabwindow = meta_window_get_toplevel_xwindow (window); grabwindow = meta_window_x11_get_toplevel_xwindow (window);
meta_topic (META_DEBUG_KEYBINDINGS, meta_topic (META_DEBUG_KEYBINDINGS,
"Grabbing all keys on window %s\n", window->desc); "Grabbing all keys on window %s\n", window->desc);

View File

@ -668,8 +668,6 @@ gboolean meta_window_handle_ungrabbed_event (MetaWindow *window,
void meta_window_set_surface_mapped (MetaWindow *window, void meta_window_set_surface_mapped (MetaWindow *window,
gboolean surface_mapped); gboolean surface_mapped);
Window meta_window_get_toplevel_xwindow (MetaWindow *window);
void meta_window_get_client_area_rect (const MetaWindow *window, void meta_window_get_client_area_rect (const MetaWindow *window,
cairo_rectangle_int_t *rect); cairo_rectangle_int_t *rect);
void meta_window_get_titlebar_rect (MetaWindow *window, void meta_window_get_titlebar_rect (MetaWindow *window,

View File

@ -7950,12 +7950,6 @@ meta_window_set_surface_mapped (MetaWindow *window,
meta_window_queue (window, META_QUEUE_CALC_SHOWING); meta_window_queue (window, META_QUEUE_CALC_SHOWING);
} }
Window
meta_window_get_toplevel_xwindow (MetaWindow *window)
{
return window->frame ? window->frame->xwindow : window->xwindow;
}
void void
meta_window_set_custom_frame_extents (MetaWindow *window, meta_window_set_custom_frame_extents (MetaWindow *window,
GtkBorder *extents) GtkBorder *extents)

View File

@ -3484,3 +3484,9 @@ meta_window_x11_update_sync_request_counter (MetaWindow *window,
meta_compositor_queue_frame_drawn (window->display->compositor, window, meta_compositor_queue_frame_drawn (window->display->compositor, window,
no_delay_frame); no_delay_frame);
} }
Window
meta_window_x11_get_toplevel_xwindow (MetaWindow *window)
{
return window->frame ? window->frame->xwindow : window->xwindow;
}

View File

@ -73,4 +73,6 @@ gboolean meta_window_x11_client_message (MetaWindow *window,
void meta_window_x11_configure_notify (MetaWindow *window, void meta_window_x11_configure_notify (MetaWindow *window,
XConfigureEvent *event); XConfigureEvent *event);
Window meta_window_x11_get_toplevel_xwindow (MetaWindow *window);
#endif #endif