commit d2ad64e8fc13817f8fd7bfada5daf44230235446 Author: Daniel P. Berrange Date: Thu Dec 9 17:48:28 2010 +0000 Adapt to avoid further Gtk3 changes More gdk_drawable calls have gone away in Gtk3. Adapt code to avoid needing to use them, by calling gtk_widget APIs instead. diff --git a/src/vncdisplay.c b/src/vncdisplay.c index 33d2623..deab4d8 100644 --- a/src/vncdisplay.c +++ b/src/vncdisplay.c @@ -139,10 +139,6 @@ static inline void gdk_drawable_get_size(GdkWindow *w, gint *ww, gint *wh) *wh = gdk_window_get_height(w); } -#define gdk_drawable_get_display(w) gdk_window_get_display(w) -#define gdk_drawable_get_screen(w) gdk_window_get_screen(w) -#define gdk_drawable_get_visual(w) gdk_window_get_visual(w) - #define GtkObject GtkWidget #define GtkObjectClass GtkWidgetClass #define GTK_OBJECT_CLASS(c) GTK_WIDGET_CLASS(c) @@ -629,9 +625,8 @@ static gboolean motion_event(GtkWidget *widget, GdkEventMotion *motion) /* Next adjust the real client pointer */ if (!priv->absolute) { - GdkDrawable *drawable = GDK_DRAWABLE(gtk_widget_get_window(widget)); - GdkDisplay *display = gdk_drawable_get_display(drawable); - GdkScreen *screen = gdk_drawable_get_screen(drawable); + GdkDisplay *display = gtk_widget_get_display(widget); + GdkScreen *screen = gtk_widget_get_screen(widget); int x = (int)motion->x_root; int y = (int)motion->y_root; @@ -1009,7 +1004,7 @@ static void on_pixel_format_changed(VncConnection *conn G_GNUC_UNUSED, static gboolean vnc_display_set_preferred_pixel_format(VncDisplay *display) { VncDisplayPrivate *priv = display->priv; - GdkVisual *v = gdk_drawable_get_visual(gtk_widget_get_window(GTK_WIDGET(display))); + GdkVisual *v = gtk_widget_get_visual(GTK_WIDGET(display)); VncPixelFormat fmt; const VncPixelFormat *currentFormat; @@ -1260,7 +1255,7 @@ static void on_cursor_changed(VncConnection *conn G_GNUC_UNUSED, } if (cursor) { - GdkDisplay *display = gdk_drawable_get_display(GDK_DRAWABLE(gtk_widget_get_window(GTK_WIDGET(obj)))); + GdkDisplay *display = gtk_widget_get_display(GTK_WIDGET(obj)); GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data(vnc_cursor_get_data(cursor), GDK_COLORSPACE_RGB, TRUE, 8,