Fix tiny windows for secondary displays in gtk2 build

When enabling a new display on linux guests, the new window would be tiny
(50x50) and zoomed way out. This was caused by the fact that when the display
widget received the 'map' event, it unconditionally cleared the 'dirty' flag,
which meant that it would only request 50x50 size. This behavior was intended to
fix a bug on the windows client which wprevented windows from resized smaller
than the guest display resolution. Unfortunately, due to the timing of the 'map'
and allocate events, the widget became very small.

Instead of clearing the 'dirty' flag directly when a widget is mapped, we
now queue a resize event, which will guarantee that the widget attains its
desired size and will then clear its dirty flag (allowing it to be resized).
Testing on windows indicates that this fix still solves the 'unshrinkable
window' problem while also preventing the tiny secondary display bug.

Resolves: rhbz#1104064
This commit is contained in:
Jonathon Jongsma 2014-06-10 11:31:25 -05:00
parent 8b8afec099
commit 6edde57862

View File

@ -454,7 +454,7 @@ virt_viewer_display_map(GtkWidget *widget)
{
GTK_WIDGET_CLASS(virt_viewer_display_parent_class)->map(widget);
virt_viewer_display_make_resizable(VIRT_VIEWER_DISPLAY(widget));
virt_viewer_display_queue_resize(VIRT_VIEWER_DISPLAY(widget));
}
#else