diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2015-04-27 17:23:56 -0700 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2015-04-27 17:23:56 -0700 |
commit | c68e43a97f544b9d3a7845a3a7e1e21ebd638dec (patch) | |
tree | 695a654def55df37bcc4cb1d8ccd00a903e8ac68 | |
parent | cc53d48fa85a7efab2deeddea0a4a439784b20cf (diff) |
monitor-manager-xrandr: Set the underscan border properties, too
-rw-r--r-- | src/backends/x11/meta-monitor-manager-xrandr.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c index 8eaffb13..7a8bb2d7 100644 --- a/src/backends/x11/meta-monitor-manager-xrandr.c +++ b/src/backends/x11/meta-monitor-manager-xrandr.c @@ -919,15 +919,37 @@ output_set_underscanning_xrandr (MetaMonitorManagerXrandr *manager_xrandr, prop = XInternAtom (manager_xrandr->xdisplay, "underscan", False); - /* XXX: Also implement underscan border */ value = underscanning ? "on" : "off"; valueatom = XInternAtom (manager_xrandr->xdisplay, value, False); - XRRChangeOutputProperty (manager_xrandr->xdisplay, (XID)output->winsys_id, prop, XA_ATOM, 32, PropModeReplace, (unsigned char*) &valueatom, 1); + + /* Configure the border at the same time. Currently, we use a + * 5% of the width/height of the mode. In the future, we should + * make the border configurable. */ + if (underscanning) + { + uint32_t border_value; + + prop = XInternAtom (manager_xrandr->xdisplay, "underscan hborder", False); + border_value = output->crtc->current_mode->width * 0.05; + XRRChangeOutputProperty (manager_xrandr->xdisplay, + (XID)output->winsys_id, + prop, + XA_INTEGER, 32, PropModeReplace, + (unsigned char *) &border_value, 1); + + prop = XInternAtom (manager_xrandr->xdisplay, "underscan vborder", False); + border_value = output->crtc->current_mode->height * 0.05; + XRRChangeOutputProperty (manager_xrandr->xdisplay, + (XID)output->winsys_id, + prop, + XA_INTEGER, 32, PropModeReplace, + (unsigned char *) &border_value, 1); + } } static void |