[gtk-osx] Patch for listview find, bug 707945.



commit 2fbf3a3c0872a3eaf43cdb23693e23c8ebc6e900
Author: John Ralls <jralls ceridwen us>
Date:   Sat May 2 11:41:12 2015 -0700

    Patch for listview find, bug 707945.

 modulesets-stable/gtk-osx.modules                  |    2 +
 ...GTK2-Quartz-typeahead-find-in-GtkTreeView.patch |   69 ++++++++++++++++++++
 2 files changed, 71 insertions(+), 0 deletions(-)
---
diff --git a/modulesets-stable/gtk-osx.modules b/modulesets-stable/gtk-osx.modules
index a110977..2bb8d29 100644
--- a/modulesets-stable/gtk-osx.modules
+++ b/modulesets-stable/gtk-osx.modules
@@ -159,6 +159,7 @@
       <patch 
file="http://git.gnome.org/browse/gtk-osx/plain/patches/0008-Implement-GtkDragSourceOwner-pasteboardChangedOwner.patch";
 strip="1"/>
       <patch 
file="http://git.gnome.org/browse/gtk-osx/plain/patches/0006-Bug-658722-Drag-and-Drop-sometimes-stops-working.patch";
 strip="1"/>
 <patch file="http://git.gnome.org/browse/gtk-osx/plain/patches/gtk+-2-m4-creation.patch"; strip="1"/>
+      <patch 
file="http://git.gnome.org/browse/gtk-osx/plain/patches/0001-Bug-707945-GTK2-Quartz-typeahead-find-in-GtkTreeView.patch";
 strip="1"/>
    </branch>
     <dependencies>
       <dep package="glib"/>
@@ -177,6 +178,7 @@
     <branch module="gtk+/3.14/gtk+-3.14.5.tar.xz" version="3.14.5"
             hash="sha256:ba70f5ccde6646c6d8aa5a6398794b7bcf23fc45af22580a215d258f392dbbe2">
       <patch 
file="http://git.gnome.org/browse/gtk-osx/plain/patches/gtk+-Bug-739885-GtkPlug-is-conditionally-supported-on-X11-only.patch";
 strip="1"/>
+      <patch 
file="http://git.gnome.org/browse/gtk-osx/plain/patches/0001-Bug-707945-GTK2-Quartz-typeahead-find-in-GtkTreeView.patch";
 strip="1"/>
     </branch>
     <dependencies>
       <dep package="glib"/>
diff --git a/patches/0001-Bug-707945-GTK2-Quartz-typeahead-find-in-GtkTreeView.patch 
b/patches/0001-Bug-707945-GTK2-Quartz-typeahead-find-in-GtkTreeView.patch
new file mode 100644
index 0000000..c079f83
--- /dev/null
+++ b/patches/0001-Bug-707945-GTK2-Quartz-typeahead-find-in-GtkTreeView.patch
@@ -0,0 +1,69 @@
+From 8407a6268b69ebf127240f5ad4372cabedb6891a Mon Sep 17 00:00:00 2001
+From: John Ralls <jralls ceridwen us>
+Date: Sun, 28 Dec 2014 14:54:14 -0800
+Subject: [PATCH] Bug 707945 - GTK2/Quartz: 'typeahead find' in GtkTreeView no
+ longer
+
+accepts text input
+
+Get win from the event rather than from the IMContextQuartz's client window,
+because it's the event window that will eventually be called on to insert
+the text.
+---
+ modules/input/imquartz.c | 26 +++++++++++++++++---------
+ 1 file changed, 17 insertions(+), 9 deletions(-)
+
+diff --git a/modules/input/imquartz.c b/modules/input/imquartz.c
+index 67c7d6c..b72d05f 100644
+--- a/modules/input/imquartz.c
++++ b/modules/input/imquartz.c
+@@ -194,15 +194,6 @@ quartz_filter_keypress (GtkIMContext *context,
+   if (!qc->client_window)
+     return FALSE;
+ 
+-  nsview = gdk_quartz_window_get_nsview (qc->client_window);
+-  if (GDK_IS_WINDOW (nsview))
+-       /* it gets GDK_WINDOW in some cases */
+-    return gtk_im_context_filter_keypress (qc->slave, event);
+-  else
+-    win = (GdkWindow *)[ (GdkQuartzView *)nsview gdkWindow];
+-  GTK_NOTE (MISC, g_print ("client_window: %p, win: %p, nsview: %p\n",
+-                         qc->client_window, win, nsview));
+-
+   NSEvent *nsevent = gdk_quartz_event_get_nsevent ((GdkEvent *)event);
+ 
+   if (!nsevent)
+@@ -214,6 +205,22 @@ quartz_filter_keypress (GtkIMContext *context,
+         return gtk_im_context_filter_keypress (qc->slave, event);
+     }
+ 
++  nsview = gdk_quartz_window_get_nsview (qc->client_window);
++  if (GDK_IS_WINDOW (nsview))
++       /* it gets GDK_WINDOW in some cases */
++    return gtk_im_context_filter_keypress (qc->slave, event);
++  else
++    /* It's the window in the event, not the window that Gtk thinks
++     * has focus, that NSTextInputClient calls to insert the text, so
++     * we need to pass the right window to output_result in order to
++     * get it back.
++     */
++    win = (GdkWindow *)[(GdkQuartzView *)[[nsevent window] contentView] gdkWindow];
++
++  GTK_NOTE (MISC, g_print ("client_window: %p, win: %p, nsview: %p\n",
++                         qc->client_window, win, nsview));
++
++
+   if (event->type == GDK_KEY_RELEASE)
+     return FALSE;
+ 
+@@ -226,6 +233,7 @@ quartz_filter_keypress (GtkIMContext *context,
+        g_object_set_data (G_OBJECT (win), TIC_IN_KEY_DOWN,
+                                           GUINT_TO_POINTER (TRUE));
+        [nsview keyDown: nsevent];
++
+     }
+   /* JIS_Eisu || JIS_Kana */
+   if (event->hardware_keycode == 102 || event->hardware_keycode == 104)
+-- 
+1.8.3.rc0
+


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