GNOME Bugzilla – Bug 695493
testgtk: issues with the color selection example
Last modified: 2013-08-09 17:03:57 UTC
A number of problems: - A critical that doesn't happen with other backends (this was with the csd branch, maybe related) (lt-testgtk:30730): Gtk-CRITICAL **: gtk_box_reorder_child: assertion `GTK_IS_WIDGET (child)' failed - Clicking on the colors does not change the selection, like it does under X - Sometimes, after closing the chooser, the window with the color button becomes unresponsive - Sometimes, I can reopen the color chooser, but just get a gray rectangle
test
The critical assertion doesn't occur for me, so this may already have been fixed. I have noticed the colour button becoming unresponsive only after double clicking a colour to select it. Using the "Select" button to confirm the change seems to work fine. I can't see any other change in behaviour from running with the X backend.
yes, the double click is the remaining trouble
I spent some time looking at this, but I haven't been able to find a solution. The problem seems to be with caching of CSS properties. Executing testgtk with "--gtk-debug=no-css-cache" prevents the double click problem, as does manually invalidating the style context when picking a color (I'll attach a patch to demo that). To clarify, double clicking on a color swatch to select it causes the color chooser dialog to disappear as normal, but then pressing the color button again causes the color chooser dialog to appear invisibly; you can still blindly interact with it as if it were visible - double clicking on a new swatch selects it, and double clicking on the title area causes it to reappear full screen as per normal.
Created attachment 242319 [details] [review] Demo of a workaround for the double click bug By rebuilding the color chooser dialog's style context information after selecting a color, double clicking behaves as expected.
Created attachment 242349 [details] [review] Invalidate swatch style context on activate This provides a similar workaround to the previous patch (id=242319), but the style context is only invalidated when a swatch is activated. This should help in isolating the cause of the problem - swatch_activate() is only called on double click, not on the 'Select' button - and reduces the overhead spent on unnecessary cache rebuilding.
Benjamin, do you think you could look at this (possibly) CSS related bug?
I can't reproduce this issue any longer with c51a26e5622f4.