mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 21:05:58 +01:00
xwayland: minor code style fixes
This commit is contained in:
parent
ee43ef3c9d
commit
1fdaaf697a
1 changed files with 52 additions and 52 deletions
104
xwayland/xwm.c
104
xwayland/xwm.c
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue