After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 640424 - Key highlight doesn't match whole key
Key highlight doesn't match whole key
Status: RESOLVED FIXED
Product: libgnomekbd
Classification: Core
Component: Drawing
2.91.x
Other Linux
: Normal normal
: ---
Assigned To: libgnomekbd maintainers
Sergey V. Udaltsov
Depends on:
Blocks:
 
 
Reported: 2011-01-24 14:33 UTC by Bastien Nocera
Modified: 2011-01-26 23:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Demo the problem of the region invalidation (1.20 KB, patch)
2011-01-25 00:00 UTC, Sergey V. Udaltsov
none Details | Review

Description Bastien Nocera 2011-01-24 14:33:25 UTC
When drawn, the highlight on the key is smaller than the whole key itself, so it looks bizarre and unfinished.
Comment 1 Sergey V. Udaltsov 2011-01-24 23:55:10 UTC
To me it looks like a bug in gtk/gdk drawing (or I misunderstand something). The gtk_widget_queue_draw_area works incorrectly - it only invalidate a part of the rectangle.
Comment 2 Sergey V. Udaltsov 2011-01-25 00:00:48 UTC
Created attachment 179255 [details] [review]
Demo the problem of the region invalidation

This patch demonstrates the issue with the rect invalidation.

When the key is pressed, the entire invalidated rect is expected to become black (the area of the pressed key +6pixels around it). But effectively some part (bottom and right) of the rect are not repainted! That is easy to see if you drag the whole dialog (after pressing some key) - it repaints entirely, and you see full proper black rect.
Comment 3 Matthias Clasen 2011-01-25 02:05:13 UTC
Most likely coordinate system confusion somewhere.
The cairo_t you get handed in ::draw is pre-transformed to have the widget origin at 0, 0.
Comment 4 Sergey V. Udaltsov 2011-01-25 23:26:39 UTC
Well, I think I fixed it in libgnomekbd. Please check
Comment 5 Sergey V. Udaltsov 2011-01-25 23:40:17 UTC
Oops, not entirely...
Comment 6 Sergey V. Udaltsov 2011-01-25 23:49:29 UTC
Still, there is a problem/regression with gtk. For some reason the function gtk_widget_queue_draw_area is using not the widget coordinates but the parent coordinates. Replacing it with gtk_widget_queue_draw, for now (to invalidate entire widget).
Comment 7 Sergey V. Udaltsov 2011-01-26 23:29:22 UTC
Using gtk_widget_get_allocation provide necessary offsets. So this is the final and proper fix, I hope