Re: [gtk-vnc-devel] [PATCH 5/7] Use X window backing store for the VNC window 2008-11-24 Federico Mena Quintero <federico novell com>



On Thu, 2008-12-18 at 20:17 +0000, Daniel P. Berrange wrote:

> ACk to the patch in principle, once its has been #ifdef'd to not hardcode
> the use of GTK X backend on all platforms. 

Hmm, so, the attached patch doesn't make me 100% happy, but using a
macro from Cairo is the only way I could find of detecting at
compile-time if GTK+ is built for X :(

  Federico
commit 4b92befe4d718f9835244522744b8c6a7033e4e1
Author: Federico Mena Quintero <federico novell com>
Date:   Fri Dec 19 22:09:26 2008 -0600

    Ifdef the X-isms so they don't appear in non-X builds
    2008-12-19  Federico Mena Quintero  <federico novell com>
    
    	* src/vncdisplay.c: Only include the X-isms if we have
    	CAIRO_HAS_XLIB_SURFACE --- that seems to be the only way to
    	"detect" if GTK+ is built for X11.
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

diff --git a/ChangeLog b/ChangeLog
index 092859d..bcf3be4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-12-19  Federico Mena Quintero  <federico novell com>
+
+	* src/vncdisplay.c: Only include the X-isms if we have
+	CAIRO_HAS_XLIB_SURFACE --- that seems to be the only way to
+	"detect" if GTK+ is built for X11.
+
 2008-12-17  Federico Mena Quintero  <federico novell com>
 
         * src/vncdisplay.c (vnc_display_init): Enable local_pointer by
diff --git a/src/vncdisplay.c b/src/vncdisplay.c
index b546f41..ab4192d 100644
--- a/src/vncdisplay.c
+++ b/src/vncdisplay.c
@@ -18,7 +18,10 @@
 #include "config.h"
 #include "x_keymap.h"
 
+#ifdef CAIRO_HAS_XLIB_SURFACE
 #include <gdk/gdkx.h>
+#endif
+
 #include <gtk/gtk.h>
 #include <string.h>
 #include <stdlib.h>
@@ -264,6 +267,7 @@ static GdkCursor *create_null_cursor(void)
 	return cursor;
 }
 
+#ifdef CAIRO_HAS_XLIB_SURFACE
 static GdkFilterReturn
 eat_pending_motion_events_filter_func (GdkXEvent *xevent,
 				       GdkEvent *event,
@@ -315,6 +319,7 @@ add_backing_store(VncDisplay *obj)
 
 	XChangeWindowAttributes (xdisplay, xwindow, value_mask, &attr);
 }
+#endif
 
 static void
 realize (GtkWidget *widget)
@@ -324,6 +329,7 @@ realize (GtkWidget *widget)
 
 	GTK_WIDGET_CLASS (vnc_display_parent_class)->realize (widget);
 
+#ifdef CAIRO_HAS_XLIB_SURFACE
 	/* We add an event filter for this window, so that we can compress
 	 * motion events before gdk_event_translate() processes them.  This
 	 * helps especially when the VNC connection cannot keep up with our
@@ -337,6 +343,7 @@ realize (GtkWidget *widget)
 	 * get received.
 	 */
 	add_backing_store (obj);
+#endif
 }
 
 static gboolean expose_event(GtkWidget *widget, GdkEventExpose *expose)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]