*<core><adaptiveSync>* [yes|no]
Enable adaptive sync. Default is no.
+*<core><reuseOutputMode>* [yes|no]
+ Try to re-use the existing output mode (resolution / refresh rate).
+ This may prevent unnecessary screenblank delays when starting labwc
+ (also known as flicker free boot). If the existing output mode can not
+ be used with labwc the preferred mode of the monitor is used instead.
+ Default is no.
+
*<core><cycleViewPreview>* [yes|no]
Preview the contents of the selected window when cycling between windows.
Default is no.
<decoration>server</decoration>
<gap>0</gap>
<adaptiveSync>no</adaptiveSync>
+ <reuseOutputMode>no</reuseOutputMode>
<cycleViewPreview>no</cycleViewPreview>
<cycleViewOutlines>yes</cycleViewOutlines>
</core>
rc.gap = atoi(content);
} else if (!strcasecmp(nodename, "adaptiveSync.core")) {
rc.adaptive_sync = get_bool(content);
+ } else if (!strcasecmp(nodename, "reuseOutputMode.core")) {
+ rc.reuse_output_mode = get_bool(content);
} else if (!strcmp(nodename, "name.theme")) {
rc.theme_name = xstrdup(content);
} else if (!strcmp(nodename, "cornerradius.theme")) {
static void do_output_layout_change(struct server *server);
+static bool
+can_reuse_mode(struct wlr_output *wlr_output)
+{
+ return wlr_output->current_mode && wlr_output_test(wlr_output);
+}
+
static void
new_output_notify(struct wl_listener *listener, void *data)
{
wlr_log(WLR_DEBUG, "enable output");
wlr_output_enable(wlr_output, true);
- /* The mode is a tuple of (width, height, refresh rate). */
- wlr_log(WLR_DEBUG, "set preferred mode");
- struct wlr_output_mode *preferred_mode =
- wlr_output_preferred_mode(wlr_output);
- wlr_output_set_mode(wlr_output, preferred_mode);
+ /*
+ * Try to re-use the existing mode if configured to do so.
+ * Failing that, try to set the preferred mode.
+ */
+ struct wlr_output_mode *preferred_mode = NULL;
+ if (!rc.reuse_output_mode || !can_reuse_mode(wlr_output)) {
+ wlr_log(WLR_DEBUG, "set preferred mode");
+ /* The mode is a tuple of (width, height, refresh rate). */
+ preferred_mode = wlr_output_preferred_mode(wlr_output);
+ wlr_output_set_mode(wlr_output, preferred_mode);
+ }
/*
* Sometimes the preferred mode is not available due to hardware