From c57bef833288352970b222b5b2931409ffee85d7 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 18 Aug 2009 12:01:44 +0200 Subject: [PATCH] ewmh: change ewmh_update_client_strut() to ewmh_update_strut() It takes window + strut as argument rather than a client. Signed-off-by: Julien Danjou --- client.c | 2 +- ewmh.c | 30 +++++++++++++++--------------- ewmh.h | 3 ++- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/client.c b/client.c index b2bdcdcf..34bdd371 100644 --- a/client.c +++ b/client.c @@ -1605,7 +1605,7 @@ luaA_client_struts(lua_State *L) c->strut = struts; - ewmh_update_client_strut(c); + ewmh_update_strut(c->window, &c->strut); hook_property(c, "struts"); luaA_object_emit_signal(L, 1, "property::struts", 0); diff --git a/ewmh.c b/ewmh.c index 3f1f24f1..f0b556d2 100644 --- a/ewmh.c +++ b/ewmh.c @@ -474,26 +474,26 @@ ewmh_client_update_desktop(client_t *c) * \param c The client. */ void -ewmh_update_client_strut(client_t *c) +ewmh_update_strut(xcb_window_t window, strut_t *strut) { - uint32_t state[] = + const uint32_t state[] = { - c->strut.left, - c->strut.right, - c->strut.top, - c->strut.bottom, - c->strut.left_start_y, - c->strut.left_end_y, - c->strut.right_start_y, - c->strut.right_end_y, - c->strut.top_start_x, - c->strut.top_end_x, - c->strut.bottom_start_x, - c->strut.bottom_end_x + strut->left, + strut->right, + strut->top, + strut->bottom, + strut->left_start_y, + strut->left_end_y, + strut->right_start_y, + strut->right_end_y, + strut->top_start_x, + strut->top_end_x, + strut->bottom_start_x, + strut->bottom_end_x }; xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, - c->window, _NET_WM_STRUT_PARTIAL, CARDINAL, 32, countof(state), state); + window, _NET_WM_STRUT_PARTIAL, CARDINAL, 32, countof(state), state); } void diff --git a/ewmh.h b/ewmh.h index dfad0a1c..0a04cc5d 100644 --- a/ewmh.h +++ b/ewmh.h @@ -23,6 +23,7 @@ #define AWESOME_EWMH_H #include "structs.h" +#include "strut.h" void ewmh_init(int); void ewmh_update_net_client_list(int); @@ -37,7 +38,7 @@ void ewmh_client_update_hints(client_t *); void ewmh_client_update_desktop(client_t *); void ewmh_update_workarea(int); void ewmh_process_client_strut(client_t *, xcb_get_property_reply_t *); -void ewmh_update_client_strut(client_t *c); +void ewmh_update_strut(xcb_window_t, strut_t *); xcb_get_property_cookie_t ewmh_window_icon_get_unchecked(xcb_window_t); int ewmh_window_icon_from_reply(xcb_get_property_reply_t *); int ewmh_window_icon_get_reply(xcb_get_property_cookie_t);