mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-10-26 17:54:17 +00:00
Reintroduce monfig patch
This commit is contained in:
parent
b2581e4465
commit
802a2d1af1
@ -1,8 +0,0 @@
|
||||
### Description
|
||||
Allows more monitor configuration in config.h
|
||||
|
||||
### Download
|
||||
- [2022-04-04](https://github.com/djpohly/dwl/compare/main...PalanixYT:monfig.patch)
|
||||
|
||||
### Authors
|
||||
- [Palanix](https://github.com/PalanixYT)
|
||||
82
monfig/monfig.patch
Normal file
82
monfig/monfig.patch
Normal file
@ -0,0 +1,82 @@
|
||||
From 0cac49a991deed2482077a4614fc911e4fb2c38e Mon Sep 17 00:00:00 2001
|
||||
From: Palanix <palanixyt@gmail.com>
|
||||
Date: Mon, 4 Apr 2022 16:08:29 +0200
|
||||
Subject: [PATCH] Updated patch now allowing setting x and y
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Co-authored-by: Leonardo Hernández Hernández <leohdz172@proton.me
|
||||
---
|
||||
config.def.h | 14 ++++++++------
|
||||
dwl.c | 15 ++++++++++-----
|
||||
2 files changed, 18 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index 9009517..2365691 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -36,15 +36,17 @@ static const Layout layouts[] = {
|
||||
{ "[M]", monocle },
|
||||
};
|
||||
|
||||
-/* monitors */
|
||||
-/* NOTE: ALWAYS add a fallback rule, even if you are completely sure it won't be used */
|
||||
+/* monitors
|
||||
+ * The order in which monitors are defined determines their position.
|
||||
+ * Non-configured monitors are always added to the left.
|
||||
+ * NOTE: ALWAYS add a fallback rule, even if you are completely sure it won't be used */
|
||||
static const MonitorRule monrules[] = {
|
||||
- /* name mfact nmaster scale layout rotate/reflect x y */
|
||||
- /* example of a HiDPI laptop monitor:
|
||||
- { "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*/
|
||||
+ /* 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},
|
||||
*/
|
||||
/* defaults */
|
||||
- { 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},
|
||||
};
|
||||
|
||||
/* keyboard */
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index fa76db2..85cd45b 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -212,6 +212,10 @@ typedef struct {
|
||||
const Layout *lt;
|
||||
enum wl_output_transform rr;
|
||||
int x, y;
|
||||
+ int resx;
|
||||
+ int resy;
|
||||
+ float rate;
|
||||
+ int adaptive;
|
||||
} MonitorRule;
|
||||
|
||||
typedef struct {
|
||||
@@ -876,15 +880,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_custom_mode(&state, r->resx, r->resy,
|
||||
+ r->rate > 0 ? (int)(r->rate * 1000) : 0);
|
||||
+
|
||||
+ wlr_output_state_set_adaptive_sync_enabled(&state, r->adaptive);
|
||||
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));
|
||||
+ wlr_output_init_render(wlr_output, alloc, drw);
|
||||
|
||||
/* Set up event listeners */
|
||||
LISTEN(&wlr_output->events.frame, &m->frame, rendermon);
|
||||
--
|
||||
2.43.2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user