commit ee2b3af1cacce8052e03a778316d06a8733ec5b9
parent 47bbdc6034d934dcbe857edbc8495e979b3807c9
Author: Devin J. Pohly <djpohly@gmail.com>
Date: Thu, 23 Apr 2020 23:44:24 -0500
configure monitor rotation/reflection
Diffstat:
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
@@ -88,7 +88,6 @@ number of ways:
- XWayland
- HiDPI works, but multi-DPI is not as nice as sway, depending on the scale
factors involved. Perhaps scaling filters are needed?
-- Monitor rotation/transform is not set up yet
## Acknowledgements
diff --git a/config.def.h b/config.def.h
@@ -15,12 +15,12 @@ static const Layout layouts[] = {
/* monitors */
static const MonitorRule monrules[] = {
- /* name mfact nmaster scale layout */
+ /* name mfact nmaster scale layout rotate/reflect */
/* example of a HiDPI laptop monitor:
- { "eDP-1", 0.5, 1, 2, &layouts[0] },
+ { "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
*/
/* defaults */
- { NULL, 0.55, 1, 1, &layouts[0] },
+ { NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
};
/* keyboard */
diff --git a/dwl.c b/dwl.c
@@ -112,6 +112,7 @@ typedef struct {
int nmaster;
float scale;
const Layout *lt;
+ enum wl_output_transform rr;
} MonitorRule;
/* Used to move all of the data necessary to render a surface from the top-level
@@ -339,6 +340,7 @@ createmon(struct wl_listener *listener, void *data)
wlr_output_set_scale(wlr_output, monrules[i].scale);
wlr_xcursor_manager_load(cursor_mgr, monrules[i].scale);
m->lt[0] = m->lt[1] = monrules[i].lt;
+ wlr_output_set_transform(wlr_output, monrules[i].rr);
break;
}
/* Sets up a listener for the frame notify event. */