summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNohemi Fernandez <nf68@cornell.edu>2011-08-08 20:22:43 -0500
committerEitan Isaacson <eitan@monotonous.org>2011-08-12 09:19:41 +0200
commit931d840edff1d6cd051838d0f8c01b2e71d1eb1c (patch)
tree55a1623fc8afefd2cd5a1973e1344bf2d488e40b
parente8ee7789378b430bcf59b233557a1a3ef314aa38 (diff)
downloadcaribou-931d840edff1d6cd051838d0f8c01b2e71d1eb1c.tar.gz
Implement g_module_unload to clean up after disabling keyboard
-rw-r--r--modules/gtk3/caribou-gtk-module.vala8
-rw-r--r--modules/gtk3/caribou-module.c7
-rw-r--r--modules/gtk3/vapi-fixes.vapi5
3 files changed, 20 insertions, 0 deletions
diff --git a/modules/gtk3/caribou-gtk-module.vala b/modules/gtk3/caribou-gtk-module.vala
index add5a79..4c92348 100644
--- a/modules/gtk3/caribou-gtk-module.vala
+++ b/modules/gtk3/caribou-gtk-module.vala
@@ -125,5 +125,13 @@ namespace Caribou {
#endif
}
+ public void unload () {
+ Gdk.window_remove_filter(null, event_filter);
+ windows = new GLib.HashTable<Gtk.Window, bool> (null, null);
+ cursor_rect.x = cursor_rect.y = cursor_rect.width = cursor_rect.height = 0;
+ keyboard = null;
+ display = null;
+ }
+
}
}
diff --git a/modules/gtk3/caribou-module.c b/modules/gtk3/caribou-module.c
index ad45752..90f0534 100644
--- a/modules/gtk3/caribou-module.c
+++ b/modules/gtk3/caribou-module.c
@@ -5,9 +5,12 @@
#define CARIBOU_LOCALDIR ""
+G_MODULE_EXPORT CaribouGtkModule * gtk_module;
+
G_MODULE_EXPORT CaribouGtkModule *
gtk_module_init (gint *argc, gchar ***argv[]) {
CaribouGtkModule *context = caribou_gtk_module_new ();
+ gtk_module = context;
return context;
}
@@ -17,3 +20,7 @@ g_module_check_init (GModule *module)
return gtk_check_version (GTK_MAJOR_VERSION, 0, 0);
}
+G_MODULE_EXPORT void
+g_module_unload(GModule *module) {
+ caribou_gtk_module_unload (gtk_module);
+}
diff --git a/modules/gtk3/vapi-fixes.vapi b/modules/gtk3/vapi-fixes.vapi
index 42e7feb..deec3f6 100644
--- a/modules/gtk3/vapi-fixes.vapi
+++ b/modules/gtk3/vapi-fixes.vapi
@@ -8,6 +8,11 @@ namespace Gdk {
public void window_add_filter (Gdk.Window? window,
Gdk.FilterFunc function);
+ // Gdk.Window.remove_filter() doesn't let you pass null for window
+ [CCode (cname = "gdk_window_remove_filter")]
+ public void window_remove_filter (Gdk.Window? window,
+ Gdk.FilterFunc function);
+
// Official binding is missing the "out"
[CCode (cname = "gdk_window_get_user_data")]
public void window_get_user_data (Gdk.Window window,