From e670e05cb08c66da2838abe2608cfccb8b09fafd Mon Sep 17 00:00:00 2001 From: monsta Date: Tue, 17 May 2016 14:08:57 +0300 Subject: require GTK+ >= 3.14, drop GTK+2 code and --with-gtk build option --- mate-session/gsm-inhibit-dialog.c | 77 --------------------------------------- mate-session/gsm-logout-dialog.c | 6 --- mate-session/msm-gnome.c | 8 ---- mate-session/test-inhibit.c | 4 -- 4 files changed, 95 deletions(-) (limited to 'mate-session') diff --git a/mate-session/gsm-inhibit-dialog.c b/mate-session/gsm-inhibit-dialog.c index 806f9d5..94a2026 100644 --- a/mate-session/gsm-inhibit-dialog.c +++ b/mate-session/gsm-inhibit-dialog.c @@ -224,11 +224,7 @@ _find_icon (GtkIconTheme *icon_theme, if (info) { retval = g_strdup (gtk_icon_info_get_filename (info)); -#if GTK_CHECK_VERSION (3, 8, 0) g_object_unref (info); -#else - gtk_icon_info_free (info); -#endif } else retval = NULL; @@ -316,43 +312,6 @@ scale_pixbuf (GdkPixbuf *pixbuf, } #ifdef HAVE_XRENDER - -#if !GTK_CHECK_VERSION (3, 0, 0) -/* adapted from marco */ -static GdkColormap* -get_cmap (GdkPixmap *pixmap) -{ - GdkColormap *cmap; - - cmap = gdk_drawable_get_colormap (pixmap); - if (cmap) { - g_object_ref (G_OBJECT (cmap)); - } - - if (cmap == NULL) { - if (gdk_drawable_get_depth (pixmap) == 1) { - g_debug ("Using NULL colormap for snapshotting bitmap\n"); - cmap = NULL; - } else { - g_debug ("Using system cmap to snapshot pixmap\n"); - cmap = gdk_screen_get_system_colormap (gdk_drawable_get_screen (pixmap)); - - g_object_ref (G_OBJECT (cmap)); - } - } - - /* Be sure we aren't going to blow up due to visual mismatch */ - if (cmap && - (gdk_visual_get_depth (gdk_colormap_get_visual (cmap)) != - gdk_drawable_get_depth (pixmap))) { - cmap = NULL; - g_debug ("Switching back to NULL cmap because of depth mismatch\n"); - } - - return cmap; -} -#endif - static GdkPixbuf * pixbuf_get_from_pixmap (Display *display, Pixmap xpixmap, @@ -360,19 +319,12 @@ pixbuf_get_from_pixmap (Display *display, int height) { GdkPixbuf *retval; -#if GTK_CHECK_VERSION (3, 0, 0) cairo_surface_t *surface; Visual *visual; -#else - GdkDrawable *drawable; - GdkColormap *cmap; - cmap = NULL; -#endif retval = NULL; g_debug ("GsmInhibitDialog: getting foreign pixmap for %u", (guint)xpixmap); -#if GTK_CHECK_VERSION (3, 0, 0) visual = DefaultVisual (display, 0); surface = cairo_xlib_surface_create (display, xpixmap, @@ -386,27 +338,6 @@ pixbuf_get_from_pixmap (Display *display, width, height); cairo_surface_destroy (surface); } -#else - drawable = gdk_pixmap_foreign_new (xpixmap); - if (GDK_IS_PIXMAP (drawable)) { - cmap = get_cmap (drawable); - - g_debug ("GsmInhibitDialog: getting pixbuf w=%d h=%d", width, height); - - retval = gdk_pixbuf_get_from_drawable (NULL, - drawable, - cmap, - 0, 0, - 0, 0, - width, height); - } - if (cmap) { - g_object_unref (G_OBJECT (cmap)); - } - if (drawable) { - g_object_unref (G_OBJECT (drawable)); - } -#endif return retval; } @@ -495,11 +426,7 @@ get_pixbuf_for_window (GdkDisplay *gdkdisplay, gdk_error_trap_push (); XFreePixmap (display, xpixmap); gdk_display_sync (gdkdisplay); -#if GTK_CHECK_VERSION (3, 0, 0) gdk_error_trap_pop_ignored (); -#else - gdk_error_trap_pop (); -#endif } if (pixbuf != NULL) { @@ -1040,11 +967,7 @@ gsm_inhibit_dialog_constructor (GType type, dialog->priv->have_xrender = FALSE; } gdk_display_sync (gdkdisplay); -#if GTK_CHECK_VERSION (3, 0, 0) gdk_error_trap_pop_ignored (); -#else - gdk_error_trap_pop (); -#endif #endif /* HAVE_XRENDER */ /* FIXME: turn this on when it is ready */ diff --git a/mate-session/gsm-logout-dialog.c b/mate-session/gsm-logout-dialog.c index f53c197..06cecd0 100644 --- a/mate-session/gsm-logout-dialog.c +++ b/mate-session/gsm-logout-dialog.c @@ -523,15 +523,9 @@ gsm_get_dialog (GsmDialogLogoutType type, dialog_image = gtk_message_dialog_get_image (GTK_MESSAGE_DIALOG (logout_dialog)); -#if GTK_CHECK_VERSION (3, 0, 0) hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); -#else - hbox = gtk_hbox_new (FALSE, 0); -#endif logout_dialog->priv->progressbar = gtk_progress_bar_new (); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_progress_bar_set_show_text (GTK_PROGRESS_BAR (logout_dialog->priv->progressbar), TRUE); -#endif gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (logout_dialog->priv->progressbar), 1.0); gtk_box_pack_start (GTK_BOX (hbox), logout_dialog->priv->progressbar, diff --git a/mate-session/msm-gnome.c b/mate-session/msm-gnome.c index e7dd68f..79912d7 100644 --- a/mate-session/msm-gnome.c +++ b/mate-session/msm-gnome.c @@ -196,11 +196,7 @@ msm_compat_gnome_smproxy_startup (void) (unsigned char *) (void *) &gnome_smproxy_window, 1); XSync (dpy, False); -#if GTK_CHECK_VERSION (3, 0, 0) gdk_error_trap_pop_ignored (); -#else - gdk_error_trap_pop (); -#endif } @@ -215,11 +211,7 @@ msm_compat_gnome_smproxy_shutdown (void) XSync (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), False); gnome_smproxy_window = None; } -#if GTK_CHECK_VERSION (3, 0, 0) gdk_error_trap_pop_ignored (); -#else - gdk_error_trap_pop (); -#endif } diff --git a/mate-session/test-inhibit.c b/mate-session/test-inhibit.c index fdc0744..45771e0 100644 --- a/mate-session/test-inhibit.c +++ b/mate-session/test-inhibit.c @@ -93,11 +93,7 @@ do_inhibit_for_window (GdkWindow *window) app_id = "caja"; reason = "A file transfer is in progress."; #endif -#if GTK_CHECK_VERSION (3, 0, 0) toplevel_xid = gdk_x11_window_get_xid (window); -#else - toplevel_xid = GDK_DRAWABLE_XID (window); -#endif flags = GSM_INHIBITOR_FLAG_LOGOUT | GSM_INHIBITOR_FLAG_SWITCH_USER -- cgit v1.2.1