workspaces

This commit is contained in:
2026-05-11 11:20:12 +07:00
parent 87cbffd414
commit 13e4732f90
6 changed files with 14 additions and 10 deletions
+2 -2
View File
@@ -8,10 +8,10 @@ OBJ_FILES = $(SRC_FILES:src/%.c=build/%.o)
all: proto $(TARGET)
xdg-shell-protocol.h:
$(WAYLAND_SCANNER) server-header $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.h
$(WAYLAND_SCANNER) server-header $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
wlr-layer-shell-unstable-v1-protocol.h:
$(WAYLAND_SCANNER) server-header ./protocols/wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-protocol.h
$(WAYLAND_SCANNER) server-header ./protocols/wlr-layer-shell-unstable-v1.xml $@
proto: xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h
+2 -2
View File
@@ -8,10 +8,10 @@ OBJ_FILES = $(SRC_FILES:src/%.c=build/%.o)
all: proto $(TARGET)
xdg-shell-protocol.h:
$(WAYLAND_SCANNER) server-header $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.h
$(WAYLAND_SCANNER) server-header $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml ${.TARGET}
wlr-layer-shell-unstable-v1-protocol.h:
$(WAYLAND_SCANNER) server-header ./protocols/wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-protocol.h
$(WAYLAND_SCANNER) server-header ./protocols/wlr-layer-shell-unstable-v1.xml ${.TARGET}
proto: xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h
+1 -1
View File
@@ -16,8 +16,8 @@ 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 };
static const float unfocused_bc[4] = { 0.28, 0.28, 0.28, 1.0 };
#define STACK_SIZE 0.5
#define STACK_COUNT 1
#define STACK_SIZE 0.5
#define OUTPUT_GAP 10
#define LAYOUT_GAP 5
+1 -1
View File
@@ -118,7 +118,7 @@ setup(absn_server *server)
LISTEN(server->new_xdg_popup, new_xdg_popup,
server->xdg_shell->events.new_popup);
/* cursor setup */
/* cursor */
server->cursor = wlr_cursor_create();
wlr_cursor_attach_output_layout(server->cursor, server->output_layout);
+8 -2
View File
@@ -1,3 +1,5 @@
#include <wlr/util/log.h>
#include "config.h"
#include "toplevel.h"
#include "types.h"
@@ -50,12 +52,16 @@ layout_arrange(struct absn_output *output)
int32_t total_lg;
int mcount = output->workspace->count;
int msize = output->workspace->size;
float msize = output->workspace->size;
int32_t main_stack_width = (toplevels_count <= mcount) ?
output->geom.width - 2 * og :
msize * (output->geom.width - 2 * og);
int32_t w = output->geom.width - main_stack_width - 2 * og - lg;
wlr_log(WLR_ERROR, "%d, %d", main_stack_width, w);
int32_t pure_h;
int32_t h;
int32_t cur_h;
@@ -130,7 +136,7 @@ layout_arrange(struct absn_output *output)
og;
new_geom.y = output->geom.y + dy;
new_geom.width = w;
new_geom.height = h;
new_geom.height = cur_h;
toplevel_set_geom(toplevel, &new_geom);
-2
View File
@@ -50,8 +50,6 @@ new_output(struct wl_listener *listener, void *data)
if (!server->workspaces[i].output) {
server->workspaces[i].output = output;
output->workspace = &server->workspaces[i];
output->workspace->count = STACK_COUNT;
output->workspace->count = STACK_SIZE;
break;
}
}