tiled focus
This commit is contained in:
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user