From 84e764a5c1e89e72094b3db8aa8e17943b867218 Mon Sep 17 00:00:00 2001 From: James Magahern Date: Sat, 9 Feb 2019 14:01:58 -0800 Subject: Multi-monitor support Use BUZZLOCKER_MONITOR_NUM to specify which monitor you want the locker to appear on. 0 is the primary one --- src/x11_support.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/x11_support.h') diff --git a/src/x11_support.h b/src/x11_support.h index 6421f4b..9007602 100644 --- a/src/x11_support.h +++ b/src/x11_support.h @@ -12,10 +12,22 @@ #include #include -void x11_get_display_bounds(int *width, int *height); +typedef struct { + int x; + int y; + int width; + int height; +} x11_display_bounds_t; + +// Get the preferred monitor number (via BUZZLOCKER_MONITOR_NUM environment variable) +// Returns 0 (the primary one) if not set +unsigned int get_preferred_monitor_num(); + +// Get the bounds for the specified monitor num (via XRandR) +void x11_get_display_bounds(unsigned int monitor_num, x11_display_bounds_t *out_bounds); // Sets up a window and returns a cairo_surface to draw onto -cairo_surface_t* x11_helper_acquire_cairo_surface(int width, int height); +cairo_surface_t* x11_helper_acquire_cairo_surface(); // Cleanup void x11_helper_destroy_surface(cairo_surface_t *surface); -- cgit v1.2.3-54-g00ecf