diff options
author | Hans de Goede <hdegoede@redhat.com> | 2013-01-09 19:33:02 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2013-01-09 19:33:02 +0100 |
commit | baf7b6d8820d83e85603083b47e31cde08a39ac0 (patch) | |
tree | 77db8228cb41527f5bf1a099dd2db5d4e1d3eb5e /gtk | |
parent | 76cb968a0bd495fe7b5a4c17a3d11fbb3577b9eb (diff) |
Send monitor config to the agent on spice_main_set_display_enabled (#881072)
Currently we send an updated monitor-config to the agent whenever some
of the display settings are changed (whenever spice_main_set_display is
called), including when a new display is enabled, as that involves
creating a new window, which calls spice_main_set_display. The only
exception to this is when a display gets disabled.
This is rather inconistent, it causes the user to be able to move windows
in the guest to the now no longer visible monitor, and any windows which
were already there are hidden... until something else triggers us sending
updated monitor info. Withe gnome3 an alt-tab away and back again from a still
open display-window is enough to trigger the update, and then the guest will
all of a sudden become aware of the monitor no longer being there and
re-arrange windows accordingly, on an alt-tab in the client machine ...
not pretty.
So lets make things consistent and also send the agent updated monitor info
from spice_main_set_display_enabled, like we already do from
spice_main_set_display.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/channel-main.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/channel-main.c b/gtk/channel-main.c index 6b9ba8d..653b989 100644 --- a/gtk/channel-main.c +++ b/gtk/channel-main.c @@ -2245,4 +2245,9 @@ void spice_main_set_display_enabled(SpiceMainChannel *channel, int id, gboolean g_return_if_fail(id < G_N_ELEMENTS(c->display)); c->display[id].enabled = enabled; } + + if (c->timer_id) { + g_source_remove(c->timer_id); + } + c->timer_id = g_timeout_add_seconds(1, timer_set_display, channel); } |