Fix virt-manager default screen resolution and resolution across reboots

Resolves: 1240721
This commit is contained in:
Cole Robinson 2015-09-12 12:22:43 -04:00
parent be27d29e9f
commit 79b272058d
2 changed files with 75 additions and 1 deletions

View File

@ -0,0 +1,66 @@
From 93792a366e8c3020fe735d1080aa2ce58a2d03fa Mon Sep 17 00:00:00 2001
Message-Id: <93792a366e8c3020fe735d1080aa2ce58a2d03fa.1442072848.git.crobinso@redhat.com>
In-Reply-To: <e56c03deda6df3aaddcc778bd6cf1bd724e3172b.1442072848.git.crobinso@redhat.com>
References: <e56c03deda6df3aaddcc778bd6cf1bd724e3172b.1442072848.git.crobinso@redhat.com>
From: Pavel Grunt <pgrunt@redhat.com>
Date: Fri, 10 Jul 2015 10:37:27 +0200
Subject: [PATCH 2/2] Send monitor config if at least one monitor has
dimensions
If a client (virt-manager, spicy) is not setting display dimensions
and the "resize-guest" property is disabled, spice-gtk sends a wrong
monitor config message where all the monitors have width = heigh = 0
when the agent connects. This message can confuse the guest, in that
case the guest will change the resolution of its monitor.
Regression since 28312b8d1e287a320851e8828825f2ca138d8b0b
Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1240721
(cherry picked from commit 4b5e6ec2114e1250c81027ebeac9cfe8d059153f)
---
src/channel-main.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/channel-main.c b/src/channel-main.c
index fbf7677..8a61379 100644
--- a/src/channel-main.c
+++ b/src/channel-main.c
@@ -1411,6 +1411,22 @@ static void agent_clipboard_release(SpiceMainChannel *channel, guint selection)
agent_msg_queue(channel, VD_AGENT_CLIPBOARD_RELEASE, msgsize, msg);
}
+static gboolean any_display_has_dimensions(SpiceMainChannel *channel)
+{
+ SpiceMainChannelPrivate *c;
+ guint i;
+
+ g_return_if_fail(SPICE_IS_MAIN_CHANNEL(channel));
+ c = channel->priv;
+
+ for (i = 0; i < MAX_DISPLAY; i++) {
+ if (c->display[i].width > 0 && c->display[i].height > 0)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
/* main context*/
static gboolean timer_set_display(gpointer data)
{
@@ -1423,6 +1439,11 @@ static gboolean timer_set_display(gpointer data)
if (!c->agent_connected)
return FALSE;
+ if (!any_display_has_dimensions(channel)) {
+ SPICE_DEBUG("Not sending monitors config, at least one monitor must have dimensions");
+ return FALSE;
+ }
+
session = spice_channel_get_session(SPICE_CHANNEL(channel));
/* ensure we have an explicit monitor configuration at least for
--
2.5.0

View File

@ -2,7 +2,7 @@
Name: spice-gtk
Version: 0.29
Release: 3%{?dist}
Release: 4%{?dist}
Summary: A GTK+ widget for SPICE clients
Group: System Environment/Libraries
@ -11,6 +11,9 @@ URL: http://spice-space.org/page/Spice-Gtk
#VCS: git:git://anongit.freedesktop.org/spice/spice-gtk
Source0: http://www.spice-space.org/download/gtk/%{name}-%{version}%{?_version_suffix}.tar.bz2
Patch1: 0001-audio-Do-not-volume-sync-without-audio.patch
# Fix virt-manager default screen resolution and resolution across reboots
# Resolves: 1240721
Patch2: 0002-Send-monitor-config-if-at-least-one-monitor-has-dime.patch
BuildRequires: intltool
BuildRequires: gtk2-devel >= 2.14
@ -136,6 +139,7 @@ fi
pushd spice-gtk-%{version}
%patch1 -p1
%patch2 -p1
find . -name '*.stamp' | xargs touch
popd
@ -254,6 +258,10 @@ rm -rf %{buildroot}%{_datadir}/pkgconfig/spice-protocol.pc
%{_bindir}/spicy-stats
%changelog
* Sat Sep 12 2015 Cole Robinson <crobinso@redhat.com> 0.29-4
- Fix virt-manager default screen resolution and resolution across reboots
- Resolves: rhbz#1240721
* Tue Sep 08 2015 Christophe Fergeau <cfergeau@redhat.com> 0.29-3
- Don't crash on volume sync when there is no audio channel
Resolves: rhbz#1257210