Ticket #4165: 0001-Set-both-text-handles-below-text-baseline.patch

File 0001-Set-both-text-handles-below-text-baseline.patch, 1.5 KB (added by garnacho, 11 years ago)

GTK+ patch

  • gtk/gtktexthandle.c

    From 629c8a7744d32f60ed203e26c45b5207d7a86a24 Mon Sep 17 00:00:00 2001
    From: Carlos Garnacho <carlos@lanedo.com>
    Date: Thu, 22 Nov 2012 14:51:56 +0100
    Subject: [PATCH] Set both text handles below text baseline
    
    ---
     gtk/gtktexthandle.c | 15 ++-------------
     1 file changed, 2 insertions(+), 13 deletions(-)
    
    diff --git a/gtk/gtktexthandle.c b/gtk/gtktexthandle.c
    index 426fa3a..161770b 100644
    a b gtk_text_handle_widget_event (GtkWidget *widget, 
    270270
    271271      x = event->motion.x_root - priv->windows[pos].dx + (width / 2) - x;
    272272      y = event->motion.y_root - priv->windows[pos].dy - y;
    273 
    274       if (pos == GTK_TEXT_HANDLE_POSITION_SELECTION_START)
    275         y += height;
    276 
    277273      g_signal_emit (handle, signals[HANDLE_DRAGGED], 0, pos, x, y);
    278274    }
    279275
    _gtk_text_handle_update_window_state (GtkTextHandle *handle, 
    298294    {
    299295      gint x, y, width, height;
    300296
    301       x = handle_window->pointing_to.x;
    302       y = handle_window->pointing_to.y;
    303297      _gtk_text_handle_get_size (handle, &width, &height);
    304 
    305       if (pos == GTK_TEXT_HANDLE_POSITION_CURSOR)
    306         y += handle_window->pointing_to.height;
    307       else
    308         y -= height;
    309 
    310       x -= width / 2;
     298      x = handle_window->pointing_to.x - (width / 2);
     299      y = handle_window->pointing_to.y + handle_window->pointing_to.height;
    311300
    312301      gdk_window_move_resize (handle_window->window, x, y, width, height);
    313302      gdk_window_show (handle_window->window);