[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[virt-tools-list] [PATCH 2/2] Set Spice display to fullscreen if owning window is pending fullscreen



When you call virt_viewer_window_enter_fullscreen() on a hidden window, it
doesn't actually change its fullscreen state.  Instead, it sets up a map-event
handler to enter fullscreen after it is shown. When _set_display() is called on
a window that is pending fullscreen status, it initially sets the fullscreen
state of the display to FALSE, which can cause an unwanted resize to be sent
down to the guest.
---
 src/virt-viewer-window.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index 0f62feb..7108aa0 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -96,6 +96,7 @@ struct _VirtViewerWindowPrivate {
     GSList *accel_list;
     gboolean enable_mnemonics_save;
     gboolean grabbed;
+    gboolean fullscreen_pending;
     gint fullscreen_monitor;
     gboolean desktop_resize_pending;
     gboolean kiosk;
@@ -294,6 +295,7 @@ virt_viewer_window_init (VirtViewerWindow *self)
     self->priv = GET_PRIVATE(self);
     priv = self->priv;
 
+    priv->fullscreen_pending = FALSE;
     priv->fullscreen_monitor = -1;
     priv->auto_resize = TRUE;
     g_value_init(&priv->accel_setting, G_TYPE_STRING);
@@ -533,11 +535,13 @@ virt_viewer_window_enter_fullscreen(VirtViewerWindow *self, gint monitor)
     priv->fullscreen_monitor = monitor;
 
     if (!gtk_widget_get_mapped(priv->window)) {
+        priv->fullscreen_pending = TRUE;
         g_signal_connect(priv->window, "map-event", G_CALLBACK(mapped), self);
         return;
     }
 
     priv->fullscreen = TRUE;
+    priv->fullscreen_pending = FALSE;
 
     gtk_check_menu_item_set_active(check, TRUE);
     gtk_widget_hide(menu);
@@ -1232,7 +1236,7 @@ virt_viewer_window_set_display(VirtViewerWindow *self, VirtViewerDisplay *displa
         virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel);
         virt_viewer_display_set_auto_resize(VIRT_VIEWER_DISPLAY(priv->display), priv->auto_resize);
         virt_viewer_display_set_monitor(VIRT_VIEWER_DISPLAY(priv->display), priv->fullscreen_monitor);
-        virt_viewer_display_set_fullscreen(VIRT_VIEWER_DISPLAY(priv->display), priv->fullscreen);
+        virt_viewer_display_set_fullscreen(VIRT_VIEWER_DISPLAY(priv->display), priv->fullscreen_pending || priv->fullscreen);
 
         gtk_widget_show_all(GTK_WIDGET(display));
         gtk_notebook_append_page(GTK_NOTEBOOK(priv->notebook), GTK_WIDGET(display), NULL);
-- 
1.8.3.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]