From 12970211c407db1bb98a50340068dc5dc2facd87 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 11 Mar 2009 19:39:32 +0100 Subject: [PATCH] =?utf8?q?Fix=20misnomer=20(window=5Ftype=5Fhandler=20?= =?utf8?q?=E2=86=92=20handle=5Fwindow=5Ftype),=20resolve=20TODO?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- include/handlers.h | 5 +++-- src/handlers.c | 2 +- src/mainx.c | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/handlers.h b/include/handlers.h index 61396da8..ac6209ae 100644 --- a/include/handlers.h +++ b/include/handlers.h @@ -20,10 +20,11 @@ int handle_configure_event(void *prophs, xcb_connection_t *conn, xcb_configure_n int handle_configure_request(void *prophs, xcb_connection_t *conn, xcb_configure_request_event_t *event); int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_notify_event_t *event); int handle_windowname_change(void *data, xcb_connection_t *conn, uint8_t state, - xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *prop); + xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *prop); int handle_expose_event(void *data, xcb_connection_t *conn, xcb_expose_event_t *event); int handle_client_message(void *data, xcb_connection_t *conn, xcb_client_message_event_t *event); -int window_type_handler(void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *property); +int handle_window_type(void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, + xcb_atom_t atom, xcb_get_property_reply_t *property); int handle_normal_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, xcb_atom_t name, xcb_get_property_reply_t *reply); diff --git a/src/handlers.c b/src/handlers.c index 2240e323..e80ae8ac 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -723,7 +723,7 @@ int handle_client_message(void *data, xcb_connection_t *conn, xcb_client_message return 1; } -int window_type_handler(void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, +int handle_window_type(void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *property) { /* TODO: Implement this one. To do this, implement a little test program which sleep(1)s before changing this property. */ diff --git a/src/mainx.c b/src/mainx.c index ba5ece59..d47c89f1 100644 --- a/src/mainx.c +++ b/src/mainx.c @@ -417,8 +417,8 @@ int main(int argc, char *argv[], char *env[]) { /* Configure request = window tried to change size on its own */ xcb_event_set_configure_request_handler(&evenths, handle_configure_request, NULL); - /* Client message = client changed its properties (EWMH) */ - /* TODO: can’t we do this via property handlers? */ + /* Client message are sent to the root window. The only interesting client message + for us is _NET_WM_STATE, we honour _NET_WM_STATE_FULLSCREEN */ xcb_event_set_client_message_handler(&evenths, handle_client_message, NULL); /* Initialize the property handlers */ @@ -461,7 +461,7 @@ int main(int argc, char *argv[], char *env[]) { GET_ATOM(_NET_WM_STRUT_PARTIAL); GET_ATOM(UTF8_STRING); - xcb_property_set_handler(&prophs, atoms[_NET_WM_WINDOW_TYPE], UINT_MAX, window_type_handler, NULL); + xcb_property_set_handler(&prophs, atoms[_NET_WM_WINDOW_TYPE], UINT_MAX, handle_window_type, NULL); /* TODO: In order to comply with EWMH, we have to watch _NET_WM_STRUT_PARTIAL */ /* Watch _NET_WM_NAME (= title of the window in UTF-8) property */ -- 2.39.5