From 2ff92ffad11cad902dad037c24780e0dbf451551 Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Sun, 5 May 2024 14:16:53 +0530 Subject: Revert "monfig patch" This reverts commit 18e363b5bb655859660eb6177fadc67192914f61. --- dwl.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'dwl.c') diff --git a/dwl.c b/dwl.c index 83caffe..a1c7ebf 100644 --- a/dwl.c +++ b/dwl.c @@ -217,11 +217,6 @@ typedef struct { const Layout *lt; enum wl_output_transform rr; int x, y; - int resx; - int resy; - float rate; - int mode; - int adaptive; } MonitorRule; typedef struct { @@ -922,7 +917,6 @@ createmon(struct wl_listener *listener, void *data) /* This event is raised by the backend when a new output (aka a display or * monitor) becomes available. */ struct wlr_output *wlr_output = data; - struct wlr_output_mode *mode = wl_container_of(wlr_output->modes.next, mode, link); const MonitorRule *r; size_t i; struct wlr_output_state state; @@ -951,23 +945,16 @@ createmon(struct wl_listener *listener, void *data) strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol)); wlr_output_state_set_scale(&state, r->scale); wlr_output_state_set_transform(&state, r->rr); - - wlr_output_state_set_adaptive_sync_enabled(&state, r->adaptive); - - if(r->mode == -1) - wlr_output_state_set_custom_mode(&state, r->resx, r->resy, - (int) (r->rate > 0 ? r->rate * 1000 : 0)); - else if (!wl_list_empty(&wlr_output->modes)) { - for (int j = 0; j < r->mode; j++) { - mode = wl_container_of(mode->link.next, mode, link); - } - wlr_output_state_set_mode(&state, mode); - } - break; } } + /* The mode is a tuple of (width, height, refresh rate), and each + * monitor supports only a specific set of modes. We just pick the + * monitor's preferred mode; a more sophisticated compositor would let + * the user configure it. */ + wlr_output_state_set_mode(&state, wlr_output_preferred_mode(wlr_output)); + /* Set up event listeners */ LISTEN(&wlr_output->events.frame, &m->frame, rendermon); LISTEN(&wlr_output->events.destroy, &m->destroy, cleanupmon); -- cgit v1.2.3