summaryrefslogtreecommitdiff
path: root/src/xwindow.h
blob: f3be6817ec60a755b6cad00432c52b76e66cbc40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef _XWIN_H
#define _XWIN_H

#include <X11/extensions/Xdamage.h>
#include <X11/extensions/Xrender.h>
#include <X11/Xlib.h>

#include "libvmon/vmon.h"
#include "list.h"
#include "overlay.h"

typedef struct _vwm_t vwm_t;
typedef struct _vwm_window_t vwm_window_t;

/* every window gets this, even non-managed ones.  For compositing vwm must track everything visible, even popup menus. */
typedef struct _vwm_xwindow_t {
	list_head_t		xwindows;		/* global list of all windows kept in X stacking order */

	Window			id;			/* X Window backing this instance */
	XWindowAttributes	attrs;			/* X window's current attributes, kept up-to-date in handling of ConfigureNotify events */
	Damage			damage;			/* X damage object associated with the window (for compositing) */
	Picture			picture;		/* X picture object representing the window (for compositing) */
	Pixmap			pixmap;			/* X pixmap object representing the window (for compositing) */

	vmon_proc_t		*monitor;		/* vmon process monitor handle, may be NULL if for example the X client doesn't supply a PID */
	vwm_overlay_t		overlay;		/* monitoring overlay state */

	char			*name;			/* client name */
	unsigned int		mapped:1;		/* is the window currently mapped (by client) */
	unsigned int		occluded:1;		/* is the window occluded entirely by another window? (used and valid only during paint_all()) */
							/* if only Xorg could send VisibilityNotify events when requested for redirected windows :( */
	vwm_window_t		*managed;		/* is the window "managed"? NULL or this points to the managed context of the window */
} vwm_xwindow_t;

/* creates and potentially manages a new window (called in response to CreateNotify events, and during startup for all existing windows) */
/* if the window is already mapped and not an override_redirect window, it becomes managed here. */
typedef enum _vwm_grab_mode_t {
	VWM_NOT_GRABBED = 0,
	VWM_GRABBED
} vwm_grab_mode_t;

void vwm_xwin_message(vwm_t *vwm, vwm_xwindow_t *xwin, Atom type, long foo);
vwm_xwindow_t * vwm_xwin_lookup(vwm_t *vwm, Window win);
int vwm_xwin_is_mapped(vwm_t *vwm, vwm_xwindow_t *xwin);
void vwm_xwin_monitor(vwm_t *vwm, vwm_xwindow_t *xwin);
vwm_xwindow_t * vwm_xwin_create(vwm_t *vwm, Window win, vwm_grab_mode_t grabbed);
void vwm_xwin_destroy(vwm_t *vwm, vwm_xwindow_t *xwin);
void vwm_xwin_restack(vwm_t *vwm, vwm_xwindow_t *xwin, Window new_above);
int vwm_xwin_create_existing(vwm_t *vwm);


#endif
© All Rights Reserved