summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/gtk2/Makefile.am1
-rw-r--r--modules/gtk3/Makefile.am1
-rw-r--r--modules/gtk3/caribou-gtk-module.vala10
3 files changed, 11 insertions, 1 deletions
diff --git a/modules/gtk2/Makefile.am b/modules/gtk2/Makefile.am
index 2580827..f59aabd 100644
--- a/modules/gtk2/Makefile.am
+++ b/modules/gtk2/Makefile.am
@@ -9,6 +9,7 @@ libcaribou_gtk_module_la_SOURCES = \
libcaribou_gtk_module_la_VALAFLAGS = \
-h caribou-gtk-module.h \
--vapidir=. \
+ --pkg gdk-x11-2.0 \
--pkg gtk+-2.0 \
-D GTK2 \
$(VALAGLAFS)
diff --git a/modules/gtk3/Makefile.am b/modules/gtk3/Makefile.am
index c7a86f5..0f5aa1b 100644
--- a/modules/gtk3/Makefile.am
+++ b/modules/gtk3/Makefile.am
@@ -9,6 +9,7 @@ libcaribou_gtk_module_la_SOURCES = \
libcaribou_gtk_module_la_VALAFLAGS = \
-h caribou-gtk-module.h \
--vapidir=. \
+ --pkg gdk-x11-3.0 \
--pkg gtk+-3.0 \
$(VALAGLAFS)
diff --git a/modules/gtk3/caribou-gtk-module.vala b/modules/gtk3/caribou-gtk-module.vala
index 4441f97..bbbac05 100644
--- a/modules/gtk3/caribou-gtk-module.vala
+++ b/modules/gtk3/caribou-gtk-module.vala
@@ -12,10 +12,13 @@ namespace Caribou {
class GtkModule {
private GLib.HashTable<Gtk.Window, bool> windows;
private Keyboard keyboard;
+ private Gdk.Display display;
public GtkModule () {
windows = new GLib.HashTable<Gtk.Window, bool> (null, null);
try {
+ display = Gdk.Display.get_default ();
+
keyboard = Bus.get_proxy_sync (BusType.SESSION,
"org.gnome.Caribou.Keyboard",
"/org/gnome/Caribou/Keyboard");
@@ -58,7 +61,12 @@ namespace Caribou {
}
private void do_focus_change (Gtk.Widget? widget) {
- uint32 timestamp = Gtk.get_current_event_time ();
+#if GTK2
+ uint32 timestamp = Gdk.x11_display_get_user_time (display);
+#else
+ uint32 timestamp = Gdk.X11Display.get_user_time (display);
+#endif
+
if (widget != null && (widget is Gtk.Entry || widget is Gtk.TextView) && widget is Gtk.Editable) {
Gdk.Window current_window = widget.get_window ();
int x = 0, y = 0, w = 0, h = 0;