Skip to content

Commit

Permalink
Revert "Add additional monitor configuration patch"
Browse files Browse the repository at this point in the history
This reverts commit bced206.
  • Loading branch information
Carl-github-acc committed Sep 8, 2023
1 parent 85c9271 commit c08d73c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 140 deletions.
12 changes: 5 additions & 7 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,14 @@ static const Layout layouts[] = {
{ "[M]", monocle },
};

/* monitors
* The order in which monitors are defined determines their position.
* Non-configured monitors are always added to the left. */
/* monitors */
static const MonitorRule monrules[] = {
/* 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},
/* name mfact nmaster scale layout rotate/reflect x y */
/* example of a HiDPI laptop monitor:
{ "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
*/
/* defaults */
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0, 0, 0, 0, 1},
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
};

/* keyboard */
Expand Down
17 changes: 7 additions & 10 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,16 @@ static const Layout layouts[] = {
{ "[M]", monocle },
};


/* monitors
* The order in which monitors are defined determines their position.
* Non-configured monitors are always added to the left. */
/* monitors */
static const MonitorRule monrules[] = {
/* 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},
/* name mfact nmaster scale layout rotate/reflect x y */
/* example of a HiDPI laptop monitor:
{ "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
*/
{ "DP-3", 0.5, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0, 2560, 1440, 165.080002, 1 },
{ "DP-4", 0.5, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 2560, 0, 2560, 1440, 59.951000, 0 },
{ "DP-3", 0.5, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0 },
{ "DP-4", 0.5, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 2560, 0 },
/* defaults */
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0, 0, 0, 0, 1},
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
};

/* keyboard */
Expand Down
25 changes: 13 additions & 12 deletions dwl.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,6 @@ typedef struct {
const Layout *lt;
enum wl_output_transform rr;
int x, y;
int resx;
int resy;
float rate;
int adaptive;
} MonitorRule;

typedef struct {
Expand Down Expand Up @@ -1014,6 +1010,7 @@ createmon(struct wl_listener *listener, void *data)
m->wlr_output = wlr_output;

wl_list_init(&m->dwl_ipc_outputs);
wlr_output_init_render(wlr_output, alloc, drw);

/* Initialize monitor state using configured rules */
for (i = 0; i < LENGTH(m->layers); i++)
Expand All @@ -1032,16 +1029,17 @@ createmon(struct wl_listener *listener, void *data)
wlr_xcursor_manager_load(cursor_mgr, r->scale);
m->lt[0] = m->lt[1] = r->lt;
wlr_output_set_transform(wlr_output, r->rr);

wlr_output_set_custom_mode(wlr_output, r->resx, r->resy,
r->rate > 0 ? (int)((r->rate * 1000) + 0.5) : 0);

wlr_output_enable_adaptive_sync(wlr_output, r->adaptive);
m->m.x = r->x;
m->m.y = r->y;
break;
}
}

wlr_output_init_render(wlr_output, alloc, drw);
/* 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_set_mode(wlr_output, wlr_output_preferred_mode(wlr_output));

/* Set up event listeners */
LISTEN(&wlr_output->events.frame, &m->frame, rendermon);
Expand All @@ -1051,6 +1049,9 @@ createmon(struct wl_listener *listener, void *data)
if (!wlr_output_commit(wlr_output))
return;

/* Try to enable adaptive sync, note that not all monitors support it.
* wlr_output_commit() will deactivate it in case it cannot be enabled */
wlr_output_enable_adaptive_sync(wlr_output, 1);
wlr_output_commit(wlr_output);

wl_list_insert(&mons, &m->link);
Expand All @@ -1075,10 +1076,10 @@ createmon(struct wl_listener *listener, void *data)
* output (such as DPI, scale factor, manufacturer, etc).
*/
m->scene_output = wlr_scene_output_create(scene, wlr_output);
if (r->x < 0 || r->y < 0)
if (m->m.x < 0 || m->m.y < 0)
wlr_output_layout_add_auto(output_layout, wlr_output);
else
wlr_output_layout_add(output_layout, wlr_output, r->x, r->y);
wlr_output_layout_add(output_layout, wlr_output, m->m.x, m->m.y);
strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
}

Expand Down
111 changes: 0 additions & 111 deletions patches/main...PalanixYT:monfig.patch

This file was deleted.

0 comments on commit c08d73c

Please sign in to comment.