tiled focus

This commit is contained in:
2026-04-26 15:08:37 +07:00
parent 67d379e283
commit 9d8dff3372
2 changed files with 13 additions and 2 deletions
+11
View File
@@ -3,6 +3,7 @@
#include "types.h"
#include "absinthe-toplevel.h"
#include "layout.h"
void reset_cursor_mode(struct absinthe_server *server)
{
@@ -30,6 +31,11 @@ static void process_cursor_move(struct absinthe_server *server) {
toplevel->geometry.x = new_x;
toplevel->geometry.y = new_y;
absinthe_toplevel_set_position(toplevel, new_x, new_y);
if (toplevel->tiled) {
toplevel->tiled = false;
layout_arrange(toplevel->output);
}
}
static void apply_resize(struct absinthe_toplevel *toplevel, struct wlr_box *new_geometry)
@@ -72,6 +78,11 @@ static void process_cursor_resize(struct absinthe_server *server) {
if (toplevel->fullscreen)
absinthe_toplevel_set_fullscreen(toplevel, false);
if (toplevel->tiled) {
toplevel->tiled = false;
layout_arrange(toplevel->output);
}
int32_t new_x, new_y, new_width, new_height;
new_x = server->grabbed_geometry.x;
new_y = server->grabbed_geometry.y;
+2 -2
View File
@@ -10,7 +10,7 @@ void layout_arrange(struct absinthe_output *output)
struct absinthe_toplevel *toplevel;
size_t toplevels_count = 0;
wl_list_for_each(toplevel, &output->server->toplevels, link) {
if (toplevel->tiled && toplevel->output == output) {
if (toplevel->output == output && toplevel->tiled) {
toplevels_count++;
wlr_scene_node_set_enabled(&toplevel->scene_tree->node, true);
}
@@ -23,7 +23,7 @@ void layout_arrange(struct absinthe_output *output)
if (toplevels_count == 1) {
wl_list_for_each(toplevel, &output->server->toplevels, link) {
if (toplevel->output == output)
if (toplevel->output == output && toplevel->tiled)
break;
}
toplevel->geometry.x = output->geometry.x + output_gap;