aboutsummaryrefslogtreecommitdiff
path: root/xwayland
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-07-21 13:16:28 +0200
committerDrew DeVault <sir@cmpwn.com>2020-07-22 13:49:24 -0600
commitc72efcd1ce070dc5a55625de1b0ef2c6630ce8dc (patch)
tree0813bf748fd1a77e4e7c6f58afc0949e8a035928 /xwayland
parent13f35139d39f3ec40f1f7a20ae15161ef04f03bd (diff)
xwayland/xwm: use initializer for props in xsurface_set_wm_state
This avoids uninitialized items and makes it clear where the magic number 2 is coming from.
Diffstat (limited to 'xwayland')
-rw-r--r--xwayland/xwm.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c
index a34d56a2..e1050308 100644
--- a/xwayland/xwm.c
+++ b/xwayland/xwm.c
@@ -913,10 +913,7 @@ static void xwm_handle_configure_notify(struct wlr_xwm *xwm,
static void xsurface_set_wm_state(struct wlr_xwayland_surface *xsurface,
int32_t state) {
struct wlr_xwm *xwm = xsurface->xwm;
- uint32_t property[2];
-
- property[0] = state;
- property[1] = XCB_WINDOW_NONE;
+ uint32_t property[] = { state, XCB_WINDOW_NONE };
xcb_change_property(xwm->xcb_conn,
XCB_PROP_MODE_REPLACE,
@@ -924,7 +921,7 @@ static void xsurface_set_wm_state(struct wlr_xwayland_surface *xsurface,
xwm->atoms[WM_STATE],
xwm->atoms[WM_STATE],
32, // format
- 2, property);
+ sizeof(property) / sizeof(property[0]), property);
}
static void xwm_handle_map_request(struct wlr_xwm *xwm,