[PATCH spice-gtk 17/25] Make-up a MonitorConfig if the server doesn't provide one

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

 



This allows easier compatibility for clients that don't have to
check and interact differently depending on channel capabilities.
---
 gtk/channel-display.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gtk/channel-display.c b/gtk/channel-display.c
index e6fd388..b701d1b 100644
--- a/gtk/channel-display.c
+++ b/gtk/channel-display.c
@@ -743,10 +743,21 @@ static int create_canvas(SpiceChannel *channel, display_surface *surface)
     g_return_val_if_fail(surface->canvas != NULL, 0);
     ring_add(&c->surfaces, &surface->link);
 
-    if (surface->primary)
+    if (surface->primary) {
         emit_main_context(channel, SPICE_DISPLAY_PRIMARY_CREATE,
                           surface->format, surface->width, surface->height,
                           surface->stride, surface->shmid, surface->data);
+
+        if (!spice_channel_test_capability(channel, SPICE_DISPLAY_CAP_MONITORS_CONFIG)) {
+            g_array_set_size(c->monitors, 1);
+            SpiceDisplayMonitorConfig *config = &g_array_index(c->monitors, SpiceDisplayMonitorConfig, 0);
+            config->x = config->y = 0;
+            config->width = surface->width;
+            config->height = surface->height;
+            g_object_notify_main_context(G_OBJECT(channel), "monitors");
+        }
+    }
+
     return 0;
 }
 
-- 
1.7.10.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]