xsecurelock  1.7.0
XSecureLock is an X11 screen lock utility.
Data Structures | Functions
monitors.h File Reference
#include <X11/X.h>
#include <X11/Xlib.h>
#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  Monitor
 

Functions

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...
 

Function Documentation

◆ GetMonitors()

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.

Parameters
dpyThe current display.
wThe window this application intends to draw in.
out_monitorsA pointer to an array that will receive the monitor configuration (in coordinates relative and clipped to the window w.
max_monitorsThe size of the array.
Returns
The number of monitors returned in the array.

◆ IsMonitorChangeEvent()

int IsMonitorChangeEvent ( Display *  dpy,
int  type 
)

Returns the event type that indicates a change to the monitor configuration.

Parameters
dpyThe current display.
typeThe received event type.
Returns
1 if the received event is a monitor change event and GetMonitors should be called, or 0 otherwise.

◆ SelectMonitorChangeEvents()

void SelectMonitorChangeEvents ( Display *  dpy,
Window  window 
)

Enable receiving monitor change events for the given display at w.