mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 21:05:58 +01:00
xwayland: Simplify net_wm_edges_to_wlr
This commit is contained in:
parent
9e5ad7a845
commit
4f920a206c
1 changed files with 9 additions and 21 deletions
|
@ -1147,38 +1147,26 @@ static void xwm_handle_surface_id_message(struct wlr_xwm *xwm,
|
||||||
#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;
|
|
||||||
|
|
||||||
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;
|
return WLR_EDGE_TOP | WLR_EDGE_LEFT;
|
||||||
break;
|
|
||||||
case _NET_WM_MOVERESIZE_SIZE_TOP:
|
case _NET_WM_MOVERESIZE_SIZE_TOP:
|
||||||
edges = WLR_EDGE_TOP;
|
return WLR_EDGE_TOP;
|
||||||
break;
|
|
||||||
case _NET_WM_MOVERESIZE_SIZE_TOPRIGHT:
|
case _NET_WM_MOVERESIZE_SIZE_TOPRIGHT:
|
||||||
edges = WLR_EDGE_TOP | WLR_EDGE_RIGHT;
|
return WLR_EDGE_TOP | WLR_EDGE_RIGHT;
|
||||||
break;
|
|
||||||
case _NET_WM_MOVERESIZE_SIZE_RIGHT:
|
case _NET_WM_MOVERESIZE_SIZE_RIGHT:
|
||||||
edges = WLR_EDGE_RIGHT;
|
return WLR_EDGE_RIGHT;
|
||||||
break;
|
|
||||||
case _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT:
|
case _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT:
|
||||||
edges = WLR_EDGE_BOTTOM | WLR_EDGE_RIGHT;
|
return WLR_EDGE_BOTTOM | WLR_EDGE_RIGHT;
|
||||||
break;
|
|
||||||
case _NET_WM_MOVERESIZE_SIZE_BOTTOM:
|
case _NET_WM_MOVERESIZE_SIZE_BOTTOM:
|
||||||
edges = WLR_EDGE_BOTTOM;
|
return WLR_EDGE_BOTTOM;
|
||||||
break;
|
|
||||||
case _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT:
|
case _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT:
|
||||||
edges = WLR_EDGE_BOTTOM | WLR_EDGE_LEFT;
|
return WLR_EDGE_BOTTOM | WLR_EDGE_LEFT;
|
||||||
break;
|
|
||||||
case _NET_WM_MOVERESIZE_SIZE_LEFT:
|
case _NET_WM_MOVERESIZE_SIZE_LEFT:
|
||||||
edges = WLR_EDGE_LEFT;
|
return WLR_EDGE_LEFT;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
return WLR_EDGE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return edges;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xwm_handle_net_wm_moveresize_message(struct wlr_xwm *xwm,
|
static void xwm_handle_net_wm_moveresize_message(struct wlr_xwm *xwm,
|
||||||
|
|
Loading…
Reference in a new issue