[gtk/gtk-3-24: 1/2] gdk: quartz: Avoid page up/down getting filtered by gtk_im_context_filter_keypress()



commit 817e99640df4b8739ec33e4ee72548a843718f7d
Author: Jiří Techet <techet gmail com>
Date:   Thu Oct 24 21:48:30 2019 +0200

    gdk: quartz: Avoid page up/down getting filtered by gtk_im_context_filter_keypress()
    
    For page up/down events (Fn+up_arrow and Fn+down_arrow on macOS)
    gtk_im_context_filter_keypress() currently returns TRUE when im-quartz is
    used. This means these events get removed when this function is used
    (happens e.g. with the Scintilla text editing library).
    
    Adding scrollPageDown: and scrollPageUp: into GdkQuartzView seems to
    resolve the issue as these seem to get called instead of the already
    present pageUp: and pageDown:.

 gdk/quartz/GdkQuartzView.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
---
diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c
index 193fcc1d31..b2ed5e2418 100644
--- a/gdk/quartz/GdkQuartzView.c
+++ b/gdk/quartz/GdkQuartzView.c
@@ -532,6 +532,20 @@
                     GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
 }
 
+-(void)scrollPageDown: (id)sender
+{
+  GDK_NOTE (EVENTS, g_message ("scrollPageDown"));
+  g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+                    GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
+}
+
+-(void)scrollPageUp: (id)sender
+{
+  GDK_NOTE (EVENTS, g_message ("scrollPageUp"));
+  g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
+                    GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
+}
+
 -(void)selectAll: (id)sender
 {
   GDK_NOTE (EVENTS, g_message ("selectAll"));


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