From: Hugo Villeneuve Date: Sun, 21 Dec 2014 19:33:33 +0000 (-0500) Subject: Use function to get widget's window for Gtk+-3 support X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=0d93e9f777dd01e029254c64188ed6276a8c20a7;p=dockapps%2Fhvclock.git Use function to get widget's window for Gtk+-3 support --- diff --git a/src/clock.c b/src/clock.c index 5615d56..b26d125 100644 --- a/src/clock.c +++ b/src/clock.c @@ -382,7 +382,7 @@ hvclock_expose(GtkWidget *clock, GdkEventExpose *event) cairo_t *cr; /* Get a cairo_t */ - cr = gdk_cairo_create(clock->window); + cr = gdk_cairo_create(gtk_widget_get_window(clock)); cairo_rectangle(cr, event->area.x, event->area.y, event->area.width, event->area.height); @@ -407,13 +407,13 @@ hvclock_redraw_canvas(GtkWidget *widget) { GdkRegion *region; - if (!widget->window) + if (!gtk_widget_get_window(widget)) return; - region = gdk_drawable_get_clip_region(widget->window); + region = gdk_drawable_get_clip_region(gtk_widget_get_window(widget)); /* redraw the cairo canvas completely by exposing it */ - gdk_window_invalidate_region(widget->window, region, TRUE); - gdk_window_process_updates(widget->window, TRUE); + gdk_window_invalidate_region(gtk_widget_get_window(widget), region, TRUE); + gdk_window_process_updates(gtk_widget_get_window(widget), TRUE); gdk_region_destroy(region); } diff --git a/src/dockapp.c b/src/dockapp.c index 4dfe77b..8ded719 100644 --- a/src/dockapp.c +++ b/src/dockapp.c @@ -72,7 +72,7 @@ dockapp_gtk_withdrawn_hack(GtkWidget *dockwin, GtkWidget *iconwin) (void) iconwin; /* Unused parameter. */ d = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); - win_orig = GDK_WINDOW_XID(dockwin->window); + win_orig = GDK_WINDOW_XID(gtk_widget_get_window(dockwin)); XQueryTree(d, win_orig, &root, &p, &children, &nchildren); @@ -146,7 +146,7 @@ dockapp_init(int argc, char *argv[]) g_signal_connect(dockwin, "destroy", G_CALLBACK(gtk_main_quit), NULL); /* Sets the icon of dockwin as iconwin. */ - gdk_window_set_icon(dockwin->window, iconwin->window, NULL, NULL); + gdk_window_set_icon(gtk_widget_get_window(dockwin), gtk_widget_get_window(iconwin), NULL, NULL); hvclock_init(iconwin); gtk_widget_show(iconwin); @@ -155,6 +155,6 @@ dockapp_init(int argc, char *argv[]) dockapp_gtk_withdrawn_hack(dockwin, iconwin); #else gtk_widget_show(dockwin); - gdk_window_withdraw(dockwin->window); + gdk_window_withdraw(gtk_widget_get_window(dockwin)); #endif }