10 Commits

Author SHA1 Message Date
Leonardo Hernández Hernández 8653b27692 bump version to 0.4 2022-12-30 14:46:52 -06:00
Leonardo Hernández Hernández 932c1d45f2 remove --long from git-describe command 2022-12-30 14:46:34 -06:00
Leonardo Hernández Hernández dbe44e48c8 return early if selmon is not part of the output layout in dirtomon()
instead of checking twice
2022-12-30 14:31:56 -06:00
Leonardo Hernández Hernández 0b2c33248c simplify check in urgent()
we only care if it returned a client or not
2022-12-30 14:29:19 -06:00
Leonardo Hernández Hernández 56114f700f arrange monitor after updating fullscreen background and lock surfaces 2022-12-30 14:26:53 -06:00
Leonardo Hernández Hernández 71c7e4e1e5 also update locked_bg node position in updatemons() 2022-12-30 14:25:19 -06:00
Leonardo Hernández Hernández 72d29f1654 add blank lines to make updatemons() more readable 2022-12-30 14:21:46 -06:00
Leonardo Hernández Hernández e523c2b82b update comment about client_set_size() as no-op 2022-12-30 14:19:47 -06:00
Leonardo Hernández Hernández 6d0e3a5198 check if a client is resizing before checking if it's visible
It's not like it's noticeable, but theoretically this is faster
2022-12-30 14:15:21 -06:00
Leonardo Hernández Hernández 5347ed663d only mark pending resizes as completed checking the configure serial 2022-12-30 14:14:06 -06:00
2 changed files with 21 additions and 17 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
_VERSION = 0.4-rc3
VERSION = `git describe --long --tags --dirty 2>/dev/null || echo $(_VERSION)`
_VERSION = 0.4
VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)`
PKG_CONFIG = pkg-config
+19 -15
View File
@@ -766,9 +766,7 @@ commitnotify(struct wl_listener *listener, void *data)
c->isfloating ? resize(c, c->geom, 1) : arrange(c->mon);
/* mark a pending resize as completed */
if (c->resize && (c->resize <= c->surface.xdg->current.configure_serial
|| (c->surface.xdg->current.geometry.width == c->surface.xdg->pending.geometry.width
&& c->surface.xdg->current.geometry.height == c->surface.xdg->pending.geometry.height)))
if (c->resize && c->resize <= c->surface.xdg->current.configure_serial)
c->resize = 0;
}
@@ -1170,12 +1168,12 @@ Monitor *
dirtomon(enum wlr_direction dir)
{
struct wlr_output *next;
if (wlr_output_layout_get(output_layout, selmon->wlr_output)
&& (next = wlr_output_layout_adjacent_output(output_layout,
if (!wlr_output_layout_get(output_layout, selmon->wlr_output))
return selmon;
if ((next = wlr_output_layout_adjacent_output(output_layout,
dir, selmon->wlr_output, selmon->m.x, selmon->m.y)))
return next->data;
if (wlr_output_layout_get(output_layout, selmon->wlr_output)
&& (next = wlr_output_layout_farthest_output(output_layout,
if ((next = wlr_output_layout_farthest_output(output_layout,
dir ^ (WLR_DIRECTION_LEFT|WLR_DIRECTION_RIGHT),
selmon->wlr_output, selmon->m.x, selmon->m.y)))
return next->data;
@@ -1836,7 +1834,7 @@ rendermon(struct wl_listener *listener, void *data)
/* Render if no XDG clients have an outstanding resize and are visible on
* this monitor. */
wl_list_for_each(c, &clients, link)
if (client_is_rendered_on_mon(c, m) && (!c->isfloating && c->resize) && !client_is_stopped(c))
if (c->resize && !c->isfloating && client_is_rendered_on_mon(c, m) && !client_is_stopped(c))
goto skip;
if (!wlr_scene_output_commit(m->scene_output))
return;
@@ -1877,7 +1875,7 @@ resize(Client *c, struct wlr_box geo, int interact)
wlr_scene_node_set_position(&c->border[2]->node, 0, c->bw);
wlr_scene_node_set_position(&c->border[3]->node, c->geom.width - c->bw, c->bw);
/* wlroots makes this a no-op if size hasn't changed */
/* this is a no-op if size hasn't changed */
c->resize = client_set_size(c, c->geom.width - 2 * c->bw,
c->geom.height - 2 * c->bw);
}
@@ -2461,9 +2459,14 @@ updatemons(struct wl_listener *listener, void *data)
if (m->wlr_output->enabled
&& !wlr_output_layout_get(output_layout, m->wlr_output))
wlr_output_layout_add_auto(output_layout, m->wlr_output);
/* Now that we update the output layout we can get its box */
wlr_output_layout_get_box(output_layout, NULL, &sgeom);
/* Make sure the clients are hidden when dwl is locked */
wlr_scene_node_set_position(&locked_bg->node, sgeom.x, sgeom.y);
wlr_scene_rect_set_size(locked_bg, sgeom.width, sgeom.height);
wl_list_for_each(m, &mons, link) {
if (!m->wlr_output->enabled)
continue;
@@ -2473,10 +2476,6 @@ updatemons(struct wl_listener *listener, void *data)
wlr_output_layout_get_box(output_layout, m->wlr_output, &(m->m));
wlr_output_layout_get_box(output_layout, m->wlr_output, &(m->w));
wlr_scene_output_set_position(m->scene_output, m->m.x, m->m.y);
/* Calculate the effective monitor geometry to use for clients */
arrangelayers(m);
/* Don't move clients to the left output when plugging monitors */
arrange(m);
wlr_scene_node_set_position(&m->fullscreen_bg->node, m->m.x, m->m.y);
wlr_scene_rect_set_size(m->fullscreen_bg, m->m.width, m->m.height);
@@ -2488,6 +2487,11 @@ updatemons(struct wl_listener *listener, void *data)
m->m.height);
}
/* Calculate the effective monitor geometry to use for clients */
arrangelayers(m);
/* Don't move clients to the left output when plugging monitors */
arrange(m);
config_head->state.enabled = 1;
config_head->state.mode = m->wlr_output->current_mode;
config_head->state.x = m->m.x;
@@ -2519,8 +2523,8 @@ urgent(struct wl_listener *listener, void *data)
{
struct wlr_xdg_activation_v1_request_activate_event *event = data;
Client *c = NULL;
int type = toplevel_from_wlr_surface(event->surface, &c, NULL);
if (type >= 0 && type != LayerShell && c != focustop(selmon)) {
toplevel_from_wlr_surface(event->surface, &c, NULL);
if (c && c != focustop(selmon)) {
c->isurgent = 1;
printstatus();
}