summaryrefslogtreecommitdiff
diff options
authorNeil Jagdish Patel <neil.patel@canonical.com>2010-11-25 17:30:40 +0000
committerNeil Jagdish Patel <neil.patel@canonical.com>2010-11-25 17:30:40 +0000
commit009a2d2510ad72f4f494b0fefe66cb62652c4698 (patch)
tree681e6aab6866784b43d5c97d083c5bc897dbaeeb
parentc98099b2999e3774acb5c6519f0c43d149e9135f (diff)
Some fixes for testing3.2.0
(bzr r634)
-rw-r--r--CMakeLists.txt4
-rw-r--r--services/panel-service.c13
-rwxr-xr-xtests/unit/TestMain.cpp2
3 files changed, 16 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b225a7d78..3f2385254 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,8 +8,8 @@ subdirs (libunity services tests tools)
#
set (PROJECT_NAME "unity")
set (UNITY_MAJOR 3)
-set (UNITY_MINOR 1)
-set (UNITY_MICRO 4)
+set (UNITY_MINOR 2)
+set (UNITY_MICRO 0)
set (UNITY_VERSION "${UNITY_MAJOR}.${UNITY_MINOR}.${UNITY_MICRO}")
set (UNITY_API_VERSION "3.0")
diff --git a/services/panel-service.c b/services/panel-service.c
index 95b735b7e..bff42ecb1 100644
--- a/services/panel-service.c
+++ b/services/panel-service.c
@@ -91,6 +91,10 @@ static void load_indicator (PanelService *self,
static void load_indicators (PanelService *self);
static void sort_indicators (PanelService *self);
+static GdkFilterReturn event_filter (GdkXEvent *ev,
+ GdkEvent *gev,
+ PanelService *self);
+
/*
* GObject stuff
*/
@@ -102,6 +106,8 @@ panel_service_class_dispose (GObject *object)
g_hash_table_destroy (priv->id2entry_hash);
g_hash_table_destroy (priv->entry2indicator_hash);
+ gdk_window_remove_filter (NULL, (GdkFilterFunc)event_filter, object);
+
G_OBJECT_CLASS (panel_service_parent_class)->dispose (object);
}
@@ -149,6 +155,9 @@ event_filter (GdkXEvent *ev, GdkEvent *gev, PanelService *self)
XEvent *e = (XEvent *)ev;
GdkFilterReturn ret = GDK_FILTER_CONTINUE;
+ if (!PANEL_IS_SERVICE (self))
+ return ret;
+
if (!GTK_IS_WIDGET (self->priv->last_menu))
return ret;
@@ -303,11 +312,13 @@ panel_service_get_n_indicators (PanelService *self)
static gboolean
actually_notify_object (IndicatorObject *object)
{
- if (!INDICATOR_IS_OBJECT (object)) return;
PanelService *self;
PanelServicePrivate *priv;
gint position;
+ if (!INDICATOR_IS_OBJECT (object))
+ return FALSE;
+
self = panel_service_get_default ();
priv = self->priv;
diff --git a/tests/unit/TestMain.cpp b/tests/unit/TestMain.cpp
index d9697cd5c..da2b04861 100755
--- a/tests/unit/TestMain.cpp
+++ b/tests/unit/TestMain.cpp
@@ -21,6 +21,7 @@
#include "config.h"
#include <glib.h>
#include <glib-object.h>
+#include <gtk/gtk.h>
#include "Nux/Nux.h"
#include "Nux/WindowThread.h"
@@ -64,6 +65,7 @@ main (int argc, char **argv)
g_type_init ();
g_thread_init (NULL);
+ gtk_init (&argc, &argv);
g_test_init (&argc, &argv, NULL);