Disable event compression when scratching to improve fallback
authorAlexander Koenig <alex@lisas.de>
Sat, 14 May 2016 22:35:51 +0000 (00:35 +0200)
committerAlexander Koenig <alex@lisas.de>
Sat, 14 May 2016 22:35:51 +0000 (00:35 +0200)
scratch mode.

src/tX_mouse.cc
src/tX_mouse.h

index e5953922056a0fc73b3615a9dc17e12c9f4ab163..66c8e9e67fa3a03c5b5ef1a9a28be8c4641cae15 100644 (file)
@@ -78,7 +78,12 @@ int tx_mouse :: grab()
        window =  gtk_widget_get_window(main_window);
        GdkDisplay* gdk_dpy = gdk_window_get_display(window);
        GdkDeviceManager *device_manager = gdk_display_get_device_manager(gdk_dpy);
-       
+
+       if (grab_mode == FALLBACK) {
+           enable_compression = gdk_window_get_event_compression(window);
+           gdk_window_set_event_compression(window, False);
+       }
+
        if (!gdk_dpy) {
                fputs("GrabMode Error: couldn't access GDKDisplay.", stderr);
                return(ENG_ERR_XOPEN);
@@ -171,6 +176,10 @@ void tx_mouse :: ungrab()
        if (enable_auto_mnemonics) {
                g_object_set (gtk_widget_get_settings (main_window), "gtk-auto-mnemonics", enable_auto_mnemonics, NULL);
        }
+       
+       if (grab_mode == FALLBACK) {
+           gdk_window_set_event_compression(window, enable_compression);
+       }
 
        ungrab_linux_input();
        
index ac4647a59ddd08cf34d12bc93a9fbcb9b7e7b7c9..e2c0bb9bdee8f2c456258ef94140c2540372a743 100644 (file)
@@ -74,6 +74,7 @@ class tx_mouse
        GdkEventMask savedEventMask;
 
        gboolean enable_auto_mnemonics;
+       gboolean enable_compression;
        guint last_button_press;
        guint last_button_release;