summaryrefslogtreecommitdiff
path: root/gwm.h
diff options
context:
space:
mode:
authorGary Wong <gtw@gnu.org>2010-11-09 12:12:44 -0700
committerGary Wong <gtw@gnu.org>2012-01-30 13:20:12 -0700
commitdfb575033ef2138bec13c0b08107e2ff7f30573f (patch)
treeaf67d38e2f394c0437dfdc20b69c9ec825babd9a /gwm.h
parent4c373f89d60630cc69e6ab4156734f1b3a431aec (diff)
Add support for RANDR extension.
Track screen and CRTC geometry changes, and use sensible window and menu placement policies when multiple CRTCs are present.
Diffstat (limited to 'gwm.h')
-rw-r--r--gwm.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/gwm.h b/gwm.h
index 10ade58..8d5525c 100644
--- a/gwm.h
+++ b/gwm.h
@@ -49,7 +49,9 @@ extern MALLOC void *xcalloc( size_t number, size_t size );
enum _extended_event_type {
SYNTHETIC_EVENT = XCB_MAPPING_NOTIFY + 1,
- SHAPE_NOTIFY
+ RANDR_CRTC_CHANGE_NOTIFY,
+ SHAPE_NOTIFY,
+ NUM_EXTENDED_EVENTS
};
extern xcb_connection_t *c;
@@ -124,6 +126,9 @@ enum gwm_extension {
#if USE_DAMAGE
EXT_DAMAGE,
#endif
+#if USE_RANDR
+ EXT_RANDR,
+#endif
#if USE_RENDER
EXT_RENDER,
#endif
@@ -136,7 +141,8 @@ enum gwm_extension {
NUM_EXTENSIONS
};
-#if USE_COMPOSITE || USE_DAMAGE || USE_RENDER || USE_SHAPE || USE_FIXES
+#if USE_COMPOSITE || USE_DAMAGE || USE_RANDR || USE_RENDER || USE_SHAPE || \
+ USE_XFIXES
#define EXTENSIONS_SIZE NUM_EXTENSIONS
#else
#define EXTENSIONS_SIZE 1 /* avoid zero length arrays */
@@ -166,12 +172,23 @@ enum decoration_col {
extern int num_screens;
extern xcb_screen_t **screens;
+#if USE_RANDR
+struct gwm_crtc {
+ uint32_t crtc;
+ int x, y, width, height;
+};
+#endif
+
struct gwm_screen {
xcb_visualtype_t *root_visual;
xcb_atom_t wm_atom; /* the atom WM_Sn, where n is the screen number */
xcb_colormap_t cmap; /* the most recently installed colormap */
xcb_timestamp_t cmap_time; /* the time at which it was installed */
uint32_t pixels[ NUM_COLS ]; /* pixel values in the default cmap */
+#if USE_RANDR
+ struct gwm_crtc **crtcs;
+ int num_crtcs;
+#endif
};
extern struct gwm_screen *gwm_screens;
@@ -360,6 +377,14 @@ extern CONST int initial_press( xcb_button_press_event_t *ev );
terminate a passive grab). */
extern CONST int final_release( xcb_button_release_event_t *ev );
+/* Return TRUE iff a point is "live" (within at least one CRTC). */
+extern int point_live( int screen, int x, int y );
+
+/* Move an area the shortest Manhattan distance so that at an area of at
+ least min_x x min_y pixels fall within at least one CRTC, if possible. */
+extern void make_area_live( int screen, int *x, int *y, int width, int height,
+ int min_x, int min_y );
+
extern CONST xcb_timestamp_t event_time( xcb_generic_event_t *ev );
/* The window whose event handler(s) should be invoked for pointer events.
@@ -372,6 +397,9 @@ extern xcb_window_t pointer_demux;
extern void install_window_colormap( int screen, struct gwm_window *window,
xcb_timestamp_t t );
+extern void update_crtc( int screen, int crtc, int width, int height,
+ int x, int y );
+
extern void generic_expose( struct gwm_window *window,
xcb_expose_event_t *ev );