diff options
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); |