summaryrefslogtreecommitdiff
path: root/battstat/battstat-upower.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-01-20 10:42:30 +0100
committerStefano Karapetsas <[email protected]>2014-01-20 10:42:30 +0100
commit1ef3e3f0edd6e3bca496219205b381197ee78e15 (patch)
treeb180967f90d1b7f9595f6efb85e7c83764d643fe /battstat/battstat-upower.c
parent418755ff4823a6b62fa64970b4fa715eb4e92eb2 (diff)
downloadmate-applets-1ef3e3f0edd6e3bca496219205b381197ee78e15.tar.bz2
mate-applets-1ef3e3f0edd6e3bca496219205b381197ee78e15.tar.xz
battstat: Add GTK3 support
Code taken from: https://git.gnome.org/browse/gnome-applets/commit/battstat?id=274f17fe92b98b5a0bdd31de734240b4cc6227e9 https://git.gnome.org/browse/gnome-applets/commit/battstat?id=137c00e2de6098b0ecef75ec208d58de138d7a82 https://git.gnome.org/browse/gnome-applets/commit/battstat?id=13522dcb2cb272b11214728c69c9ec179de78e2d
Diffstat (limited to 'battstat/battstat-upower.c')
-rw-r--r--battstat/battstat-upower.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/battstat/battstat-upower.c b/battstat/battstat-upower.c
index f42de3fd..b0838176 100644
--- a/battstat/battstat-upower.c
+++ b/battstat/battstat-upower.c
@@ -325,9 +325,15 @@ error_dialog( const char *fmt , ...)
dialog = gtk_message_dialog_new( NULL, 0, GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK, "%s", str);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ g_signal_connect_swapped( G_OBJECT (dialog), "response",
+ G_CALLBACK (gtk_widget_destroy),
+ G_OBJECT (dialog) );
+#else
g_signal_connect_swapped( GTK_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
GTK_OBJECT (dialog) );
+#endif
gtk_widget_show_all( dialog );
}