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

Go to the source code of this file.

Data Structures

struct  UnmapAllWindowsState
 

Functions

int InitUnmapAllWindowsState (UnmapAllWindowsState *state, Display *display, Window root_window, const Window *ignored_windows, unsigned int n_ignored_windows, const char *my_res_class, const char *my_res_name, int include_frame)
 Stores the list of all mapped application windows in the state. More...
 
int UnmapAllWindows (UnmapAllWindowsState *state, int(*just_unmapped_can_we_stop)(Window w, void *arg), void *arg)
 Unmaps all windows, and stores them in the state. More...
 
void RemapAllWindows (UnmapAllWindowsState *state)
 Remaps all windows from the state. More...
 
void ClearUnmapAllWindowsState (UnmapAllWindowsState *state)
 Clears the UnmapAllWindowsState when done, and returns resources to X11. More...
 

Function Documentation

◆ ClearUnmapAllWindowsState()

void ClearUnmapAllWindowsState ( UnmapAllWindowsState state)

Clears the UnmapAllWindowsState when done, and returns resources to X11.

◆ InitUnmapAllWindowsState()

int InitUnmapAllWindowsState ( UnmapAllWindowsState state,
Display *  display,
Window  root_window,
const Window *  ignored_windows,
unsigned int  n_ignored_windows,
const char *  my_res_class,
const char *  my_res_name,
int  include_frame 
)

Stores the list of all mapped application windows in the state.

Note that windows might be created after this has been called, so you typically want to grab the server first.

Returns
true if all is fine, false if a non-ignored window matching my own window class was found, which should indicate that another instance is already running.

◆ RemapAllWindows()

void RemapAllWindows ( UnmapAllWindowsState state)

Remaps all windows from the state.

Must be used on the state filled by ListAllWindows.

◆ UnmapAllWindows()

int UnmapAllWindows ( UnmapAllWindowsState state,
int(*)(Window w, void *arg)  just_unmapped_can_we_stop,
void *  arg 
)

Unmaps all windows, and stores them in the state.

After each unmapping it calls just_unmapped_can_we_stop on the window; if that returns a non-zero value, unmapping stops and we return that value.

Must be used on the state filled by ListAllWindows.

Returns
Nonzero return value of just_unmapped_can_we_stop, or zero if we unmapped all.