Update monfig

This commit is contained in:
Palanix 2024-02-19 17:33:08 +01:00
parent ca13e27743
commit 3e1e9fb294
No known key found for this signature in database
GPG Key ID: 439CD6BD9905FAC5

View File

@ -1,4 +1,4 @@
From 0cac49a991deed2482077a4614fc911e4fb2c38e Mon Sep 17 00:00:00 2001 From 00d302a8196fd4d8d006d78c10e08014b220403e Mon Sep 17 00:00:00 2001
From: Palanix <palanixyt@gmail.com> From: Palanix <palanixyt@gmail.com>
Date: Mon, 4 Apr 2022 16:08:29 +0200 Date: Mon, 4 Apr 2022 16:08:29 +0200
Subject: [PATCH] Updated patch now allowing setting x and y Subject: [PATCH] Updated patch now allowing setting x and y
@ -8,15 +8,15 @@ Content-Transfer-Encoding: 8bit
Co-authored-by: Leonardo Hernández Hernández <leohdz172@proton.me Co-authored-by: Leonardo Hernández Hernández <leohdz172@proton.me
--- ---
config.def.h | 14 ++++++++------ config.def.h | 15 +++++++++------
dwl.c | 15 ++++++++++----- dwl.c | 18 +++++++++++++-----
2 files changed, 18 insertions(+), 11 deletions(-) 2 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/config.def.h b/config.def.h diff --git a/config.def.h b/config.def.h
index 9009517..2365691 100644 index 9009517..1091e6c 100644
--- a/config.def.h --- a/config.def.h
+++ b/config.def.h +++ b/config.def.h
@@ -36,15 +36,17 @@ static const Layout layouts[] = { @@ -36,15 +36,18 @@ static const Layout layouts[] = {
{ "[M]", monocle }, { "[M]", monocle },
}; };
@ -32,16 +32,17 @@ index 9009517..2365691 100644
- { "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 }, - { "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
+ /* name mfact nmaster scale layout rotate/reflect x y resx resy rate adaptive*/ + /* name mfact nmaster scale layout rotate/reflect x y resx resy rate adaptive*/
+ /* example of a HiDPI laptop monitor at 120Hz: + /* example of a HiDPI laptop monitor at 120Hz:
+ { "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0, 0, 0, 120.000, 1}, + { "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0, 0, 0, 120.000f, 1},
*/ */
/* defaults */ /* defaults */
- { NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 }, - { NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
+ { NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0, 0, 0, 0, 1}, + { NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0, 0, 0, 0.0f, 1},
+ // Note that when you do set a custom monrule it has to have resx/resy and refresh rate > 0 otherwise you will not have a displayed screen.
}; };
/* keyboard */ /* keyboard */
diff --git a/dwl.c b/dwl.c diff --git a/dwl.c b/dwl.c
index fa76db2..85cd45b 100644 index fa76db2..ef2d2f1 100644
--- a/dwl.c --- a/dwl.c
+++ b/dwl.c +++ b/dwl.c
@@ -212,6 +212,10 @@ typedef struct { @@ -212,6 +212,10 @@ typedef struct {
@ -55,13 +56,16 @@ index fa76db2..85cd45b 100644
} MonitorRule; } MonitorRule;
typedef struct { typedef struct {
@@ -876,15 +880,16 @@ createmon(struct wl_listener *listener, void *data) @@ -876,15 +880,19 @@ createmon(struct wl_listener *listener, void *data)
strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol)); strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
wlr_output_state_set_scale(&state, r->scale); wlr_output_state_set_scale(&state, r->scale);
wlr_output_state_set_transform(&state, r->rr); wlr_output_state_set_transform(&state, r->rr);
+ +
+ if(r->name)
+ wlr_output_state_set_custom_mode(&state, r->resx, r->resy, + wlr_output_state_set_custom_mode(&state, r->resx, r->resy,
+ r->rate > 0 ? (int)(r->rate * 1000) : 0); + r->rate > 0 ? (int)(r->rate * 1000) : 0);
+ else
+ wlr_output_state_set_mode(&state, wlr_output_preferred_mode(wlr_output));
+ +
+ wlr_output_state_set_adaptive_sync_enabled(&state, r->adaptive); + wlr_output_state_set_adaptive_sync_enabled(&state, r->adaptive);
break; break;