summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2012-06-21 00:38:56 +0300
committerAlon Levy <alevy@redhat.com>2012-06-24 09:44:37 +0300
commit5906fa15bb68c4fd6253b49cea51a3b92f89c6d6 (patch)
tree17c90f555153364aa12ce79a42d182d82b881738
parent7210d3d76a333eb8d142f194f7fdcd8b38f178ed (diff)
vdagent-x11-randr: add dump_monitors_config
-rw-r--r--src/vdagent-x11-randr.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/vdagent-x11-randr.c b/src/vdagent-x11-randr.c
index 31aa141..61b5418 100644
--- a/src/vdagent-x11-randr.c
+++ b/src/vdagent-x11-randr.c
@@ -597,6 +597,22 @@ int same_monitor_configs(struct vdagent_x11 *x11, VDAgentMonitorsConfig *mon)
return 1;
}
+static void dump_monitors_config(struct vdagent_x11 *x11,
+ VDAgentMonitorsConfig *mon_config,
+ const char *prefix)
+{
+ int i;
+ VDAgentMonConfig *m;
+
+ fprintf(x11->errfile, "%s: %d, %x\n", prefix, mon_config->num_of_monitors,
+ mon_config->flags);
+ for (i = 0 ; i < mon_config->num_of_monitors; ++i) {
+ m = &mon_config->monitors[i];
+ fprintf(x11->errfile, "received monitor %d config %dx%d+%d+%d\n", i,
+ m->width, m->height, m->x, m->y);
+ }
+}
+
/*
* Set monitor configuration according to client request.
*
@@ -629,9 +645,17 @@ void vdagent_x11_set_monitor_config(struct vdagent_x11 *x11,
goto exit;
}
+ if (x11->verbose) {
+ dump_monitors_config(x11, mon_config, "from guest");
+ }
+
zero_base_monitors(x11, mon_config, &primary_w, &primary_h);
constrain_to_screen(x11, &primary_w, &primary_h);
+
+ if (x11->verbose) {
+ dump_monitors_config(x11, mon_config, "after zeroing");
+ }
/*
* Set screen size once now. If the screen size is reduced it may (will
* probably) invalidate a currently set crtc mode, so disable crtcs first.