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 695493 - testgtk: issues with the color selection example
testgtk: issues with the color selection example
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-03-09 15:46 UTC by Matthias Clasen
Modified: 2013-08-09 17:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Demo of a workaround for the double click bug (1.16 KB, patch)
2013-04-24 12:29 UTC, Chris Cummins
none Details | Review
Invalidate swatch style context on activate (1.12 KB, patch)
2013-04-24 17:41 UTC, Chris Cummins
none Details | Review

Description Matthias Clasen 2013-03-09 15:46:19 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
Comment 1 Matthias Clasen 2013-03-12 15:31:50 UTC
test
Comment 2 Thomas Wood 2013-03-22 16:18:45 UTC
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.
Comment 3 Matthias Clasen 2013-03-23 02:11:43 UTC
yes, the double click is the remaining trouble
Comment 4 Chris Cummins 2013-04-24 12:24:46 UTC
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.
Comment 5 Chris Cummins 2013-04-24 12:29:16 UTC
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.
Comment 6 Chris Cummins 2013-04-24 17:41:10 UTC
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.
Comment 7 Rob Bradford 2013-04-25 14:46:27 UTC
Benjamin, do you think you could look at this (possibly) CSS related bug?
Comment 8 Rob Bradford 2013-08-09 17:03:57 UTC
I can't reproduce this issue any longer with c51a26e5622f4.