diff options
Diffstat (limited to 'sway/desktop')
| -rw-r--r-- | sway/desktop/desktop.c | 9 | ||||
| -rw-r--r-- | sway/desktop/output.c | 11 | 
2 files changed, 11 insertions, 9 deletions
diff --git a/sway/desktop/desktop.c b/sway/desktop/desktop.c index ec45d80a..c8d4502c 100644 --- a/sway/desktop/desktop.c +++ b/sway/desktop/desktop.c @@ -6,10 +6,11 @@ void desktop_damage_surface(struct wlr_surface *surface, double lx, double ly,  		bool whole) {  	for (int i = 0; i < root->outputs->length; ++i) {  		struct sway_output *output = root->outputs->items[i]; -		struct wlr_box *output_box = wlr_output_layout_get_box( -			root->output_layout, output->wlr_output); -		output_damage_surface(output, lx - output_box->x, -			ly - output_box->y, surface, whole); +		struct wlr_box output_box; +		wlr_output_layout_get_box(root->output_layout, +			output->wlr_output, &output_box); +		output_damage_surface(output, lx - output_box.x, +			ly - output_box.y, surface, whole);  	}  } diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 852671d2..dd2eaf08 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -737,14 +737,15 @@ static void update_output_manager_config(struct sway_server *server) {  		}  		struct wlr_output_configuration_head_v1 *config_head =  			wlr_output_configuration_head_v1_create(config, output->wlr_output); -		struct wlr_box *output_box = wlr_output_layout_get_box( -			root->output_layout, output->wlr_output); +		struct wlr_box output_box; +		wlr_output_layout_get_box(root->output_layout, +			output->wlr_output, &output_box);  		// We mark the output enabled even if it is switched off by DPMS  		config_head->state.enabled = output->current_mode != NULL && output->enabled;  		config_head->state.mode = output->current_mode; -		if (output_box) { -			config_head->state.x = output_box->x; -			config_head->state.y = output_box->y; +		if (!wlr_box_empty(&output_box)) { +			config_head->state.x = output_box.x; +			config_head->state.y = output_box.y;  		}  	}  | 
