mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-10-26 17:54:14 +00:00
feat: floating window pos adjust change of monitor pos
This commit is contained in:
parent
ea263a0ed5
commit
d45e903893
16
dwl.c
16
dwl.c
@ -807,9 +807,6 @@ closemon(Monitor *m)
|
|||||||
}
|
}
|
||||||
|
|
||||||
wl_list_for_each(c, &clients, link) {
|
wl_list_for_each(c, &clients, link) {
|
||||||
if (c->isfloating && c->geom.x > m->m.width)
|
|
||||||
resize(c, (struct wlr_box){.x = c->geom.x - m->w.width, .y = c->geom.y,
|
|
||||||
.width = c->geom.width, .height = c->geom.height}, 0);
|
|
||||||
if (c->mon == m)
|
if (c->mon == m)
|
||||||
setmon(c, selmon, c->tags);
|
setmon(c, selmon, c->tags);
|
||||||
}
|
}
|
||||||
@ -2850,6 +2847,7 @@ updatemons(struct wl_listener *listener, void *data)
|
|||||||
Client *c;
|
Client *c;
|
||||||
struct wlr_output_configuration_head_v1 *config_head;
|
struct wlr_output_configuration_head_v1 *config_head;
|
||||||
Monitor *m;
|
Monitor *m;
|
||||||
|
int oldx, oldy;
|
||||||
|
|
||||||
/* First remove from the layout the disabled monitors */
|
/* First remove from the layout the disabled monitors */
|
||||||
wl_list_for_each(m, &mons, link) {
|
wl_list_for_each(m, &mons, link) {
|
||||||
@ -2884,9 +2882,21 @@ updatemons(struct wl_listener *listener, void *data)
|
|||||||
continue;
|
continue;
|
||||||
config_head = wlr_output_configuration_head_v1_create(config, m->wlr_output);
|
config_head = wlr_output_configuration_head_v1_create(config, m->wlr_output);
|
||||||
|
|
||||||
|
oldx = m->m.x;
|
||||||
|
oldy = m->m.y;
|
||||||
|
|
||||||
/* Get the effective monitor geometry to use for surfaces */
|
/* Get the effective monitor geometry to use for surfaces */
|
||||||
wlr_output_layout_get_box(output_layout, m->wlr_output, &m->m);
|
wlr_output_layout_get_box(output_layout, m->wlr_output, &m->m);
|
||||||
m->w = m->m;
|
m->w = m->m;
|
||||||
|
|
||||||
|
wl_list_for_each(c, &clients, link) {
|
||||||
|
if (c->isfloating && c->mon == m) {
|
||||||
|
c->geom.x += (m->m.x - oldx);
|
||||||
|
c->geom.y += (m->m.y - oldy);
|
||||||
|
resize(c, c->geom, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wlr_scene_output_set_position(m->scene_output, m->m.x, m->m.y);
|
wlr_scene_output_set_position(m->scene_output, m->m.x, m->m.y);
|
||||||
|
|
||||||
wlr_scene_node_set_position(&m->fullscreen_bg->node, m->m.x, m->m.y);
|
wlr_scene_node_set_position(&m->fullscreen_bg->node, m->m.x, m->m.y);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user