Move sgeom assignment

There is no need to repeat this. This needs to be reculalculated in my
output-management implementation too, and since I'm already calling
updatemons, this patch avoids having to repeat the assignment again.
This commit is contained in:
Guido Cella 2020-10-17 20:15:59 +02:00
parent d8f752c9b4
commit f21d3796b8

3
dwl.c
View File

@ -695,7 +695,6 @@ cleanupmon(struct wl_listener *listener, void *data)
wl_list_remove(&m->link); wl_list_remove(&m->link);
wlr_output_layout_remove(output_layout, m->wlr_output); wlr_output_layout_remove(output_layout, m->wlr_output);
sgeom = *wlr_output_layout_get_box(output_layout, NULL);
updatemons(); updatemons();
wl_list_for_each(newmon, &mons, link) { wl_list_for_each(newmon, &mons, link) {
@ -831,7 +830,6 @@ createmon(struct wl_listener *listener, void *data)
* output (such as DPI, scale factor, manufacturer, etc). * output (such as DPI, scale factor, manufacturer, etc).
*/ */
wlr_output_layout_add_auto(output_layout, wlr_output); wlr_output_layout_add_auto(output_layout, wlr_output);
sgeom = *wlr_output_layout_get_box(output_layout, NULL);
for (size_t i = 0; i < nlayers; ++i) for (size_t i = 0; i < nlayers; ++i)
wl_list_init(&m->layers[i]); wl_list_init(&m->layers[i]);
@ -2151,6 +2149,7 @@ unmapnotify(struct wl_listener *listener, void *data)
void void
updatemons() updatemons()
{ {
sgeom = *wlr_output_layout_get_box(output_layout, NULL);
Monitor *m; Monitor *m;
wl_list_for_each(m, &mons, link) { wl_list_for_each(m, &mons, link) {
/* Get the effective monitor geometry to use for surfaces */ /* Get the effective monitor geometry to use for surfaces */