|
xsecurelock
1.7.0
XSecureLock is an X11 screen lock utility.
|
#include "monitors.h"#include <X11/Xlib.h>#include <stdlib.h>#include <string.h>#include "../env_settings.h"#include "../logging.h"Macros | |
| #define | CLAMP(x, mi, ma) ((x) < (mi) ? (mi) : (x) > (ma) ? (ma) : (x)) |
Functions | |
| static int | CompareMonitors (const void *a, const void *b) |
| static int | IntervalsOverlap (int astart, int asize, int bstart, int bsize) |
| static void | AddMonitor (Monitor *out_monitors, size_t *num_monitors, size_t max_monitors, int x, int y, int w, int h) |
| static void | GetMonitorsGuess (const XWindowAttributes *xwa, Monitor *out_monitors, size_t *out_num_monitors, size_t max_monitors) |
| size_t | GetMonitors (Display *dpy, Window window, Monitor *out_monitors, size_t max_monitors) |
| Queries the current monitor configuration. More... | |
| void | SelectMonitorChangeEvents (Display *dpy, Window window) |
| Enable receiving monitor change events for the given display at w. More... | |
| int | IsMonitorChangeEvent (Display *dpy, int type) |
| Returns the event type that indicates a change to the monitor configuration. More... | |
| #define CLAMP | ( | x, | |
| mi, | |||
| ma | |||
| ) | ((x) < (mi) ? (mi) : (x) > (ma) ? (ma) : (x)) |
|
static |
|
static |
| size_t GetMonitors | ( | Display * | dpy, |
| Window | window, | ||
| Monitor * | out_monitors, | ||
| size_t | max_monitors | ||
| ) |
Queries the current monitor configuration.
Note: out_monitors will be zero padded and sorted in some deterministic order so memcmp can be used to check if the monitor configuration has actually changed.
| dpy | The current display. |
| w | The window this application intends to draw in. |
| out_monitors | A pointer to an array that will receive the monitor configuration (in coordinates relative and clipped to the window w. |
| max_monitors | The size of the array. |
|
static |
|
static |
| int IsMonitorChangeEvent | ( | Display * | dpy, |
| int | type | ||
| ) |
Returns the event type that indicates a change to the monitor configuration.
| dpy | The current display. |
| type | The received event type. |
| void SelectMonitorChangeEvents | ( | Display * | dpy, |
| Window | window | ||
| ) |
Enable receiving monitor change events for the given display at w.
1.8.14