aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2021-09-05 15:55:36 -0500
committerDevin J. Pohly <djpohly@gmail.com>2021-09-08 23:24:11 -0500
commit929d3d9569086963c7597dc1fcd38d59896278bc (patch)
tree914d21d3c4f716197b6f9ed1340c2dbb5aae58ec /dwl.c
parent40e45a336a2cef9fe76a5144f7da6ffa54110081 (diff)
use type enum to distinguish Client from LayerSurface
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/dwl.c b/dwl.c
index c4ca60f..08f7e32 100644
--- a/dwl.c
+++ b/dwl.c
@@ -65,10 +65,10 @@
/* enums */
enum { CurNormal, CurMove, CurResize }; /* cursor */
+enum { XDGShell, LayerShell, X11Managed, X11Unmanaged }; /* client types */
#ifdef XWAYLAND
enum { NetWMWindowTypeDialog, NetWMWindowTypeSplash, NetWMWindowTypeToolbar,
NetWMWindowTypeUtility, NetLast }; /* EWMH atoms */
-enum { XDGShell, X11Managed, X11Unmanaged }; /* client types */
#endif
typedef union {
@@ -87,6 +87,8 @@ typedef struct {
typedef struct Monitor Monitor;
typedef struct {
+ /* Must be first */
+ unsigned int type; /* XDGShell or X11* */
struct wl_list link;
struct wl_list flink;
struct wl_list slink;
@@ -103,7 +105,6 @@ typedef struct {
struct wlr_box geom; /* layout-relative, includes border */
Monitor *mon;
#ifdef XWAYLAND
- unsigned int type;
struct wl_listener activate;
struct wl_listener configure;
#endif
@@ -140,6 +141,8 @@ typedef struct {
} Keyboard;
typedef struct {
+ /* Must be first */
+ unsigned int type; /* LayerShell */
struct wlr_layer_surface_v1 *layer_surface;
struct wl_list link;
@@ -917,6 +920,7 @@ createlayersurface(struct wl_listener *listener, void *data)
}
layersurface = calloc(1, sizeof(LayerSurface));
+ layersurface->type = LayerShell;
LISTEN(&wlr_layer_surface->surface->events.commit,
&layersurface->surface_commit, commitlayersurfacenotify);
LISTEN(&wlr_layer_surface->events.destroy, &layersurface->destroy,