From 484c1f63ba471ce20bc5c3378807cf60f2edf9cd Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 19 Feb 2019 06:03:19 -0800 Subject: [PATCH] gtk3: Force GTK2-style input handling GTK3 provides for additional input devices via xinput2. These include touchscreens and continuous scroll devices. But wxWidgets does not have specialized handlers for these events, so they double up for some devices. Until wxWidgets allows us to handle these events, we specify that the input handler should be the old-style GDK_CORE. --- common/single_top.cpp | 3 +++ include/view/zoom_controller.h | 2 +- kicad/kicad.cpp | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/single_top.cpp b/common/single_top.cpp index 4501b715c5..8f6807ead1 100644 --- a/common/single_top.cpp +++ b/common/single_top.cpp @@ -138,6 +138,9 @@ struct APP_SINGLE_TOP : public wxApp // Disable overlay scrollbars as they mess up wxWidgets window sizing and cause excessive redraw requests wxSetEnv( wxT( "GTK_OVERLAY_SCROLLING" ), wxT( "0" ) ); + // Set GTK2-style input instead of xinput2. This disables touchscreen and smooth scrolling + // Needed to ensure that we are not getting multiple mouse scroll events + wxSetEnv( wxT( "GDK_CORE_DEVICE_EVENTS" ), wxT( "1" ) ); } #endif diff --git a/include/view/zoom_controller.h b/include/view/zoom_controller.h index fa2eed6ab7..baa0e630ec 100644 --- a/include/view/zoom_controller.h +++ b/include/view/zoom_controller.h @@ -138,7 +138,7 @@ public: double GetScaleForRotation( int aRotation ) override; /// A suitable (magic) scale factor for GTK3 systems - static constexpr double GTK3_SCALE = 0.001; + static constexpr double GTK3_SCALE = 0.002; /// A suitable (magic) scale factor for Mac systems static constexpr double MAC_SCALE = 0.01; diff --git a/kicad/kicad.cpp b/kicad/kicad.cpp index 9ed2b95cb8..ae6e5cda58 100644 --- a/kicad/kicad.cpp +++ b/kicad/kicad.cpp @@ -232,6 +232,10 @@ struct APP_KICAD : public wxApp // Disable overlay scrollbars as they mess up wxWidgets window sizing and cause excessive redraw requests wxSetEnv( wxT( "GTK_OVERLAY_SCROLLING" ), wxT( "0" ) ); + + // Set GTK2-style input instead of xinput2. This disables touchscreen and smooth scrolling + // Needed to ensure that we are not getting multiple mouse scroll events + wxSetEnv( wxT( "GDK_CORE_DEVICE_EVENTS" ), wxT( "1" ) ); } #endif