GNOME Bugzilla – Bug 640424
Key highlight doesn't match whole key
Last modified: 2011-01-26 23:29:22 UTC
When drawn, the highlight on the key is smaller than the whole key itself, so it looks bizarre and unfinished.
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.
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.
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.
Well, I think I fixed it in libgnomekbd. Please check
Oops, not entirely...
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).
Using gtk_widget_get_allocation provide necessary offsets. So this is the final and proper fix, I hope