diff options
author | infirit <[email protected]> | 2014-05-16 16:28:11 +0200 |
---|---|---|
committer | infirit <[email protected]> | 2014-05-16 16:28:11 +0200 |
commit | 41ff2a970ebee68fc7ca335f10ae24a6210d1fd5 (patch) | |
tree | 1fece64eda0067255bbf37dc03835bb177bccfff | |
parent | 472ccc0025494452e705ac28dc82fe5abd431de8 (diff) | |
download | mate-panel-41ff2a970ebee68fc7ca335f10ae24a6210d1fd5.tar.bz2 mate-panel-41ff2a970ebee68fc7ca335f10ae24a6210d1fd5.tar.xz |
Use GDK_WINDOW_XID for gtk+2 and gtk+3
It was introduced in gdk2 already so clean up the code.
-rw-r--r-- | applets/notification_area/na-tray-child.c | 4 | ||||
-rw-r--r-- | applets/notification_area/na-tray-manager.c | 11 | ||||
-rw-r--r-- | libmate-panel-applet/mate-panel-applet.c | 14 | ||||
-rw-r--r-- | mate-panel/panel-multiscreen.c | 4 | ||||
-rw-r--r-- | mate-panel/panel-xutils.c | 12 | ||||
-rw-r--r-- | mate-panel/xstuff.c | 20 |
6 files changed, 3 insertions, 62 deletions
diff --git a/applets/notification_area/na-tray-child.c b/applets/notification_area/na-tray-child.c index 84fddf64..9ff5c739 100644 --- a/applets/notification_area/na-tray-child.c +++ b/applets/notification_area/na-tray-child.c @@ -492,11 +492,7 @@ na_tray_child_force_redraw (NaTrayChild *child) gtk_widget_get_allocation (widget, &allocation); xev.xexpose.type = Expose; -#if GTK_CHECK_VERSION (3, 0, 0) xev.xexpose.window = GDK_WINDOW_XID (plug_window); -#else - xev.xexpose.window = GDK_WINDOW_XWINDOW (plug_window); -#endif xev.xexpose.x = 0; xev.xexpose.y = 0; xev.xexpose.width = allocation.width; diff --git a/applets/notification_area/na-tray-manager.c b/applets/notification_area/na-tray-manager.c index 1a2acc7f..1483bcd0 100644 --- a/applets/notification_area/na-tray-manager.c +++ b/applets/notification_area/na-tray-manager.c @@ -27,11 +27,6 @@ #include "na-tray-manager.h" #include <gtk/gtk.h> -#if GTK_CHECK_VERSION (3, 0, 0) -#define GDK_WINDOW_XWINDOW GDK_WINDOW_XID -#else -#include <gdkconfig.h> -#endif #include <glib/gi18n.h> #if defined (GDK_WINDOWING_X11) #include <gdk/gdkx.h> @@ -646,7 +641,7 @@ na_tray_manager_set_orientation_property (NaTrayManager *manager) SYSTEM_TRAY_ORIENTATION_VERT; XChangeProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XWINDOW (window), + GDK_WINDOW_XID (window), orientation_atom, XA_CARDINAL, 32, PropModeReplace, @@ -706,7 +701,7 @@ na_tray_manager_set_visual_property (NaTrayManager *manager) data[0] = XVisualIDFromVisual (xvisual); XChangeProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XWINDOW (window), + GDK_WINDOW_XID (window), visual_atom, XA_VISUALID, 32, PropModeReplace, @@ -784,7 +779,7 @@ na_tray_manager_manage_screen_x11 (NaTrayManager *manager, xev.data.l[0] = timestamp; xev.data.l[1] = gdk_x11_atom_to_xatom_for_display (display, manager->selection_atom); - xev.data.l[2] = GDK_WINDOW_XWINDOW (window); + xev.data.l[2] = GDK_WINDOW_XID (window); xev.data.l[3] = 0; /* manager specific data */ xev.data.l[4] = 0; /* manager specific data */ diff --git a/libmate-panel-applet/mate-panel-applet.c b/libmate-panel-applet/mate-panel-applet.c index c11ac37a..efcca300 100644 --- a/libmate-panel-applet/mate-panel-applet.c +++ b/libmate-panel-applet/mate-panel-applet.c @@ -561,11 +561,7 @@ mate_panel_applet_request_focus (MatePanelApplet *applet, display = gdk_screen_get_display (screen); xdisplay = GDK_DISPLAY_XDISPLAY (display); -#if GTK_CHECK_VERSION (3, 0, 0) xroot = GDK_WINDOW_XID (root); -#else - xroot = GDK_WINDOW_XWINDOW (root); -#endif mate_panel_applet_init_atoms (xdisplay); @@ -948,15 +944,9 @@ mate_panel_applet_button_event (GtkWidget *widget, } xevent.xbutton.display = GDK_WINDOW_XDISPLAY (window); -#if GTK_CHECK_VERSION (3, 0, 0) xevent.xbutton.window = GDK_WINDOW_XID (socket_window); xevent.xbutton.root = GDK_WINDOW_XID (gdk_screen_get_root_window (gdk_window_get_screen (window))); -#else - xevent.xbutton.window = GDK_WINDOW_XWINDOW (socket_window); - xevent.xbutton.root = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window - (gdk_drawable_get_screen (window))); -#endif /* * FIXME: the following might cause * big problems for non-GTK apps @@ -972,11 +962,7 @@ mate_panel_applet_button_event (GtkWidget *widget, gdk_error_trap_push (); XSendEvent (GDK_WINDOW_XDISPLAY (window), -#if GTK_CHECK_VERSION (3, 0, 0) GDK_WINDOW_XID (socket_window), -#else - GDK_WINDOW_XWINDOW (socket_window), -#endif False, NoEventMask, &xevent); gdk_flush (); diff --git a/mate-panel/panel-multiscreen.c b/mate-panel/panel-multiscreen.c index 27c29135..e475fd7b 100644 --- a/mate-panel/panel-multiscreen.c +++ b/mate-panel/panel-multiscreen.c @@ -133,11 +133,7 @@ panel_multiscreen_get_randr_monitors_for_screen (GdkScreen *screen, */ xdisplay = GDK_SCREEN_XDISPLAY (screen); -#if GTK_CHECK_VERSION (3, 0, 0) xroot = GDK_WINDOW_XID (gdk_screen_get_root_window (screen)); -#else - xroot = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen)); -#endif #if (RANDR_MAJOR > 1 || (RANDR_MAJOR == 1 && RANDR_MINOR >= 3)) if (have_randr_1_3) { diff --git a/mate-panel/panel-xutils.c b/mate-panel/panel-xutils.c index ccf68116..34e851fd 100644 --- a/mate-panel/panel-xutils.c +++ b/mate-panel/panel-xutils.c @@ -51,11 +51,7 @@ panel_xutils_set_window_type (GdkWindow *gdk_window, g_return_if_fail (GDK_IS_WINDOW (gdk_window)); display = GDK_WINDOW_XDISPLAY (gdk_window); -#if GTK_CHECK_VERSION (3, 0, 0) window = GDK_WINDOW_XID (gdk_window); -#else - window = GDK_WINDOW_XWINDOW (gdk_window); -#endif if (net_wm_window_type == None) net_wm_window_type = XInternAtom (display, @@ -122,11 +118,7 @@ panel_xutils_set_strut (GdkWindow *gdk_window, g_return_if_fail (GDK_IS_WINDOW (gdk_window)); display = GDK_WINDOW_XDISPLAY (gdk_window); -#if GTK_CHECK_VERSION (3, 0, 0) window = GDK_WINDOW_XID (gdk_window); -#else - window = GDK_WINDOW_XWINDOW (gdk_window); -#endif if (net_wm_strut == None) net_wm_strut = XInternAtom (display, "_NET_WM_STRUT", False); @@ -181,11 +173,7 @@ panel_warp_pointer (GdkWindow *gdk_window, g_return_if_fail (GDK_IS_WINDOW (gdk_window)); display = GDK_WINDOW_XDISPLAY (gdk_window); -#if GTK_CHECK_VERSION (3, 0, 0) window = GDK_WINDOW_XID (gdk_window); -#else - window = GDK_WINDOW_XWINDOW (gdk_window); -#endif gdk_error_trap_push (); XWarpPointer (display, None, window, 0, 0, 0, 0, x, y); diff --git a/mate-panel/xstuff.c b/mate-panel/xstuff.c index d31f6d97..8c375deb 100644 --- a/mate-panel/xstuff.c +++ b/mate-panel/xstuff.c @@ -163,11 +163,7 @@ xstuff_is_compliant_wm (void) int size; xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); -#if GTK_CHECK_VERSION (3, 0, 0) root_window = GDK_WINDOW_XID (gdk_get_default_root_window ()); -#else - root_window = GDK_WINDOW_XWINDOW (gdk_get_default_root_window ()); -#endif /* FIXME this is totally broken; should be using * gdk_net_wm_supports() on particular hints when we rely @@ -215,11 +211,7 @@ xstuff_set_pos_size (GdkWindow *window, int x, int y, int w, int h) gdk_error_trap_push (); XSetWMNormalHints (GDK_WINDOW_XDISPLAY (window), -#if GTK_CHECK_VERSION (3, 0, 0) GDK_WINDOW_XID (window), -#else - GDK_WINDOW_XWINDOW (window), -#endif &size_hints); gdk_window_move_resize (window, x, y, w, h); @@ -251,11 +243,7 @@ xstuff_set_wmspec_dock_hints (GdkWindow *window, } XChangeProperty (GDK_WINDOW_XDISPLAY (window), -#if GTK_CHECK_VERSION (3, 0, 0) GDK_WINDOW_XID (window), -#else - GDK_WINDOW_XWINDOW (window), -#endif panel_atom_get ("_NET_WM_WINDOW_TYPE"), XA_ATOM, 32, PropModeReplace, (unsigned char *) atoms, @@ -277,11 +265,7 @@ xstuff_set_wmspec_strut (GdkWindow *window, vals [3] = bottom; XChangeProperty (GDK_WINDOW_XDISPLAY (window), -#if GTK_CHECK_VERSION (3, 0, 0) GDK_WINDOW_XID (window), -#else - GDK_WINDOW_XWINDOW (window), -#endif panel_atom_get ("_NET_WM_STRUT"), XA_CARDINAL, 32, PropModeReplace, (unsigned char *) vals, 4); @@ -291,11 +275,7 @@ void xstuff_delete_property (GdkWindow *window, const char *name) { Display *xdisplay = GDK_WINDOW_XDISPLAY (window); -#if GTK_CHECK_VERSION (3, 0, 0) Window xwindow = GDK_WINDOW_XID (window); -#else - Window xwindow = GDK_WINDOW_XWINDOW (window); -#endif XDeleteProperty (xdisplay, xwindow, panel_atom_get (name)); |