remove now-unneeded monitor position field

main
Devin J. Pohly 2021-01-06 17:23:35 -05:00
parent e8ca8a8ac7
commit 6267593cc2
1 changed files with 1 additions and 12 deletions

13
dwl.c
View File

@ -176,7 +176,6 @@ struct Monitor {
double mfact; double mfact;
int nmaster; int nmaster;
Client *fullscreenclient; Client *fullscreenclient;
int position;
}; };
typedef struct { typedef struct {
@ -830,7 +829,6 @@ createmon(struct wl_listener *listener, void *data)
m = wlr_output->data = calloc(1, sizeof(*m)); m = wlr_output->data = calloc(1, sizeof(*m));
m->wlr_output = wlr_output; m->wlr_output = wlr_output;
m->tagset[0] = m->tagset[1] = 1; m->tagset[0] = m->tagset[1] = 1;
m->position = -1;
for (r = monrules; r < END(monrules); r++) { for (r = monrules; r < END(monrules); r++) {
if (!r->name || strstr(wlr_output->name, r->name)) { if (!r->name || strstr(wlr_output->name, r->name)) {
m->mfact = r->mfact; m->mfact = r->mfact;
@ -839,7 +837,6 @@ createmon(struct wl_listener *listener, void *data)
wlr_xcursor_manager_load(cursor_mgr, r->scale); wlr_xcursor_manager_load(cursor_mgr, r->scale);
m->lt[0] = m->lt[1] = r->lt; m->lt[0] = m->lt[1] = r->lt;
wlr_output_set_transform(wlr_output, r->rr); wlr_output_set_transform(wlr_output, r->rr);
m->position = r - monrules;
break; break;
} }
} }
@ -848,15 +845,7 @@ createmon(struct wl_listener *listener, void *data)
LISTEN(&wlr_output->events.frame, &m->frame, rendermon); LISTEN(&wlr_output->events.frame, &m->frame, rendermon);
LISTEN(&wlr_output->events.destroy, &m->destroy, cleanupmon); LISTEN(&wlr_output->events.destroy, &m->destroy, cleanupmon);
wl_list_for_each(moni, &mons, link) wl_list_insert(&mons, &m->link);
if (m->position > moni->position)
insertmon = moni;
if (insertmon) /* insertmon is the leftmost monitor to m */
wl_list_insert(&insertmon->link, &m->link);
else
wl_list_insert(&mons, &m->link);
wlr_output_enable(wlr_output, 1); wlr_output_enable(wlr_output, 1);
if (!wlr_output_commit(wlr_output)) if (!wlr_output_commit(wlr_output))
return; return;