From 5fafbe0a1f99da4c7d538032b3cab197dac36be6 Mon Sep 17 00:00:00 2001 From: infirit Date: Tue, 1 Jul 2014 15:00:15 +0200 Subject: Cleanup GTK_CHECK_VERSION and unify gtk+2/3 code where possible gdk_x11_set_sm_client_id | Since 2.24 gdk_x11_display_get_xdisplay | Since 2.2 GDK_DISPLAY_XDISPLAY | Since always GDK_WINDOW_XID | Since always gdk_window_get_screen | Since 2.24 gdk_x11_window_foreign_new_for_display | Since 2.24 gdk_window_get_width | Since 2.24 gdk_window_get_height | Since 2.24 --- baobab/src/baobab-chart.c | 4 ---- libeggsmclient/eggsmclient-xsmp.c | 4 ---- mate-screenshot/screenshot-utils.c | 24 ------------------------ 3 files changed, 32 deletions(-) diff --git a/baobab/src/baobab-chart.c b/baobab/src/baobab-chart.c index d22bffb5..8c36bfca 100644 --- a/baobab/src/baobab-chart.c +++ b/baobab/src/baobab-chart.c @@ -1217,12 +1217,8 @@ baobab_chart_get_pixbuf (GtkWidget *widget) g_return_val_if_fail (BAOBAB_IS_CHART (widget), NULL); - #if GTK_CHECK_VERSION(3, 0, 0) w = gdk_window_get_width(gtk_widget_get_window(widget)); h = gdk_window_get_height(gtk_widget_get_window(widget)); - #else - gdk_drawable_get_size(gtk_widget_get_window(widget), &w, &h); - #endif #if GTK_CHECK_VERSION(3, 0, 0) diff --git a/libeggsmclient/eggsmclient-xsmp.c b/libeggsmclient/eggsmclient-xsmp.c index 9ea00c28..f9741360 100644 --- a/libeggsmclient/eggsmclient-xsmp.c +++ b/libeggsmclient/eggsmclient-xsmp.c @@ -368,11 +368,7 @@ sm_client_xsmp_startup (EggSMClient *client, free (ret_client_id); gdk_threads_enter (); -#if GTK_CHECK_VERSION (3, 0, 0) gdk_x11_set_sm_client_id (xsmp->client_id); -#else - gdk_set_sm_client_id (xsmp->client_id); -#endif gdk_threads_leave (); g_debug ("Got client ID \"%s\"", xsmp->client_id); diff --git a/mate-screenshot/screenshot-utils.c b/mate-screenshot/screenshot-utils.c index 74c61055..fce538bd 100644 --- a/mate-screenshot/screenshot-utils.c +++ b/mate-screenshot/screenshot-utils.c @@ -481,11 +481,7 @@ select_area_filter (GdkXEvent *gdk_xevent, data->window); return GDK_FILTER_REMOVE; case KeyPress: -#if GTK_CHECK_VERSION (3, 0, 0) if (xevent->xkey.keycode == XKeysymToKeycode (gdk_x11_display_get_xdisplay(gdk_display_get_default()), XK_Escape)) -#else - if (xevent->xkey.keycode == XKeysymToKeycode (gdk_display, XK_Escape)) -#endif { data->rect.x = 0; data->rect.y = 0; @@ -568,11 +564,7 @@ find_wm_window (Window xid) do { -#if GTK_CHECK_VERSION (3, 0, 0) if (XQueryTree (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xid, &root, -#else - if (XQueryTree (GDK_DISPLAY (), xid, &root, -#endif &parent, &children, &nchildren) == 0) { g_warning ("Couldn't find window manager window"); @@ -706,11 +698,7 @@ mask_monitors (GdkPixbuf *pixbuf, GdkWindow *root_window) GdkRegion *invisible_region; GdkRectangle rect; -#if GTK_CHECK_VERSION (3, 0, 0) screen = gdk_window_get_screen (root_window); -#else - screen = gdk_drawable_get_screen (GDK_DRAWABLE (root_window)); -#endif region_with_monitors = make_region_with_monitors (screen); @@ -746,31 +734,19 @@ screenshot_get_pixbuf (GdkWindow *window, { Window xid, wm; -#if GTK_CHECK_VERSION (3, 0, 0) xid = GDK_WINDOW_XID (window); -#else - xid = GDK_WINDOW_XWINDOW (window); -#endif wm = find_wm_window (xid); if (wm != None) -#if GTK_CHECK_VERSION (3, 0, 0) window = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (), wm); -#else - window = gdk_window_foreign_new (wm); -#endif /* fallback to no border if we can't find the WM window. */ } root = gdk_get_default_root_window (); - #if GTK_CHECK_VERSION(3, 0, 0) real_width = gdk_window_get_width(window); real_height = gdk_window_get_height(window); - #else - gdk_drawable_get_size(window, &real_width, &real_height); - #endif gdk_window_get_origin (window, &x_real_orig, &y_real_orig); -- cgit v1.2.1