layers, tags and make

This commit is contained in:
2026-05-10 20:06:05 +07:00
parent 450234522d
commit afbd0c109c
17 changed files with 263 additions and 73 deletions
+6 -4
View File
@@ -1,14 +1,16 @@
#ifndef __CONFIG_H_
#define __CONFIG_H_
#include "callbacks.h"
#include "keybinds.h"
#include "types.h"
#define CURSOR_MOD WLR_MODIFIER_ALT
#define CURSOR_MOVE_BUTTON BTN_LEFT
#define CURSOR_RESIZE_BUTTON BTN_RIGHT
#define TOPLEVEL_BW 1
#define TOPLEVEL_BW 2
static const float bgcolor[4] = { 0.0, 0.0, 0.0, 1.0 };
static const float focused_bc[4] = { 0.0, 0.0, 1.0, 1.0 };
static const float urgent_bc[4] = { 1.0, 0.0, 0.0, 1.0 };
@@ -17,8 +19,8 @@ static const float unfocused_bc[4] = { 0.28, 0.28, 0.28, 1.0 };
#define MSTACK_SIZE 1
#define MSTACK_WIDTH 0.5
#define OUTPUT_GAP 0
#define LAYOUT_GAP 0
#define OUTPUT_GAP 10
#define LAYOUT_GAP 5
#define ALT WLR_MODIFIER_ALT
#define CTRL WLR_MODIFIER_CTRL
+1
View File
@@ -6,6 +6,7 @@
void layer_surface_map(struct wl_listener *listener, void *data);
void layer_surface_unmap(struct wl_listener *listener, void *data);
void layer_surface_commit(struct wl_listener *listener, void *data);
void layer_surface_new_popup(struct wl_listener *listener, void *data);
void layer_surface_destroy(struct wl_listener *listener, void *data);
#endif
+1
View File
@@ -13,6 +13,7 @@ void toplevel_get_geom(absn_toplevel *toplevel);
void toplevel_set_pos(absn_toplevel *toplevel, int32_t x, int32_t y);
void toplevel_set_size(absn_toplevel *toplevel, int32_t width, int32_t height);
void toplevel_set_geom(absn_toplevel *toplevel, struct wlr_box *geom);
void toplevel_set_floating(absn_toplevel *toplevel, bool floating);
void toplevel_set_fullscreen(absn_toplevel *toplevel, bool fullscreen);
void toplevel_set_border_color(absn_toplevel *toplevel, const float color[4]);
+42 -7
View File
@@ -55,6 +55,7 @@ enum {
enum {
TOPLEVEL_XDG,
TOPLEVEL_X11,
LAYER_SURFACE,
};
/* layers for wlr layer shell */
@@ -63,11 +64,30 @@ enum {
LAYER_BOTTOM,
LAYER_TILE,
LAYER_FLOAT,
LAYER_FULLSCREEN,
LAYER_TOP,
LAYER_OVERLAY,
LAYERS_COUNT,
};
static const int layermap[] = {
LAYER_BACKGROUND,
LAYER_BOTTOM,
LAYER_TOP,
LAYER_FULLSCREEN,
LAYER_OVERLAY,
LAYER_LOCK,
LAYERS_COUNT,
};
enum {
LAYOUT_FLOAT,
LAYOUT_TILE,
LAYOUT_TILELEFT,
LAYOUT_TILETOP,
LAYOUT_TILEBOTTOM,
LAYOUT_SPIRAL,
LAYOUT_DWINDLE,
LAYOUT_MAX,
LAYOUT_VGRID,
LAYOUT_HGRID,
};
typedef struct absn_output absn_output;
@@ -81,6 +101,7 @@ typedef struct {
struct wlr_compositor *compositor;
struct wlr_scene *scene;
struct wlr_scene_output_layout *scene_layout;
struct wlr_scene_rect *bg;
struct wlr_xdg_shell *xdg_shell;
struct wl_listener new_xdg_toplevel;
@@ -88,7 +109,7 @@ typedef struct {
struct wlr_xdg_decoration_manager_v1 *xdg_deco_mgr;
struct wl_listener new_xdg_deco;
struct wlr_layer_shell *layer_shell;
struct wlr_layer_shell_v1 *layer_shell;
struct wl_listener new_layer_surface;
struct wlr_scene_tree *layers[LAYERS_COUNT];
@@ -132,6 +153,11 @@ typedef struct {
struct wl_listener mgr_test;
} absn_server;
typedef struct {
int layout;
uint32_t id;
} absn_tag;
struct absn_output {
struct wl_list link;
absn_server *server;
@@ -146,20 +172,28 @@ struct absn_output {
float mstack_width;
int mstack_count;
absn_tag *tags;
uint32_t active_tags;
struct wl_list layers[4];
};
typedef struct {
struct wl_list link;
absn_server *server;
absn_output *output;
int type; /* LAYER_SURFACE */
struct wlr_scene_tree *scene_tree;
struct wlr_scene_tree *scene_layer;
struct wlr_scene_tree *popups;
struct wlr_scene_layer_surface_v1 *scene_layer;
struct wlr_layer_surface_v1 *wlr;
struct wl_listener map;
struct wl_listener unmap;
struct wl_listener commit;
struct wl_listener new_popup;
struct wl_listener destroy;
} absn_layer_surface;
@@ -176,7 +210,8 @@ struct absn_toplevel {
struct wlr_scene_rect *border[4];
struct wlr_xdg_toplevel_decoration_v1 *deco;
bool tiled, floating, fullscreen, maximized;
bool floating;
bool fullscreen;
bool urgent;
uint32_t resizing;