Mercurial > vim
comparison src/gui_gtk_x11.c @ 30237:722cd5d0f92a v9.0.0454
patch 9.0.0454: incorrect color for modeless selection with GTK
Commit: https://github.com/vim/vim/commit/810cb5a3bf73ff4b084f483aa87cd49c1111bfa9
Author: Your Name <you@example.com>
Date: Tue Sep 13 11:25:54 2022 +0100
patch 9.0.0454: incorrect color for modeless selection with GTK
Problem: Incorrect color for modeless selection with GTK.
Solution: Use simple inversion instead of XOR. (closes https://github.com/vim/vim/issues/11111)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 13 Sep 2022 12:30:05 +0200 |
parents | 9fed09b3ca05 |
children | 029c59bf78f1 |
comparison
equal
deleted
inserted
replaced
30236:43ac83cc45ab | 30237:722cd5d0f92a |
---|---|
6259 const GdkRectangle rect = { | 6259 const GdkRectangle rect = { |
6260 FILL_X(c), FILL_Y(r), nc * gui.char_width, nr * gui.char_height | 6260 FILL_X(c), FILL_Y(r), nc * gui.char_width, nr * gui.char_height |
6261 }; | 6261 }; |
6262 cairo_t * const cr = cairo_create(gui.surface); | 6262 cairo_t * const cr = cairo_create(gui.surface); |
6263 | 6263 |
6264 set_cairo_source_rgba_from_color(cr, gui.norm_pixel ^ gui.back_pixel); | 6264 cairo_set_source_rgba(cr, 1.0, 1.0, 1.0, 1.0); |
6265 # if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,9,2) | 6265 # if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,9,2) |
6266 cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE); | 6266 cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE); |
6267 # else | 6267 # else |
6268 // Give an implementation for older cairo versions if necessary. | 6268 // Give an implementation for older cairo versions if necessary. |
6269 # endif | 6269 # endif |
6279 GdkGC *invert_gc; | 6279 GdkGC *invert_gc; |
6280 | 6280 |
6281 if (gui.drawarea->window == NULL) | 6281 if (gui.drawarea->window == NULL) |
6282 return; | 6282 return; |
6283 | 6283 |
6284 values.foreground.pixel = gui.norm_pixel ^ gui.back_pixel; | 6284 values.function = GDK_INVERT; |
6285 values.background.pixel = gui.norm_pixel ^ gui.back_pixel; | |
6286 values.function = GDK_XOR; | |
6287 invert_gc = gdk_gc_new_with_values(gui.drawarea->window, | 6285 invert_gc = gdk_gc_new_with_values(gui.drawarea->window, |
6288 &values, | 6286 &values, |
6289 GDK_GC_FOREGROUND | | |
6290 GDK_GC_BACKGROUND | | |
6291 GDK_GC_FUNCTION); | 6287 GDK_GC_FUNCTION); |
6292 gdk_gc_set_exposures(invert_gc, gui.visibility != | 6288 gdk_gc_set_exposures(invert_gc, gui.visibility != |
6293 GDK_VISIBILITY_UNOBSCURED); | 6289 GDK_VISIBILITY_UNOBSCURED); |
6294 gdk_draw_rectangle(gui.drawarea->window, invert_gc, | 6290 gdk_draw_rectangle(gui.drawarea->window, invert_gc, |
6295 TRUE, | 6291 TRUE, |