summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--src/x11_in_gtk2.c4
-rw-r--r--wscript7
3 files changed, 13 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 16b73aa..05183e9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,10 @@
suil (0.6.11) unstable;
+ * Add compile time option to disable explicit Gtk to X11 key forwarding
* Fix crash when a broken UI returns a NULL descriptor
* Fix compilation on BSD
- -- David Robillard <d@drobilla.net> Sat, 09 Feb 2013 15:31:44 -0500
+ -- David Robillard <d@drobilla.net> Fri, 22 Feb 2013 12:51:26 -0500
suil (0.6.10) stable;
diff --git a/src/x11_in_gtk2.c b/src/x11_in_gtk2.c
index fd3547a..2e3cdf9 100644
--- a/src/x11_in_gtk2.c
+++ b/src/x11_in_gtk2.c
@@ -130,6 +130,7 @@ wrapper_free(SuilWrapper* wrapper)
}
}
+#ifdef SUIL_FORWARD_KEYS
static GdkFilterReturn
event_filter(GdkXEvent* xevent, GdkEvent* event, gpointer data)
{
@@ -144,6 +145,7 @@ event_filter(GdkXEvent* xevent, GdkEvent* event, gpointer data)
}
return GDK_FILTER_CONTINUE;
}
+#endif
SUIL_LIB_EXPORT
SuilWrapper*
@@ -166,8 +168,10 @@ suil_wrapper_new(SuilHost* host,
wrapper->resize.handle = wrap;
wrapper->resize.ui_resize = wrapper_resize;
+#ifdef SUIL_FORWARD_KEYS
GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(wrap));
gdk_window_add_filter(window, event_filter, wrap);
+#endif
suil_add_feature(features, &n_features, LV2_UI__parent,
(void*)(intptr_t)gtk_plug_get_id(wrap->plug));
diff --git a/wscript b/wscript
index 00313e2..9a64f3f 100644
--- a/wscript
+++ b/wscript
@@ -26,6 +26,8 @@ def options(opt):
help="Build static library")
opt.add_option('--no-shared', action='store_true', dest='no_shared',
help='Do not build shared library')
+ opt.add_option('--no-forward-keys', action='store_true', dest='no_forward_keys',
+ help='Do not explicitly forward key events for X11 in Gtk')
opt.add_option('--gtk2-lib-name', type='string', dest='gtk2_lib_name',
default="libgtk-x11-2.0.so.0",
help="Gtk2 library name [Default: libgtk-x11-2.0.so.0]")
@@ -90,6 +92,9 @@ def configure(conf):
autowaf.define(conf, 'SUIL_MODULE_PREFIX', module_prefix)
autowaf.define(conf, 'SUIL_MODULE_EXT', module_ext)
+ if not Options.options.no_forward_keys:
+ autowaf.define(conf, 'SUIL_FORWARD_KEYS', 1)
+
autowaf.set_lib_env(conf, 'suil', SUIL_VERSION)
conf.write_config_header('suil_config.h', remove=False)
@@ -97,6 +102,8 @@ def configure(conf):
conf.is_defined('HAVE_GTK2'))
autowaf.display_msg(conf, "Gtk2 Library Name",
conf.env.SUIL_GTK2_LIB_NAME)
+ autowaf.display_msg(conf, "Forward Gtk keys to X11 UI",
+ conf.is_defined('SUIL_FORWARD_KEYS'))
autowaf.display_msg(conf, "Qt4 Support",
conf.is_defined('HAVE_QT4'))
print('')