From ad3bcc39c5c17b5e186a0659975e3705af201943 Mon Sep 17 00:00:00 2001 From: Nohemi Fernandez Date: Thu, 4 Aug 2011 13:05:58 -0500 Subject: Add GLib Timeout to know when new windows are created Right now there is no way to know whether a new window has been created without checking it repeatedly, as is done in this patch. https://bugzilla.gnome.org/show_bug.cgi?id=655828 --- modules/gtk3/caribou-gtk-module.vala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/gtk3/caribou-gtk-module.vala b/modules/gtk3/caribou-gtk-module.vala index 8be149c..6a7f553 100644 --- a/modules/gtk3/caribou-gtk-module.vala +++ b/modules/gtk3/caribou-gtk-module.vala @@ -21,8 +21,11 @@ namespace Caribou { "/org/gnome/Caribou/Keyboard"); add_tracker (); - GLib.Timeout.add (60, () => { add_tracker (); - return true; }); + // Need to use a timeout because there is currently no other + // way to know whether a new window has been created + // https://bugzilla.gnome.org/show_bug.cgi?id=655828 + GLib.Timeout.add_seconds (10, () => { add_tracker (); + return true; }); } catch (Error e) { stderr.printf ("%s\n", e.message); } -- cgit v1.2.1