summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2013-02-06 22:44:21 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2013-02-07 23:00:40 +0100
commitd35f58249742caf1ace0fff5bde770871fbbd676 (patch)
treed7ec112ef978135b09fca9e45141f26717eae88d
parent98ecf9e9064ba2a6318165b43fc693a06d0a1b3e (diff)
display: keep monitor config updated if resize-guest is disabled
https://bugzilla.redhat.com/show_bug.cgi?id=908057
-rw-r--r--gtk/spice-widget.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 4f2f6c4..42d0cdd 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -265,6 +265,19 @@ static void set_monitor_ready(SpiceDisplay *self, gboolean ready)
update_ready(self);
}
+static gint get_display_id(SpiceDisplay *display)
+{
+ SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display);
+
+ /* supported monitor_id only with display channel #0 */
+ if (d->channel_id == 0 && d->monitor_id >= 0)
+ return d->monitor_id;
+
+ g_return_val_if_fail(d->monitor_id <= 0, -1);
+
+ return d->channel_id;
+}
+
static void update_monitor_area(SpiceDisplay *display)
{
SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display);
@@ -300,6 +313,10 @@ static void update_monitor_area(SpiceDisplay *display)
goto whole;
}
+ if (!d->resize_guest_enable)
+ spice_main_set_display(d->main, get_display_id(display),
+ c->x, c->y, c->width, c->height);
+
update_area(display, c->x, c->y, c->width, c->height);
g_clear_pointer(&monitors, g_array_unref);
return;
@@ -992,19 +1009,6 @@ static void update_mouse_grab(SpiceDisplay *display)
try_mouse_ungrab(display);
}
-static gint get_display_id(SpiceDisplay *display)
-{
- SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display);
-
- /* supported monitor_id only with display channel #0 */
- if (d->channel_id == 0 && d->monitor_id >= 0)
- return d->monitor_id;
-
- g_return_val_if_fail(d->monitor_id <= 0, -1);
-
- return d->channel_id;
-}
-
static void recalc_geometry(GtkWidget *widget)
{
SpiceDisplay *display = SPICE_DISPLAY(widget);