# HG changeset patch # User Christian Brabandt # Date 1457783104 -3600 # Node ID 8877ea0a27ec80527957c6ec340af671a10d5d45 # Parent 06ad7c12876f43c0e5a524030eb3a27cd635a68e commit https://github.com/vim/vim/commit/4fc563b397949ce23190045112fa08c0776a56e6 Author: Bram Moolenaar Date: Sat Mar 12 12:40:58 2016 +0100 patch 7.4.1538 Problem: Selection with the mouse does not work in command line mode. Solution: Use cairo functions. (Kazunobu Kuriyama) diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -636,7 +636,10 @@ gui_gtk3_update_cursor(cairo_t *cr) if (gui.row == gui.cursor_row) { gui.by_signal = TRUE; - gui_update_cursor(TRUE, TRUE); + if (State & CMDLINE) + gui_update_cursor(TRUE, FALSE); + else + gui_update_cursor(TRUE, TRUE); gui.by_signal = FALSE; cairo_paint(cr); } @@ -6310,8 +6313,25 @@ gui_mch_flash(int msec) gui_mch_invert_rectangle(int r, int c, int nr, int nc) { #if GTK_CHECK_VERSION(3,0,0) - /* TODO Replace GdkGC with Cairo */ - (void)r; (void)c; (void)nr; (void)nc; + const GdkRectangle rect = { + FILL_X(c), FILL_Y(r), nc * gui.char_width, nr * gui.char_height + }; + cairo_t * const cr = cairo_create(gui.surface); + + set_cairo_source_rgb_from_pixel(cr, gui.norm_pixel ^ gui.back_pixel); +# if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,9,2) + cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE); +# else + /* Give an implementation for older cairo versions if necessary. */ +# endif + gdk_cairo_rectangle(cr, &rect); + cairo_fill(cr); + + cairo_destroy(cr); + + if (!gui.by_signal) + gtk_widget_queue_draw_area(gui.drawarea, rect.x, rect.y, + rect.width, rect.height); #else GdkGCValues values; GdkGC *invert_gc; diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -744,6 +744,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1538, +/**/ 1537, /**/ 1536,