config/output: skip no-op modeline change

This commit is contained in:
Simon Ser 2023-11-15 18:21:06 +01:00
parent 5b72fccb67
commit b03d8f685e

View file

@ -293,9 +293,9 @@ static void set_modeline(struct wlr_output *output,
sway_log(SWAY_ERROR, "Modeline can only be set to DRM output"); sway_log(SWAY_ERROR, "Modeline can only be set to DRM output");
return; return;
} }
sway_log(SWAY_DEBUG, "Assigning custom modeline to %s", output->name);
struct wlr_output_mode *mode = wlr_drm_connector_add_mode(output, drm_mode); struct wlr_output_mode *mode = wlr_drm_connector_add_mode(output, drm_mode);
if (mode) { if (mode && output->current_mode != mode) {
sway_log(SWAY_DEBUG, "Assigning custom modeline to %s", output->name);
wlr_output_state_set_mode(pending, mode); wlr_output_state_set_mode(pending, mode);
} }
#else #else