aboutsummaryrefslogtreecommitdiff
path: root/xwayland
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-03-06 12:29:20 +0100
committerDrew DeVault <sir@cmpwn.com>2020-03-06 21:34:44 +0100
commit68a69ee0798694c54e434f425b4d56690b65b939 (patch)
tree906faad4a312c438cf8fb351b155df8f9b548169 /xwayland
parent52c67284e25c6a31a260b4918132f7842e18532d (diff)
xwayland: use explicit indexes when initializing atom_map
It's very easy to break the mapping between the atom_name enum and the atom_map array. Use explicit indexes to prevent issues.
Diffstat (limited to 'xwayland')
-rw-r--r--xwayland/xwm.c124
1 files changed, 62 insertions, 62 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c
index 1658e25d..1cbc5921 100644
--- a/xwayland/xwm.c
+++ b/xwayland/xwm.c
@@ -17,68 +17,68 @@
#include "xwayland/xwm.h"
const char *atom_map[ATOM_LAST] = {
- "WL_SURFACE_ID",
- "WM_DELETE_WINDOW",
- "WM_PROTOCOLS",
- "WM_HINTS",
- "WM_NORMAL_HINTS",
- "WM_SIZE_HINTS",
- "WM_WINDOW_ROLE",
- "_MOTIF_WM_HINTS",
- "UTF8_STRING",
- "WM_S0",
- "_NET_SUPPORTED",
- "_NET_WM_CM_S0",
- "_NET_WM_PID",
- "_NET_WM_NAME",
- "_NET_WM_STATE",
- "_NET_WM_WINDOW_TYPE",
- "WM_TAKE_FOCUS",
- "WINDOW",
- "_NET_ACTIVE_WINDOW",
- "_NET_WM_MOVERESIZE",
- "_NET_WM_NAME",
- "_NET_SUPPORTING_WM_CHECK",
- "_NET_WM_STATE_MODAL",
- "_NET_WM_STATE_FULLSCREEN",
- "_NET_WM_STATE_MAXIMIZED_VERT",
- "_NET_WM_STATE_MAXIMIZED_HORZ",
- "_NET_WM_PING",
- "WM_STATE",
- "CLIPBOARD",
- "PRIMARY",
- "_WL_SELECTION",
- "TARGETS",
- "CLIPBOARD_MANAGER",
- "INCR",
- "TEXT",
- "TIMESTAMP",
- "DELETE",
- "_NET_WM_WINDOW_TYPE_NORMAL",
- "_NET_WM_WINDOW_TYPE_UTILITY",
- "_NET_WM_WINDOW_TYPE_TOOLTIP",
- "_NET_WM_WINDOW_TYPE_DND",
- "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU",
- "_NET_WM_WINDOW_TYPE_POPUP_MENU",
- "_NET_WM_WINDOW_TYPE_COMBO",
- "_NET_WM_WINDOW_TYPE_MENU",
- "_NET_WM_WINDOW_TYPE_NOTIFICATION",
- "_NET_WM_WINDOW_TYPE_SPLASH",
- "XdndSelection",
- "XdndAware",
- "XdndStatus",
- "XdndPosition",
- "XdndEnter",
- "XdndLeave",
- "XdndDrop",
- "XdndFinished",
- "XdndProxy",
- "XdndTypeList",
- "XdndActionMove",
- "XdndActionCopy",
- "XdndActionAsk",
- "XdndActionPrivate",
- "_NET_CLIENT_LIST",
+ [WL_SURFACE_ID] = "WL_SURFACE_ID",
+ [WM_DELETE_WINDOW] = "WM_DELETE_WINDOW",
+ [WM_PROTOCOLS] = "WM_PROTOCOLS",
+ [WM_HINTS] = "WM_HINTS",
+ [WM_NORMAL_HINTS] = "WM_NORMAL_HINTS",
+ [WM_SIZE_HINTS] = "WM_SIZE_HINTS",
+ [WM_WINDOW_ROLE] = "WM_WINDOW_ROLE",
+ [MOTIF_WM_HINTS] = "_MOTIF_WM_HINTS",
+ [UTF8_STRING] = "UTF8_STRING",
+ [WM_S0] = "WM_S0",
+ [NET_SUPPORTED] = "_NET_SUPPORTED",
+ [NET_WM_CM_S0] = "_NET_WM_CM_S0",
+ [NET_WM_PID] = "_NET_WM_PID",
+ [NET_WM_NAME] = "_NET_WM_NAME",
+ [NET_WM_STATE] = "_NET_WM_STATE",
+ [NET_WM_WINDOW_TYPE] = "_NET_WM_WINDOW_TYPE",
+ [WM_TAKE_FOCUS] = "WM_TAKE_FOCUS",
+ [WINDOW] = "WINDOW",
+ [_NET_ACTIVE_WINDOW] = "_NET_ACTIVE_WINDOW",
+ [_NET_WM_MOVERESIZE] = "_NET_WM_MOVERESIZE",
+ [_NET_WM_NAME] = "_NET_WM_NAME",
+ [_NET_SUPPORTING_WM_CHECK] = "_NET_SUPPORTING_WM_CHECK",
+ [_NET_WM_STATE_MODAL] = "_NET_WM_STATE_MODAL",
+ [_NET_WM_STATE_FULLSCREEN] = "_NET_WM_STATE_FULLSCREEN",
+ [_NET_WM_STATE_MAXIMIZED_VERT] = "_NET_WM_STATE_MAXIMIZED_VERT",
+ [_NET_WM_STATE_MAXIMIZED_HORZ] = "_NET_WM_STATE_MAXIMIZED_HORZ",
+ [_NET_WM_PING] = "_NET_WM_PING",
+ [WM_STATE] = "WM_STATE",
+ [CLIPBOARD] = "CLIPBOARD",
+ [PRIMARY] = "PRIMARY",
+ [WL_SELECTION] = "_WL_SELECTION",
+ [TARGETS] = "TARGETS",
+ [CLIPBOARD_MANAGER] = "CLIPBOARD_MANAGER",
+ [INCR] = "INCR",
+ [TEXT] = "TEXT",
+ [TIMESTAMP] = "TIMESTAMP",
+ [DELETE] = "DELETE",
+ [NET_WM_WINDOW_TYPE_NORMAL] = "_NET_WM_WINDOW_TYPE_NORMAL",
+ [NET_WM_WINDOW_TYPE_UTILITY] = "_NET_WM_WINDOW_TYPE_UTILITY",
+ [NET_WM_WINDOW_TYPE_TOOLTIP] = "_NET_WM_WINDOW_TYPE_TOOLTIP",
+ [NET_WM_WINDOW_TYPE_DND] = "_NET_WM_WINDOW_TYPE_DND",
+ [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_COMBO] = "_NET_WM_WINDOW_TYPE_COMBO",
+ [NET_WM_WINDOW_TYPE_MENU] = "_NET_WM_WINDOW_TYPE_MENU",
+ [NET_WM_WINDOW_TYPE_NOTIFICATION] = "_NET_WM_WINDOW_TYPE_NOTIFICATION",
+ [NET_WM_WINDOW_TYPE_SPLASH] = "_NET_WM_WINDOW_TYPE_SPLASH",
+ [DND_SELECTION] = "XdndSelection",
+ [DND_AWARE] = "XdndAware",
+ [DND_STATUS] = "XdndStatus",
+ [DND_POSITION] = "XdndPosition",
+ [DND_ENTER] = "XdndEnter",
+ [DND_LEAVE] = "XdndLeave",
+ [DND_DROP] = "XdndDrop",
+ [DND_FINISHED] = "XdndFinished",
+ [DND_PROXY] = "XdndProxy",
+ [DND_TYPE_LIST] = "XdndTypeList",
+ [DND_ACTION_MOVE] = "XdndActionMove",
+ [DND_ACTION_COPY] = "XdndActionCopy",
+ [DND_ACTION_ASK] = "XdndActionAsk",
+ [DND_ACTION_PRIVATE] = "XdndActionPrivate",
+ [_NET_CLIENT_LIST] = "_NET_CLIENT_LIST",
};
static const struct wlr_surface_role xwayland_surface_role;