diff options
author | Simon Ser <contact@emersion.fr> | 2021-01-08 14:58:58 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-01-08 14:58:58 +0100 |
commit | 661cdac2d648f1f2abcaa2304c0b19d997a06088 (patch) | |
tree | 13072c2d09ac73439a462f76e305a7d2ae57d21b | |
parent | cbd82b4117cc5bcb5f8d35721f9b2d3c1b5a7077 (diff) |
desktop/xwayland: use index constants for atom array
This ensures we don't swap two atoms by mistake.
-rw-r--r-- | sway/desktop/xwayland.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 186502b2..e1a2e463 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -19,17 +19,17 @@ #include "sway/tree/workspace.h" static const char *atom_map[ATOM_LAST] = { - "_NET_WM_WINDOW_TYPE_NORMAL", - "_NET_WM_WINDOW_TYPE_DIALOG", - "_NET_WM_WINDOW_TYPE_UTILITY", - "_NET_WM_WINDOW_TYPE_TOOLBAR", - "_NET_WM_WINDOW_TYPE_SPLASH", - "_NET_WM_WINDOW_TYPE_MENU", - "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", - "_NET_WM_WINDOW_TYPE_POPUP_MENU", - "_NET_WM_WINDOW_TYPE_TOOLTIP", - "_NET_WM_WINDOW_TYPE_NOTIFICATION", - "_NET_WM_STATE_MODAL", + [NET_WM_WINDOW_TYPE_NORMAL] = "_NET_WM_WINDOW_TYPE_NORMAL", + [NET_WM_WINDOW_TYPE_DIALOG] = "_NET_WM_WINDOW_TYPE_DIALOG", + [NET_WM_WINDOW_TYPE_UTILITY] = "_NET_WM_WINDOW_TYPE_UTILITY", + [NET_WM_WINDOW_TYPE_TOOLBAR] = "_NET_WM_WINDOW_TYPE_TOOLBAR", + [NET_WM_WINDOW_TYPE_SPLASH] = "_NET_WM_WINDOW_TYPE_SPLASH", + [NET_WM_WINDOW_TYPE_MENU] = "_NET_WM_WINDOW_TYPE_MENU", + [NET_WM_WINDOW_TYPE_DROPDOWN_MENU] = "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", + [NET_WM_WINDOW_TYPE_POPUP_MENU] = "_NET_WM_WINDOW_TYPE_POPUP_MENU", + [NET_WM_WINDOW_TYPE_TOOLTIP] = "_NET_WM_WINDOW_TYPE_TOOLTIP", + [NET_WM_WINDOW_TYPE_NOTIFICATION] = "_NET_WM_WINDOW_TYPE_NOTIFICATION", + [NET_WM_STATE_MODAL] = "_NET_WM_STATE_MODAL", }; static void unmanaged_handle_request_configure(struct wl_listener *listener, |