fixed freeze when click on preferences appindicator with natty.
authorJean-Philippe Orsini <jeanfi@gmail.com>
Thu, 21 Apr 2011 12:54:10 +0000 (12:54 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Thu, 21 Apr 2011 12:54:10 +0000 (12:54 +0000)
fixed typo (${X11_LIBS}) in configure.ac

NEWS
configure.ac
src/main.c
src/ui.h
src/ui_appindicator.c

diff --git a/NEWS b/NEWS
index ead15b8..34de54c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,9 @@
 * v0.6.1.8
 
 ** psensor: added turkish language
+** psensor: fixed freeze when click on preferences appindicator with
+   natty.
+** fixed typo (${X11_LIBS}) in configure.ac
 
 * v0.6.1.7
 
index b8956ff..1376f2e 100644 (file)
@@ -74,12 +74,22 @@ AM_CONDITIONAL(LIBNOTIFY, test -n "$LIBNOTIFY_LIBS")
 AC_SUBST(LIBNOTIFY_CFLAGS)
 AC_SUBST(LIBNOTIFY_LIBS)
 
+
 # Checks AppIndicator 
-APPINDICATOR_LIBS=
-PKG_CHECK_MODULES(APPINDICATOR, 
-  appindicator-0.1, 
-  [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator])], 
-  [AC_MSG_WARN("AppIndicator disabled")])
+ APPINDICATOR_LIBS=
+ PKG_CHECK_MODULES(APPINDICATOR, 
+     appindicator-0.1 = 0.2.9 , 
+     [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator 0.2.9])
+      AC_DEFINE([HAVE_APPINDICATOR_029],[1],[Use AppIndicator 0.2.9])
+     ],
+     [AC_MSG_WARN(AppIndicator 0.2.9 not present")])
+
+if test "$APPINDICATOR_LIBS" == ""; then
+   PKG_CHECK_MODULES(APPINDICATOR, 
+     appindicator-0.1 > 0.2.9, 
+     [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator > 0.2.9])], 
+     [AC_MSG_WARN("AppIndicator > 0.2.9 not present")])
+fi
 AM_CONDITIONAL(APPINDICATOR, test -n "$APPINDICATOR_LIBS")
 AC_SUBST(APPINDICATOR_CFLAGS)
 AC_SUBST(APPINDICATOR_LIBS)
@@ -119,7 +129,7 @@ AC_CHECK_HEADERS(NVCtrl/NVCtrl.h NVCtrl/NVCtrlLib.h,
                  [ 
                  #include <X11/Xlib.h>
                  ])
-if test -n "$X11_LIBS}"; then
+if test -n "${X11_LIBS}"; then
 LIBS="${LIBS} -lX11 -lXext"
 
 if test "${HAVE_NVIDIA}" = "true"; then
index d981976..b10d3bc 100644 (file)
@@ -52,7 +52,7 @@
 #include "rsensor.h"
 #endif
 
-#ifdef HAVE_APPINDICATOR
+#if defined(HAVE_APPINDICATOR) || defined(HAVE_APPINDICATOR_029)
 #include "ui_appindicator.h"
 #endif
 
@@ -183,7 +183,7 @@ gboolean ui_refresh_thread(gpointer data)
 
        ui_sensorlist_update(ui->ui_sensorlist);
 
-#ifdef HAVE_APPINDICATOR
+#if defined(HAVE_APPINDICATOR) || defined(HAVE_APPINDICATOR_029)
        ui_appindicator_update(ui);
 #endif
 
@@ -511,7 +511,7 @@ int main(int argc, char **argv)
 
        g_timeout_add(1000 * ui.graph_update_interval, ui_refresh_thread, &ui);
 
-#ifdef HAVE_APPINDICATOR
+#if defined(HAVE_APPINDICATOR) || defined(HAVE_APPINDICATOR_029)
        ui_appindicator_init(&ui);
 #endif
 
index 8e594db..f8ff055 100644 (file)
--- a/src/ui.h
+++ b/src/ui.h
@@ -28,7 +28,7 @@
 
 #include <gtk/gtk.h>
 
-#ifdef HAVE_APPINDICATOR
+#if defined(HAVE_APPINDICATOR) || defined(HAVE_APPINDICATOR_029)
 #include <libappindicator/app-indicator.h>
 #endif
 
@@ -56,7 +56,7 @@ struct ui_psensor {
        struct timeval *notification_last_time;
 #endif
 
-#ifdef HAVE_APPINDICATOR
+#if defined(HAVE_APPINDICATOR) || defined(HAVE_APPINDICATOR_029)
        AppIndicator *indicator;
 #endif
 };
index d77063e..23e226e 100644 (file)
@@ -44,9 +44,15 @@ static void cb_appindicator_quit(GtkWidget *widget, gpointer data)
 
 static void cb_appindicator_preferences(GtkWidget *widget, gpointer data)
 {
-       gdk_threads_enter();
-       ui_pref_dialog_run((struct ui_psensor *)data);
-       gdk_threads_leave();
+#ifdef HAVE_APPINDICATOR_029
+        gdk_threads_enter();
+#endif
+
+        ui_pref_dialog_run((struct ui_psensor *)data);
+
+#ifdef HAVE_APPINDICATOR_029
+        gdk_threads_leave();
+#endif
 }
 
 GtkWidget *ui_appindicator_get_menu(struct ui_psensor *ui)