Ticket #4203: 0001-Ensure-the-insertion-handle-stays-on-fake-events-eg-.patch

File 0001-Ensure-the-insertion-handle-stays-on-fake-events-eg-.patch, 2.0 KB (added by garnacho, 8 years ago)

GTK+ patch to fix the issue

  • gtk/gtkentry.c

    From 7c67e3d2e111633c8ea020475672d678186ffdff Mon Sep 17 00:00:00 2001
    From: Carlos Garnacho <carlos@lanedo.com>
    Date: Wed, 21 Nov 2012 16:49:37 +0100
    Subject: [PATCH] Ensure the insertion handle stays on fake events (eg from
     IM)
    
    Don't set handles mode to none if the event has send_event set.
    For consistency with GtkEntry, also make GtkTextView keep the
    handle mode on buffer changes.
    ---
     gtk/gtkentry.c    |  6 ++++--
     gtk/gtktextview.c | 10 +++++++---
     2 files changed, 11 insertions(+), 5 deletions(-)
    
    diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
    index 0c637de..35e4afc 100644
    a b gtk_entry_key_press (GtkWidget *widget, 
    44974497
    44984498  gtk_entry_reset_blink_time (entry);
    44994499  gtk_entry_pend_cursor_blink (entry);
    4500   _gtk_text_handle_set_mode (priv->text_handle,
    4501                              GTK_TEXT_HANDLE_MODE_NONE);
     4500
     4501  if (!event->send_event)
     4502    _gtk_text_handle_set_mode (priv->text_handle,
     4503                               GTK_TEXT_HANDLE_MODE_NONE);
    45024504
    45034505  if (priv->editable)
    45044506    {
  • gtk/gtktextview.c

    diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
    index a63da6f..864c2d2 100644
    a b gtk_text_view_key_press_event (GtkWidget *widget, GdkEventKey *event) 
    47504750  gtk_text_view_reset_blink_time (text_view);
    47514751  gtk_text_view_pend_cursor_blink (text_view);
    47524752
    4753   _gtk_text_handle_set_mode (priv->text_handle,
    4754                              GTK_TEXT_HANDLE_MODE_NONE);
     4753  if (!event->send_event)
     4754    _gtk_text_handle_set_mode (priv->text_handle,
     4755                               GTK_TEXT_HANDLE_MODE_NONE);
    47554756
    47564757  return retval;
    47574758}
    gtk_text_view_buffer_changed_handler (GtkTextBuffer *buffer, 
    63516352                                      gpointer       data)
    63526353{
    63536354  GtkTextView *text_view = data;
    6354   gtk_text_view_update_handles (text_view, GTK_TEXT_HANDLE_MODE_NONE);
     6355  GtkTextViewPrivate *priv = text_view->priv;
     6356
     6357  gtk_text_view_update_handles (text_view,
     6358                                _gtk_text_handle_get_mode (priv->text_handle));
    63556359}
    63566360
    63576361static void