removed the custom_mode option because it's pretty useless

This commit is contained in:
Palanix 2021-08-07 11:52:05 +02:00
parent 01807eb2a7
commit b866774efd
2 changed files with 4 additions and 5 deletions

View File

@ -28,9 +28,9 @@ static const Layout layouts[] = {
* The order in which monitors are defined determines their position.
* Non-configured monitors are always added to the left. */
static const MonitorRule monrules[] = {
/* name mfact nmaster scale layout rotate/reflect x y resx resy rate adaptive custom*/
/* 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, 0},
{ "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0, 0, 0, 120.000, 1},
*/
/* defaults */
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0, 0, 0, 0, 0, 0},

5
dwl.c
View File

@ -193,7 +193,6 @@ typedef struct {
int resy;
int rate;
bool adaptive_true;
bool custom_mode;
} MonitorRule;
typedef struct {
@ -816,13 +815,13 @@ createkeyboard(struct wlr_input_device *device)
}
void
set_mode(struct wlr_output *output, int width, int height,
float refresh_rate, bool custom) {
float refresh_rate) {
// Not all floating point integers can be represented exactly
// as (int)(1000 * mHz / 1000.f)
// round() the result to avoid any error
int mhz = (int)round(refresh_rate * 1000);
if (wl_list_empty(&output->modes) || custom) {
if (wl_list_empty(&output->modes)) {
wlr_output_set_custom_mode(output, width, height,
refresh_rate > 0 ? mhz : 0);
return;