[gnome-boxes] Make the VM thumbnail in the properties view insensitive
- From: Marc-Andre Lureau <malureau src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] Make the VM thumbnail in the properties view insensitive
- Date: Fri, 2 Dec 2011 10:12:27 +0000 (UTC)
commit 70adec04f0e78c01bb3413cd3af0555546b60364
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date: Fri Nov 25 02:55:40 2011 +0100
Make the VM thumbnail in the properties view insensitive
We need a newer spice-gtk from git
https://bugzilla.gnome.org/show_bug.cgi?id=664215
configure.ac | 2 +-
src/display.vala | 1 +
src/machine.vala | 3 ++-
src/spice-display.vala | 4 ++++
src/vnc-display.vala | 5 ++++-
5 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c76a963..bd70d5e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,7 +52,7 @@ GTK_VNC_MIN_VERSION=0.4.4
LIBVIRT_GLIB_MIN_VERSION=0.0.3
LIBVIRT_GCONFIG_MIN_VERSION=0.0.1
LIBXML2_MIN_VERSION=2.7.8
-SPICE_GTK_MIN_VERSION=0.7.81
+SPICE_GTK_MIN_VERSION=0.7.98
GUDEV_MIN_VERSION=167
OSINFO_MIN_VERSION=0.0.3
diff --git a/src/display.vala b/src/display.vala
index a8ed177..ea50d0f 100644
--- a/src/display.vala
+++ b/src/display.vala
@@ -21,6 +21,7 @@ private abstract class Boxes.Display: GLib.Object, Boxes.IProperties {
public abstract Gtk.Widget get_display (int n) throws Boxes.Error;
public abstract Gdk.Pixbuf? get_pixbuf (int n) throws Boxes.Error;
+ public abstract void set_enable_inputs (Gtk.Widget widget, bool enable);
public abstract void connect_it ();
public abstract void disconnect_it ();
diff --git a/src/machine.vala b/src/machine.vala
index 8c0b7f6..10b353c 100644
--- a/src/machine.vala
+++ b/src/machine.vala
@@ -369,6 +369,7 @@ private class Boxes.MachineActor: Boxes.UI {
display.contents = null;
display = null;
// FIXME: enable grabs
+ machine.display.set_enable_inputs (widget, true);
machine.app.display_page.show_display (machine, widget);
});
} else
@@ -386,7 +387,7 @@ private class Boxes.MachineActor: Boxes.UI {
case UIState.PROPERTIES:
var widget = machine.app.display_page.remove_display ();
- // FIXME: disable grabs
+ machine.display.set_enable_inputs (widget, false);
display = new GtkClutter.Actor.with_contents (widget);
display.x = 0.0f;
display.y = 0.0f;
diff --git a/src/spice-display.vala b/src/spice-display.vala
index 97cbc59..c3a7bd7 100644
--- a/src/spice-display.vala
+++ b/src/spice-display.vala
@@ -66,6 +66,10 @@ private class Boxes.SpiceDisplay: Boxes.Display, Boxes.IProperties {
return display;
}
+ public override void set_enable_inputs (Gtk.Widget widget, bool enable) {
+ (widget as Spice.Display).disable_inputs = !enable;
+ }
+
public override Gdk.Pixbuf? get_pixbuf (int n) throws Boxes.Error {
return (get_display (n) as Spice.Display).get_pixbuf ();
}
diff --git a/src/vnc-display.vala b/src/vnc-display.vala
index f5d0f0c..688e0ed 100644
--- a/src/vnc-display.vala
+++ b/src/vnc-display.vala
@@ -5,7 +5,6 @@ using Vnc;
private class Boxes.VncDisplay: Boxes.Display {
public override string protocol { get { return "VNC"; } }
public override string uri { owned get { return @"vnc://$host:$port"; } }
-
private Vnc.Display display;
private string host;
private int port;
@@ -102,6 +101,10 @@ private class Boxes.VncDisplay: Boxes.Display {
return display;
}
+ public override void set_enable_inputs (Gtk.Widget widget, bool enable) {
+ (widget as Vnc.Display).read_only = !enable;
+ }
+
public override Gdk.Pixbuf? get_pixbuf (int n) throws Boxes.Error {
return display.get_pixbuf ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]