Commit 463b50e7 authored by Jasper St. Pierre's avatar Jasper St. Pierre
Browse files

screen: Fetch the COW window up-front

XGetCompositeOverlayWindow is a round trip to the X server. We shouldn't
be doing it on every MapWindow.
parent 1749a85e
......@@ -157,7 +157,7 @@ get_output_window (MetaCompositor *compositor)
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
output = XCompositeGetOverlayWindow (xdisplay, DefaultRootWindow (xdisplay));
output = compositor->display->screen->composite_overlay_window;
XISetMask (mask.mask, XI_KeyPress);
XISetMask (mask.mask, XI_KeyRelease);
......
......@@ -119,6 +119,8 @@ struct _MetaScreen
* and restack them below a guard window. When using a compositor
* this allows us to provide live previews of unmapped windows */
Window guard_window;
Window composite_overlay_window;
};
struct _MetaScreenClass
......
......@@ -45,6 +45,7 @@
#include "meta-cursor-tracker-private.h"
#include <X11/extensions/Xinerama.h>
#include <X11/extensions/Xcomposite.h>
#include <X11/Xatom.h>
#include <locale.h>
......@@ -700,6 +701,8 @@ meta_screen_new (MetaDisplay *display,
screen->starting_corner = META_SCREEN_TOPLEFT;
screen->guard_window = None;
screen->composite_overlay_window = XCompositeGetOverlayWindow (xdisplay, xroot);
reload_monitor_infos (screen);
meta_screen_set_cursor (screen, META_CURSOR_DEFAULT);
......
......@@ -2942,7 +2942,7 @@ is_our_xwindow (MetaDisplay *display,
if (xwindow == screen->guard_window)
return TRUE;
if (xwindow == XCompositeGetOverlayWindow (display->xdisplay, screen->xroot))
if (xwindow == screen->composite_overlay_window)
return TRUE;
/* Any windows created via meta_create_offscreen_window */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment