summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-03-12 12:40:58 +0100
committerBram Moolenaar <Bram@vim.org>2016-03-12 12:40:58 +0100
commit4fc563b397949ce23190045112fa08c0776a56e6 (patch)
treece65b1c904c201d9b6b023708bc28005f4660b0d
parent509ce2a558e7e0c03242e32e844255af52f1c821 (diff)
downloadvim-git-4fc563b397949ce23190045112fa08c0776a56e6.tar.gz
patch 7.4.1538v7.4.1538
Problem: Selection with the mouse does not work in command line mode. Solution: Use cairo functions. (Kazunobu Kuriyama)
-rw-r--r--src/gui_gtk_x11.c26
-rw-r--r--src/version.c2
2 files changed, 25 insertions, 3 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 359bf64fe..54723f7d0 100644
--- 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
index c290b5040..02d177f74 100644
--- 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,