diff --git a/sway/config/output.c b/sway/config/output.c index 5ed518bf4..e061e25bd 100644 --- a/sway/config/output.c +++ b/sway/config/output.c @@ -67,7 +67,7 @@ struct output_config *new_output_config(const char *name) { oc->refresh_rate = -1; oc->custom_mode = -1; oc->drm_mode.type = -1; - oc->x = oc->y = -1; + oc->x = oc->y = INT_MAX; oc->scale = -1; oc->scale_filter = SCALE_FILTER_DEFAULT; oc->transform = -1; @@ -93,11 +93,11 @@ static void supersede_output_config(struct output_config *dst, struct output_con if (src->height != -1) { dst->height = -1; } - if (src->x != -1) { - dst->x = -1; + if (src->x != INT_MAX) { + dst->x = INT_MAX; } - if (src->y != -1) { - dst->y = -1; + if (src->y != INT_MAX) { + dst->y = INT_MAX; } if (src->scale != -1) { dst->scale = -1; @@ -157,10 +157,10 @@ static void merge_output_config(struct output_config *dst, struct output_config if (src->height != -1) { dst->height = src->height; } - if (src->x != -1) { + if (src->x != INT_MAX) { dst->x = src->x; } - if (src->y != -1) { + if (src->y != INT_MAX) { dst->y = src->y; } if (src->scale != -1) { @@ -527,7 +527,7 @@ static bool finalize_output_config(struct output_config *oc, struct sway_output } // Find position for it - if (oc && (oc->x != -1 || oc->y != -1)) { + if (oc && oc->x != INT_MAX && oc->y != INT_MAX) { sway_log(SWAY_DEBUG, "Set %s position to %d, %d", oc->name, oc->x, oc->y); wlr_output_layout_add(root->output_layout, wlr_output, oc->x, oc->y); } else {