summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaszlo Boros <[email protected]>2013-07-18 00:55:51 +0200
committerStefano Karapetsas <[email protected]>2013-08-11 17:56:00 +0200
commitf5e3f9b082442139614a903a1cd84474a1adcb6e (patch)
tree26277cc8590e164117e2b818399769c44ef50ac8
parent002703a0f4b6167dd6421c3a0a96795c6386c840 (diff)
downloadmate-polkit-f5e3f9b082442139614a903a1cd84474a1adcb6e.tar.bz2
mate-polkit-f5e3f9b082442139614a903a1cd84474a1adcb6e.tar.xz
GTK3 compatibility
-rw-r--r--configure.ac24
-rw-r--r--src/polkitmateauthenticationdialog.c6
2 files changed, 28 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 6224320..35024b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -120,11 +120,31 @@ MATE_MAINTAINER_MODE_DEFINES
# Check for required packages
# ***************************
-GTK_REQUIRED=2.17.1
+AC_MSG_CHECKING([which gtk+ version to compile against])
+AC_ARG_WITH([gtk],
+ [AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 2.0)])],
+ [case "$with_gtk" in
+ 2.0|3.0) ;;
+ *) AC_MSG_ERROR([invalid gtk version specified]) ;;
+ esac],
+ [with_gtk=2.0])
+AC_MSG_RESULT([$with_gtk])
+
+case "$with_gtk" in
+ 2.0) GTK_API_VERSION=2.0
+ GTK_REQUIRED=2.24.0
+ ;;
+ 3.0) GTK_API_VERSION=3.0
+ GTK_REQUIRED=3.0.0
+ ;;
+esac
+
+PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED)
+
+
POLKIT_AGENT_REQUIRED=0.97
POLKIT_GOBJECT_REQUIRED=0.97
-PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
diff --git a/src/polkitmateauthenticationdialog.c b/src/polkitmateauthenticationdialog.c
index 3f02b19..22c8e51 100644
--- a/src/polkitmateauthenticationdialog.c
+++ b/src/polkitmateauthenticationdialog.c
@@ -536,7 +536,9 @@ polkit_mate_authentication_dialog_constructed (GObject *object)
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
+ #if !GTK_CHECK_VERSION(3, 0, 0)
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
+ #endif
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
@@ -997,7 +999,11 @@ polkit_mate_authentication_dialog_run_until_response_for_prompt (PolkitMateAuthe
response = gtk_dialog_run (GTK_DIALOG (dialog));
+ #if GTK_CHECK_VERSION(3, 0, 0)
+ gtk_widget_hide (dialog->priv->table_alignment);
+ #else
gtk_widget_hide_all (dialog->priv->table_alignment);
+ #endif
gtk_widget_set_no_show_all (dialog->priv->table_alignment, TRUE);
dialog->priv->is_running = FALSE;