summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Fontaine <arnau@debian.org>2009-12-12 17:00:07 +0100
committerArnaud Fontaine <arnau@debian.org>2010-08-09 16:06:30 -0500
commitd776aa8fa48bcbe46ac926475d1d481e8b85feff (patch)
treef6c22d5ecf203e66d399630432ccd459fd9f06ea
parent4c359361b89972d3ae7393f6f4a1d60221945d2e (diff)
Fix _NET_WM_STRUT and _NET_WM_STRUT_PARTIAL
-rw-r--r--ewmh/ewmh.c.m453
-rw-r--r--ewmh/xcb_ewmh.h.m458
2 files changed, 84 insertions, 27 deletions
diff --git a/ewmh/ewmh.c.m4 b/ewmh/ewmh.c.m4
index ada2fb1..bbc75e7 100644
--- a/ewmh/ewmh.c.m4
+++ b/ewmh/ewmh.c.m4
@@ -931,30 +931,63 @@ DO_LIST_VALUES(wm_allowed_actions, _NET_WM_ALLOWED_ACTIONS, ATOM, atom)
/**
* _NET_WM_STRUT
- * _NET_WM_STRUT_PARTIAL
*/
xcb_void_cookie_t
xcb_ewmh_set_wm_strut(xcb_ewmh_connection_t *ewmh,
- xcb_window_t window,
- xcb_ewmh_wm_strut_t wm_strut)
+ xcb_window_t window,
+ uint32_t left, uint32_t right,
+ uint32_t top, uint32_t bottom)
{
+ const uint32_t data[] = { left, right, top, bottom };
+
return xcb_change_property(ewmh->connection, XCB_PROP_MODE_REPLACE, window,
- ewmh->_NET_WM_STRUT, CARDINAL, 32, 12, &wm_strut);
+ ewmh->_NET_WM_STRUT, CARDINAL, 32, countof(data),
+ data);
}
xcb_void_cookie_t
xcb_ewmh_set_wm_strut_checked(xcb_ewmh_connection_t *ewmh,
- xcb_window_t window,
- xcb_ewmh_wm_strut_t wm_strut)
+ xcb_window_t window,
+ uint32_t left, uint32_t right,
+ uint32_t top, uint32_t bottom)
{
+ const uint32_t data[] = { left, right, top, bottom };
+
return xcb_change_property_checked(ewmh->connection, XCB_PROP_MODE_REPLACE,
window, ewmh->_NET_WM_STRUT, CARDINAL, 32,
- 12, &wm_strut);
+ countof(data), data);
+}
+
+DO_GET_PROPERTY(wm_strut, _NET_WM_STRUT, CARDINAL, 4)
+DO_REPLY_STRUCTURE(wm_strut, xcb_ewmh_get_extents_reply_t)
+
+/*
+ * _NET_WM_STRUT_PARTIAL
+ */
+
+xcb_void_cookie_t
+xcb_ewmh_set_wm_strut_partial(xcb_ewmh_connection_t *ewmh,
+ xcb_window_t window,
+ xcb_ewmh_wm_strut_partial_t wm_strut)
+{
+ return xcb_change_property(ewmh->connection, XCB_PROP_MODE_REPLACE, window,
+ ewmh->_NET_WM_STRUT_PARTIAL, CARDINAL, 32, 12,
+ &wm_strut);
+}
+
+xcb_void_cookie_t
+xcb_ewmh_set_wm_strut_partial_checked(xcb_ewmh_connection_t *ewmh,
+ xcb_window_t window,
+ xcb_ewmh_wm_strut_partial_t wm_strut)
+{
+ return xcb_change_property_checked(ewmh->connection, XCB_PROP_MODE_REPLACE,
+ window, ewmh->_NET_WM_STRUT_PARTIAL,
+ CARDINAL, 32, 12, &wm_strut);
}
-DO_GET_PROPERTY(wm_strut, _NET_WM_STRUT, CARDINAL, 12)
-DO_REPLY_STRUCTURE(wm_strut, xcb_ewmh_wm_strut_t)
+DO_GET_PROPERTY(wm_strut_partial, _NET_WM_STRUT_PARTIAL, CARDINAL, 12)
+DO_REPLY_STRUCTURE(wm_strut_partial, xcb_ewmh_wm_strut_partial_t)
/**
* _NET_WM_ICON_GEOMETRY
@@ -1121,7 +1154,7 @@ xcb_ewmh_set_frame_extents_checked(xcb_ewmh_connection_t *ewmh,
}
DO_GET_PROPERTY(frame_extents, _NET_FRAME_EXTENTS, CARDINAL, 4)
-DO_REPLY_STRUCTURE(frame_extents, xcb_ewmh_get_frame_extents_reply_t)
+DO_REPLY_STRUCTURE(frame_extents, xcb_ewmh_get_extents_reply_t)
/**
* _NET_WM_PING
diff --git a/ewmh/xcb_ewmh.h.m4 b/ewmh/xcb_ewmh.h.m4
index 8949971..45951c1 100644
--- a/ewmh/xcb_ewmh.h.m4
+++ b/ewmh/xcb_ewmh.h.m4
@@ -288,7 +288,7 @@ typedef struct {
uint32_t bottom_start_x;
/** Ending x coordinate of the bottom strut */
uint32_t bottom_end_x;
-} xcb_ewmh_wm_strut_t;
+} xcb_ewmh_wm_strut_partial_t;
/**
* @brief Hold reply of _NET_WM_ICON GetProperty
@@ -316,7 +316,7 @@ typedef struct {
uint32_t top;
/** Width of the bottom border */
uint32_t bottom;
-} xcb_ewmh_get_frame_extents_reply_t;
+} xcb_ewmh_get_extents_reply_t;
/**
* @brief Hold reply of _NET_WM_FULLSCREEN_MONITORS GetProperty
@@ -1132,7 +1132,7 @@ xcb_ewmh_get_desktop_names_from_reply(xcb_ewmh_connection_t *ewmh,
xcb_ewmh_get_utf8_strings_reply_t *names,
xcb_get_property_reply_t *r)
{
- return xcb_ewmh_get_utf8_strings_from_reply(ewmh, data, r);
+ return xcb_ewmh_get_utf8_strings_from_reply(ewmh, names, r);
}
/**
@@ -1154,7 +1154,7 @@ xcb_ewmh_get_desktop_names_reply(xcb_ewmh_connection_t *ewmh,
xcb_ewmh_get_utf8_strings_reply_t *names,
xcb_generic_error_t **e)
{
- return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, data, e);
+ return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, names, e);
}
/**
@@ -1828,26 +1828,50 @@ uint8_t xcb_ewmh_get_wm_allowed_actions_reply(xcb_ewmh_connection_t *ewmh,
xcb_generic_error_t **e);
xcb_void_cookie_t xcb_ewmh_set_wm_strut(xcb_ewmh_connection_t *ewmh,
- xcb_window_t window,
- xcb_ewmh_wm_strut_t wm_strut);
+ xcb_window_t window,
+ uint32_t left, uint32_t right,
+ uint32_t top, uint32_t bottom);
xcb_void_cookie_t xcb_ewmh_set_wm_strut_checked(xcb_ewmh_connection_t *ewmh,
- xcb_window_t window,
- xcb_ewmh_wm_strut_t wm_strut);
+ xcb_window_t window,
+ uint32_t left, uint32_t right,
+ uint32_t top, uint32_t bottom);
xcb_get_property_cookie_t xcb_ewmh_get_wm_strut_unchecked(xcb_ewmh_connection_t *ewmh,
- xcb_window_t window);
+ xcb_window_t window);
xcb_get_property_cookie_t xcb_ewmh_get_wm_strut(xcb_ewmh_connection_t *ewmh,
- xcb_window_t window);
+ xcb_window_t window);
-uint8_t xcb_ewmh_get_wm_strut_from_reply(xcb_ewmh_wm_strut_t *struts,
- xcb_get_property_reply_t *r);
+uint8_t xcb_ewmh_get_wm_strut_from_reply(xcb_ewmh_get_extents_reply_t *struts,
+ xcb_get_property_reply_t *r);
uint8_t xcb_ewmh_get_wm_strut_reply(xcb_ewmh_connection_t *ewmh,
- xcb_get_property_cookie_t cookie,
- xcb_ewmh_wm_strut_t *struts,
- xcb_generic_error_t **e);
+ xcb_get_property_cookie_t cookie,
+ xcb_ewmh_get_extents_reply_t *struts,
+ xcb_generic_error_t **e);
+
+xcb_void_cookie_t xcb_ewmh_set_wm_strut_partial(xcb_ewmh_connection_t *ewmh,
+ xcb_window_t window,
+ xcb_ewmh_wm_strut_partial_t wm_strut);
+
+xcb_void_cookie_t xcb_ewmh_set_wm_strut_partial_checked(xcb_ewmh_connection_t *ewmh,
+ xcb_window_t window,
+ xcb_ewmh_wm_strut_partial_t wm_strut);
+
+xcb_get_property_cookie_t xcb_ewmh_get_wm_strut_partial_unchecked(xcb_ewmh_connection_t *ewmh,
+ xcb_window_t window);
+
+xcb_get_property_cookie_t xcb_ewmh_get_wm_strut_partial(xcb_ewmh_connection_t *ewmh,
+ xcb_window_t window);
+
+uint8_t xcb_ewmh_get_wm_strut_partial_from_reply(xcb_ewmh_wm_strut_partial_t *struts,
+ xcb_get_property_reply_t *r);
+
+uint8_t xcb_ewmh_get_wm_strut_partial_reply(xcb_ewmh_connection_t *ewmh,
+ xcb_get_property_cookie_t cookie,
+ xcb_ewmh_wm_strut_partial_t *struts,
+ xcb_generic_error_t **e);
xcb_void_cookie_t xcb_ewmh_set_wm_icon_geometry(xcb_ewmh_connection_t *ewmh,
xcb_window_t window,
@@ -2005,12 +2029,12 @@ xcb_get_property_cookie_t xcb_ewmh_get_frame_extents_unchecked(xcb_ewmh_connecti
xcb_get_property_cookie_t xcb_ewmh_get_frame_extents(xcb_ewmh_connection_t *ewmh,
xcb_window_t window);
-uint8_t xcb_ewmh_get_frame_extents_from_reply(xcb_ewmh_get_frame_extents_reply_t *frame_extents,
+uint8_t xcb_ewmh_get_frame_extents_from_reply(xcb_ewmh_get_extents_reply_t *frame_extents,
xcb_get_property_reply_t *r);
uint8_t xcb_ewmh_get_frame_extents_reply(xcb_ewmh_connection_t *ewmh,
xcb_get_property_cookie_t cookie,
- xcb_ewmh_get_frame_extents_reply_t *frame_extents,
+ xcb_ewmh_get_extents_reply_t *frame_extents,
xcb_generic_error_t **e);
xcb_void_cookie_t xcb_ewmh_send_wm_ping(xcb_ewmh_connection_t *ewmh,