aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2024-05-05 14:16:53 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2024-05-05 14:16:53 +0530
commit2ff92ffad11cad902dad037c24780e0dbf451551 (patch)
treeecdf0fd545460949085a1b9b10923a3eaf08e9e7 /dwl.c
parentc17629aaa71380618c356e8083c7b38a756948d8 (diff)
Revert "monfig patch"
This reverts commit 18e363b5bb655859660eb6177fadc67192914f61.
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c25
1 files changed, 6 insertions, 19 deletions
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);