GNOME Bugzilla – Bug 692465
ungrab label overdraws title label
Last modified: 2016-03-31 13:57:59 UTC
When you click on a VM that gets you a grabbed mouse, like for instance a powered off one that starts in the bios, you get a "press ctrl-alt to ungrab" label. However, it overlaps the VM title. If you ungrab and regrab things get right again however.
This is a tricky one. During size_allocate() on the spice widget the GtkDrawingArea sends a configure event, which is caught by spice-widget.c:configure_event(). This then tries to get a mouse grab via try_mouse_grab(). If this succeeds we'll send a SPICE_DISPLAY_MOUSE_GRAB signal which eventually will reach the boxes code that adds the label about unbreaking. The label change causes a queue_resize on the label widgets and up the widget tree to the toplevel, but this is ignored/overridden by gtk+ since you're not allowed to request size changes during size allocation (that leads to loops). So, the labels are not correctly relayouted.
Created attachment 237025 [details] [review] Fix the ungrab label sometimes rendering wrong The Spice widget is sometimes sending mouse grab changed signals while inside gtk_widget_size_allocate() which means any size alllocation changes we request are ignored. This caused the label rendering issue. We work around this by delaying the change to an idle.
Review of attachment 237025 [details] [review]: Would be nice to explain in the commit log what you mean by "the label rendering issue.". ACK in any case.
Attachment 237025 [details] pushed as f1f5360 - Fix the ungrab label sometimes rendering wrong