From 5906fa15bb68c4fd6253b49cea51a3b92f89c6d6 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Thu, 21 Jun 2012 00:38:56 +0300 Subject: vdagent-x11-randr: add dump_monitors_config --- src/vdagent-x11-randr.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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. -- cgit v1.2.3