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 692465 - ungrab label overdraws title label
ungrab label overdraws title label
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks: 686781
 
 
Reported: 2013-01-24 19:08 UTC by Alexander Larsson
Modified: 2016-03-31 13:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix the ungrab label sometimes rendering wrong (1.48 KB, patch)
2013-02-21 10:47 UTC, Alexander Larsson
committed Details | Review

Description Alexander Larsson 2013-01-24 19:08:36 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.
Comment 1 Alexander Larsson 2013-02-21 10:30:28 UTC
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.
Comment 2 Alexander Larsson 2013-02-21 10:47:47 UTC
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.
Comment 3 Zeeshan Ali 2013-02-26 13:43:42 UTC
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.
Comment 4 Alexander Larsson 2013-02-26 14:34:03 UTC
Attachment 237025 [details] pushed as f1f5360 - Fix the ungrab label sometimes rendering wrong