diff options
author | Albert Safin <xzfcpw@gmail.com> | 2020-04-08 07:52:00 +0000 |
---|---|---|
committer | Albert Safin <xzfcpw@gmail.com> | 2020-04-08 08:37:40 +0000 |
commit | 5716ff541ffa8b20c8bd8af8411987dffede9e50 (patch) | |
tree | d88283295a633c78baf4a81de52e8675aec7660a | |
parent | 148ff54f180d5bbd4ecae0298668f3f99847883b (diff) | |
download | i3-5716ff541ffa8b20c8bd8af8411987dffede9e50.tar.gz i3-5716ff541ffa8b20c8bd8af8411987dffede9e50.zip |
handlers.c: remove redundant property fetching
Some property handlers trying to fetch property again if `prop == NULL`.
This is redundant since these properties are either fetched by
property_notify() just before or deleted.
-rw-r--r-- | src/handlers.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/handlers.c b/src/handlers.c index ad394795..1108b383 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -1002,8 +1002,6 @@ static bool handle_hints(xcb_window_t window, xcb_get_property_reply_t *reply) { } bool urgency_hint; - if (reply == NULL) - reply = xcb_get_property_reply(conn, xcb_icccm_get_wm_hints(conn, window), NULL); window_update_hints(con->window, reply, &urgency_hint); con_set_urgency(con, urgency_hint); tree_render(); @@ -1026,13 +1024,6 @@ static bool handle_transient_for(xcb_window_t window, xcb_get_property_reply_t * return false; } - if (prop == NULL) { - prop = xcb_get_property_reply(conn, xcb_get_property_unchecked(conn, false, window, XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 0, 32), - NULL); - if (prop == NULL) - return false; - } - window_update_transient_for(con->window, prop); return true; @@ -1048,13 +1039,6 @@ static bool handle_clientleader_change(xcb_window_t window, xcb_get_property_rep if ((con = con_by_window_id(window)) == NULL || con->window == NULL) return false; - if (prop == NULL) { - prop = xcb_get_property_reply(conn, xcb_get_property_unchecked(conn, false, window, A_WM_CLIENT_LEADER, XCB_ATOM_WINDOW, 0, 32), - NULL); - if (prop == NULL) - return false; - } - window_update_leader(con->window, prop); return true; @@ -1141,14 +1125,6 @@ static bool handle_class_change(xcb_window_t window, xcb_get_property_reply_t *p if ((con = con_by_window_id(window)) == NULL || con->window == NULL) return false; - if (prop == NULL) { - prop = xcb_get_property_reply(conn, xcb_get_property_unchecked(conn, false, window, XCB_ATOM_WM_CLASS, XCB_ATOM_STRING, 0, 32), - NULL); - - if (prop == NULL) - return false; - } - window_update_class(con->window, prop); con = remanage_window(con); @@ -1165,14 +1141,6 @@ static bool handle_motif_hints_change(xcb_window_t window, xcb_get_property_repl if ((con = con_by_window_id(window)) == NULL || con->window == NULL) return false; - if (prop == NULL) { - prop = xcb_get_property_reply(conn, xcb_get_property_unchecked(conn, false, window, A__MOTIF_WM_HINTS, XCB_GET_PROPERTY_TYPE_ANY, 0, 5 * sizeof(uint64_t)), - NULL); - - if (prop == NULL) - return false; - } - border_style_t motif_border_style; window_update_motif_hints(con->window, prop, &motif_border_style); @@ -1198,23 +1166,6 @@ static bool handle_strut_partial_change(xcb_window_t window, xcb_get_property_re return false; } - if (prop == NULL) { - xcb_generic_error_t *err = NULL; - xcb_get_property_cookie_t strut_cookie = xcb_get_property(conn, false, window, A__NET_WM_STRUT_PARTIAL, - XCB_GET_PROPERTY_TYPE_ANY, 0, UINT32_MAX); - prop = xcb_get_property_reply(conn, strut_cookie, &err); - - if (err != NULL) { - DLOG("got error when getting strut partial property: %d\n", err->error_code); - free(err); - return false; - } - - if (prop == NULL) { - return false; - } - } - DLOG("That is con %p / %s\n", con, con->name); window_update_strut_partial(con->window, prop); |