Replace deprecated GDK_WINDOW_XWINDOW with GDK_WINDOW_XID.
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Sat, 29 Nov 2014 19:52:12 +0000 (21:52 +0200)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Sat, 29 Nov 2014 19:52:12 +0000 (21:52 +0200)
plugins/tray.c
src/panel.c

index 1289e41..941ec37 100644 (file)
@@ -591,7 +591,7 @@ static GtkWidget *tray_constructor(LXPanel *panel, config_setting_t *settings)
         xev.format = 32;
         xev.data.l[0] = timestamp;
         xev.data.l[1] = selection_atom;
-        xev.data.l[2] = GDK_WINDOW_XWINDOW(gtk_widget_get_window(invisible));
+        xev.data.l[2] = GDK_WINDOW_XID(gtk_widget_get_window(invisible));
         xev.data.l[3] = 0;    /* manager specific data */
         xev.data.l[4] = 0;    /* manager specific data */
         XSendEvent(GDK_DISPLAY_XDISPLAY(display), RootWindowOfScreen(xscreen), False, StructureNotifyMask, (XEvent *) &xev);
@@ -601,7 +601,7 @@ static GtkWidget *tray_constructor(LXPanel *panel, config_setting_t *settings)
         gulong data = SYSTEM_TRAY_ORIENTATION_HORZ;
         XChangeProperty(
             GDK_DISPLAY_XDISPLAY(display),
-            GDK_WINDOW_XWINDOW(gtk_widget_get_window(invisible)),
+            GDK_WINDOW_XID(gtk_widget_get_window(invisible)),
             a_NET_SYSTEM_TRAY_ORIENTATION,
             XA_CARDINAL, 32,
             PropModeReplace,
@@ -622,7 +622,7 @@ static GtkWidget *tray_constructor(LXPanel *panel, config_setting_t *settings)
     gdk_window_add_filter(NULL, (GdkFilterFunc) tray_event_filter, tr);
     /* Reference the window since it is never added to a container. */
     tr->invisible = g_object_ref_sink(G_OBJECT(invisible));
-    tr->invisible_window = GDK_WINDOW_XWINDOW(gtk_widget_get_window(invisible));
+    tr->invisible_window = GDK_WINDOW_XID(gtk_widget_get_window(invisible));
 
     /* Allocate top level widget and set into Plugin widget pointer. */
     tr->plugin = p = panel_icon_grid_new(panel_get_orientation(panel),
index 74dbb79..25542c9 100644 (file)
@@ -31,6 +31,7 @@
 #include <string.h>
 #include <gdk/gdkx.h>
 #include <libfm/fm-gtk.h>
+#include <cairo-xlib.h>
 
 #define __LXPANEL_INTERNALS__
 
@@ -137,13 +138,21 @@ static void panel_stop_gui(LXPanel *self)
     }
 }
 
+#if GTK_CHECK_VERSION(3, 0, 0)
+static void lxpanel_destroy(GtkWidget *object)
+#else
 static void lxpanel_destroy(GtkObject *object)
+#endif
 {
     LXPanel *self = LXPANEL(object);
 
     panel_stop_gui(self);
 
+#if GTK_CHECK_VERSION(3, 0, 0)
+    GTK_WIDGET_CLASS(lxpanel_parent_class)->destroy(object);
+#else
     GTK_OBJECT_CLASS(lxpanel_parent_class)->destroy(object);
+#endif
 }
 
 static gboolean idle_update_background(gpointer p)
@@ -299,11 +308,17 @@ static gboolean lxpanel_button_press(GtkWidget *widget, GdkEventButton *event)
 static void lxpanel_class_init(PanelToplevelClass *klass)
 {
     GObjectClass *gobject_class = (GObjectClass *)klass;
+#if !GTK_CHECK_VERSION(3, 0, 0)
     GtkObjectClass *gtk_object_class = (GtkObjectClass *)klass;
+#endif
     GtkWidgetClass *widget_class = (GtkWidgetClass *)klass;
 
     gobject_class->finalize = lxpanel_finalize;
+#if GTK_CHECK_VERSION(3, 0, 0)
+    widget_class->destroy = lxpanel_destroy;
+#else
     gtk_object_class->destroy = lxpanel_destroy;
+#endif
     widget_class->realize = lxpanel_realize;
     widget_class->size_request = lxpanel_size_request;
     widget_class->size_allocate = lxpanel_size_allocate;
@@ -653,7 +668,7 @@ static void paint_root_pixmap(LXPanel *panel, cairo_t *cr)
     cairo_paint(cr);
 #if GTK_CHECK_VERSION(3, 0, 0)
     cairo_surface_destroy(surface);
-    XFreePixmap(xpixmap);
+    XFreePixmap(dpy, xpixmap);
 #else
     g_object_unref(pixmap);
 #endif
@@ -1468,7 +1483,7 @@ panel_start_gui(LXPanel *panel, config_setting_t *list)
     if (p->round_corners)
         make_round_corners(p);
 
-    p->topxwin = GDK_WINDOW_XWINDOW(gtk_widget_get_window(w));
+    p->topxwin = GDK_WINDOW_XID(gtk_widget_get_window(w));
     DBG("topxwin = %x\n", p->topxwin);
 
     /* the settings that should be done before window is mapped */