[mutter] frame: Only XSync when we're on the X11 compositor backend
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] frame: Only XSync when we're on the X11 compositor backend
- Date: Thu, 10 Jul 2014 17:39:42 +0000 (UTC)
commit 1749a85e96855240652cef423e90879b05118040
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Jul 10 13:29:20 2014 -0400
frame: Only XSync when we're on the X11 compositor backend
The only case we have is the case where the two X11 connections are the
same. When on Wayland, the XSync is costly and expensive, and we should
minimize it.
src/core/frame.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/core/frame.c b/src/core/frame.c
index 8901aad..13cbbd2 100644
--- a/src/core/frame.c
+++ b/src/core/frame.c
@@ -26,6 +26,7 @@
#include "bell.h"
#include <meta/errors.h>
#include "keybindings-private.h"
+#include "backends/x11/meta-backend-x11.h"
#define EVENT_MASK (SubstructureRedirectMask | \
StructureNotifyMask | SubstructureNotifyMask | \
@@ -159,10 +160,16 @@ meta_window_ensure_frame (MetaWindow *window)
meta_ui_map_frame (frame->window->screen->ui, frame->xwindow);
- /* Since the backend takes keygrabs on another connection, make sure
- * to sync the GTK+ connection to ensure that the frame window has
- * been created on the server at this point. */
- XSync (window->display->xdisplay, False);
+ {
+ MetaBackend *backend = meta_get_backend ();
+ if (META_IS_BACKEND_X11 (backend))
+ {
+ /* Since the backend takes keygrabs on another connection, make sure
+ * to sync the GTK+ connection to ensure that the frame window has
+ * been created on the server at this point. */
+ XSync (window->display->xdisplay, False);
+ }
+ }
/* Move keybindings to frame instead of window */
meta_window_grab_keys (window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]