Skip to content

Commit 4fc563b

Browse files
committed
patch 7.4.1538
Problem: Selection with the mouse does not work in command line mode. Solution: Use cairo functions. (Kazunobu Kuriyama)
1 parent 509ce2a commit 4fc563b

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

src/gui_gtk_x11.c

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,10 @@ gui_gtk3_update_cursor(cairo_t *cr)
636636
if (gui.row == gui.cursor_row)
637637
{
638638
gui.by_signal = TRUE;
639-
gui_update_cursor(TRUE, TRUE);
639+
if (State & CMDLINE)
640+
gui_update_cursor(TRUE, FALSE);
641+
else
642+
gui_update_cursor(TRUE, TRUE);
640643
gui.by_signal = FALSE;
641644
cairo_paint(cr);
642645
}
@@ -6310,8 +6313,25 @@ gui_mch_flash(int msec)
63106313
gui_mch_invert_rectangle(int r, int c, int nr, int nc)
63116314
{
63126315
#if GTK_CHECK_VERSION(3,0,0)
6313-
/* TODO Replace GdkGC with Cairo */
6314-
(void)r; (void)c; (void)nr; (void)nc;
6316+
const GdkRectangle rect = {
6317+
FILL_X(c), FILL_Y(r), nc * gui.char_width, nr * gui.char_height
6318+
};
6319+
cairo_t * const cr = cairo_create(gui.surface);
6320+
6321+
set_cairo_source_rgb_from_pixel(cr, gui.norm_pixel ^ gui.back_pixel);
6322+
# if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,9,2)
6323+
cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
6324+
# else
6325+
/* Give an implementation for older cairo versions if necessary. */
6326+
# endif
6327+
gdk_cairo_rectangle(cr, &rect);
6328+
cairo_fill(cr);
6329+
6330+
cairo_destroy(cr);
6331+
6332+
if (!gui.by_signal)
6333+
gtk_widget_queue_draw_area(gui.drawarea, rect.x, rect.y,
6334+
rect.width, rect.height);
63156335
#else
63166336
GdkGCValues values;
63176337
GdkGC *invert_gc;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,8 @@ static char *(features[]) =
743743

744744
static int included_patches[] =
745745
{ /* Add new patch number below this line */
746+
/**/
747+
1538,
746748
/**/
747749
1537,
748750
/**/

0 commit comments

Comments
 (0)