diff options
author | James Magahern <james@magahern.com> | 2019-02-09 14:01:58 -0800 |
---|---|---|
committer | James Magahern <james@magahern.com> | 2019-02-09 14:52:45 -0800 |
commit | 84e764a5c1e89e72094b3db8aa8e17943b867218 (patch) | |
tree | e402550c5dded5a4a137e4a6a17bec8f484c4f9b /src/x11_support.h | |
parent | Slight adjustment to the screenshot (diff) |
Multi-monitor support
Use BUZZLOCKER_MONITOR_NUM to specify which monitor you want the locker to appear on. 0 is the primary one
Diffstat (limited to 'src/x11_support.h')
-rw-r--r-- | src/x11_support.h | 16 |
1 files changed, 14 insertions, 2 deletions
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 <X11/Xlib.h> #include <X11/Xutil.h> -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); |