mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
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.
This commit is contained in:
parent
1749a85e96
commit
463b50e746
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user