[gnome-games] glines: don't always show the cursor
- From: Thomas Hindoe Paaboel Andersen <thomashpa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] glines: don't always show the cursor
- Date: Mon, 13 Jun 2011 13:47:28 +0000 (UTC)
commit 80fba8689e8e15c231a3a562283e61352a70c698
Author: Edward Sheldrake <ejsheldrake gmail com>
Date: Sat Jun 4 21:31:01 2011 +0100
glines: don't always show the cursor
A bug was introduced in the gtk3 port, resulting in the keyboard cursor
always being drawn on every click, and so after several moves there may be
several cursors displayed.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=651870
glines/glines.c | 26 ++++++++++++++------------
1 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/glines/glines.c b/glines/glines.c
index 6a87b35..21e6a56 100644
--- a/glines/glines.c
+++ b/glines/glines.c
@@ -889,18 +889,20 @@ field_draw_callback (GtkWidget * widget, cairo_t *cr)
}
/* Cursor */
- if (((backgnd.color.red + backgnd.color.green + backgnd.color.blue) / 3) >
- (G_MAXUINT16 / 2))
- gdk_color_parse ("#000000", &cursorColor);
- else
- gdk_color_parse ("#FFFFFF", &cursorColor);
-
- gdk_cairo_set_source_color (cr, &cursorColor);
- cairo_set_line_width (cr, 1.0);
- cairo_rectangle (cr,
- cursor_x * boxsize + 1.5, cursor_y * boxsize + 1.5,
- boxsize - 2.5, boxsize - 2.5);
- cairo_stroke (cr);
+ if (show_cursor) {
+ if (((backgnd.color.red + backgnd.color.green + backgnd.color.blue) / 3) >
+ (G_MAXUINT16 / 2))
+ gdk_color_parse ("#000000", &cursorColor);
+ else
+ gdk_color_parse ("#FFFFFF", &cursorColor);
+
+ gdk_cairo_set_source_color (cr, &cursorColor);
+ cairo_set_line_width (cr, 1.0);
+ cairo_rectangle (cr,
+ cursor_x * boxsize + 1.5, cursor_y * boxsize + 1.5,
+ boxsize - 2.5, boxsize - 2.5);
+ cairo_stroke (cr);
+ }
draw_grid (cr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]