xwayland: minor code style fixes

This commit is contained in:
Simon Ser 2020-11-03 15:31:23 +01:00
parent ee43ef3c9d
commit 1fdaaf697a
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
1 changed files with 52 additions and 52 deletions

View File

@ -1054,49 +1054,49 @@ static void xwm_handle_surface_id_message(struct wlr_xwm *xwm,
} }
} }
#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0 #define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0
#define _NET_WM_MOVERESIZE_SIZE_TOP 1 #define _NET_WM_MOVERESIZE_SIZE_TOP 1
#define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2 #define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2
#define _NET_WM_MOVERESIZE_SIZE_RIGHT 3 #define _NET_WM_MOVERESIZE_SIZE_RIGHT 3
#define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4 #define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4
#define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5 #define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5
#define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6 #define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6
#define _NET_WM_MOVERESIZE_SIZE_LEFT 7 #define _NET_WM_MOVERESIZE_SIZE_LEFT 7
#define _NET_WM_MOVERESIZE_MOVE 8 // movement only #define _NET_WM_MOVERESIZE_MOVE 8 // movement only
#define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 // size via keyboard #define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 // size via keyboard
#define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 // move via keyboard #define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 // move via keyboard
#define _NET_WM_MOVERESIZE_CANCEL 11 // cancel operation #define _NET_WM_MOVERESIZE_CANCEL 11 // cancel operation
static enum wlr_edges net_wm_edges_to_wlr(uint32_t net_wm_edges) { static enum wlr_edges net_wm_edges_to_wlr(uint32_t net_wm_edges) {
enum wlr_edges edges = WLR_EDGE_NONE; enum wlr_edges edges = WLR_EDGE_NONE;
switch(net_wm_edges) { switch(net_wm_edges) {
case _NET_WM_MOVERESIZE_SIZE_TOPLEFT: case _NET_WM_MOVERESIZE_SIZE_TOPLEFT:
edges = WLR_EDGE_TOP | WLR_EDGE_LEFT; edges = WLR_EDGE_TOP | WLR_EDGE_LEFT;
break; break;
case _NET_WM_MOVERESIZE_SIZE_TOP: case _NET_WM_MOVERESIZE_SIZE_TOP:
edges = WLR_EDGE_TOP; edges = WLR_EDGE_TOP;
break; break;
case _NET_WM_MOVERESIZE_SIZE_TOPRIGHT: case _NET_WM_MOVERESIZE_SIZE_TOPRIGHT:
edges = WLR_EDGE_TOP | WLR_EDGE_RIGHT; edges = WLR_EDGE_TOP | WLR_EDGE_RIGHT;
break; break;
case _NET_WM_MOVERESIZE_SIZE_RIGHT: case _NET_WM_MOVERESIZE_SIZE_RIGHT:
edges = WLR_EDGE_RIGHT; edges = WLR_EDGE_RIGHT;
break; break;
case _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT: case _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT:
edges = WLR_EDGE_BOTTOM | WLR_EDGE_RIGHT; edges = WLR_EDGE_BOTTOM | WLR_EDGE_RIGHT;
break; break;
case _NET_WM_MOVERESIZE_SIZE_BOTTOM: case _NET_WM_MOVERESIZE_SIZE_BOTTOM:
edges = WLR_EDGE_BOTTOM; edges = WLR_EDGE_BOTTOM;
break; break;
case _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT: case _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT:
edges = WLR_EDGE_BOTTOM | WLR_EDGE_LEFT; edges = WLR_EDGE_BOTTOM | WLR_EDGE_LEFT;
break; break;
case _NET_WM_MOVERESIZE_SIZE_LEFT: case _NET_WM_MOVERESIZE_SIZE_LEFT:
edges = WLR_EDGE_LEFT; edges = WLR_EDGE_LEFT;
break; break;
default: default:
break; break;
} }
return edges; return edges;
@ -1138,25 +1138,25 @@ static void xwm_handle_net_wm_moveresize_message(struct wlr_xwm *xwm,
} }
} }
#define _NET_WM_STATE_REMOVE 0 #define _NET_WM_STATE_REMOVE 0
#define _NET_WM_STATE_ADD 1 #define _NET_WM_STATE_ADD 1
#define _NET_WM_STATE_TOGGLE 2 #define _NET_WM_STATE_TOGGLE 2
static bool update_state(int action, bool *state) { static bool update_state(int action, bool *state) {
int new_state, changed; int new_state, changed;
switch (action) { switch (action) {
case _NET_WM_STATE_REMOVE: case _NET_WM_STATE_REMOVE:
new_state = false; new_state = false;
break; break;
case _NET_WM_STATE_ADD: case _NET_WM_STATE_ADD:
new_state = true; new_state = true;
break; break;
case _NET_WM_STATE_TOGGLE: case _NET_WM_STATE_TOGGLE:
new_state = !*state; new_state = !*state;
break; break;
default: default:
return false; return false;
} }
changed = (*state != new_state); changed = (*state != new_state);