[spice-gtk PATCH v1] spice-widget: keypress-delay set by env var

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/spice-widget.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/spice-widget.c b/src/spice-widget.c
index 260fda5..6541e0b 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -1209,8 +1209,14 @@ static void send_key(SpiceDisplay *display, int scancode, SendKeyType type, gboo
         if (press_delayed &&
             d->keypress_delay != 0 &&
             !(d->key_state[i] & m)) {
+            const gchar *env = g_getenv("SPICE_KEYPRESS_DELAY");
+            guint delay = d->keypress_delay;
             g_warn_if_fail(d->key_delayed_id == 0);
-            d->key_delayed_id = g_timeout_add(d->keypress_delay, key_press_delayed, display);
+            if (env != NULL)
+                delay = (guint) g_ascii_strtoull(env, NULL, 10);
+
+            SPICE_DEBUG ("keypress-delay is: %u ms", delay);
+            d->key_delayed_id = g_timeout_add(delay, key_press_delayed, display);
             d->key_delayed_scancode = scancode;
         } else
             spice_inputs_key_press(d->inputs, scancode);
-- 
2.4.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]