Skip to content

output-layout: Add different automatic modes#2974

Closed
hustlerone wants to merge 207 commits intoWayfireWM:masterfrom
hustlerone:master
Closed

output-layout: Add different automatic modes#2974
hustlerone wants to merge 207 commits intoWayfireWM:masterfrom
hustlerone:master

Conversation

@hustlerone
Copy link

This adds two extra AUTO modes, whose behaviors differ from the main AUTO one.

AUTO_HIGHRR checks which mode has the highest refresh rate, then find the highest resolution which can still provide the refresh rate.

AUTO_HIGHRES just chooses the highest resolution mode available (which matches AUTO if no preferred video mode is specified by the display).

Depends on WayfireWM/wf-config#87

ammen99 and others added 8 commits February 18, 2025 15:43
* use ISO date format for log timestamps

The old format is ambiguous. The locale-aware %x format is only
available in C++20 and onwards but we are at C++17.

* fix tests
WayfireWM#80)

* Refactor load_xml_files: suppress per-file logging, summarize loaded XML files per directory

* Fix code style

---------

Co-authored-by: killown <systemofdown@gmai.com>
Co-authored-by: Ilia Bozhinov <ammen99@gmail.com>
@hustlerone hustlerone marked this pull request as draft February 12, 2026 15:06
@hustlerone hustlerone changed the title [DRAFT] output-layout: Add different automatic modes output-layout: Add different automatic modes Feb 12, 2026
@hustlerone hustlerone marked this pull request as ready for review February 12, 2026 15:41
@hustlerone
Copy link
Author

Tested on my machine with mode = highrr in [output] section and it seems to work just fine.

Scrutiny is welcome

@hustlerone hustlerone force-pushed the master branch 5 times, most recently from f9c8b64 to 783ee6f Compare February 12, 2026 17:39
@hustlerone
Copy link
Author

hustlerone commented Feb 12, 2026

Ok so this works but switching configurations might boot you back to auto which you don't want, apply_configuration in src/core/output-layout.cpp might be of interest.

#include <wayfire/nonstd/wlroots-full.hpp>

static void*const WF_NOOP_OUTPUT_MAGIC = (void*)0x1234;
static wlr_output_mode __video_mode_all_zeroes{};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a static variable in the function where it is actually used. Best to avoid global variables (I know we do the same with NOOP, it is also a bad decision I made awhile ago).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my concern lies mostly about allocating and de-allocating the dummy mode each call

if making it static in the function avoids that, then sure


/* Couldn't find a preferred mode. Just return the last, which is
* usually also the "largest" */
wl_list_for_each_reverse(mode, &handle->modes, link)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would write an actual loop here. With auto we could accept if the last mode is not the highest, but if the user actually specifies HIGHRES then we have to really choose the highest res mode, even if it is not the last one.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on my way to add specific logic for HIGHRES

Now prints git diff
Namely, `MODE_HIGHRR` and `MODE_HIGHRES`. They change the criteria on the "best" monitor mode.
@hustlerone
Copy link
Author

20 years of evolution and bash can't remember where my last command was so now i accidentally nuked this

@hustlerone
Copy link
Author

reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.