diff options
Diffstat (limited to 'sway/desktop')
| -rw-r--r-- | sway/desktop/idle_inhibit_v1.c | 1 | ||||
| -rw-r--r-- | sway/desktop/layer_shell.c | 12 | ||||
| -rw-r--r-- | sway/desktop/render.c | 64 | ||||
| -rw-r--r-- | sway/desktop/xwayland.c | 4 | 
4 files changed, 57 insertions, 24 deletions
diff --git a/sway/desktop/idle_inhibit_v1.c b/sway/desktop/idle_inhibit_v1.c index 108a8417..da17d0f2 100644 --- a/sway/desktop/idle_inhibit_v1.c +++ b/sway/desktop/idle_inhibit_v1.c @@ -67,6 +67,7 @@ struct sway_idle_inhibit_manager_v1 *sway_idle_inhibit_manager_v1_create(  	manager->wlr_manager = wlr_idle_inhibit_v1_create(wl_display);  	if (!manager->wlr_manager) { +		free(manager);  		return NULL;  	}  	manager->idle = idle; diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index 91baa6f8..a7d96717 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c @@ -325,12 +325,6 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {  		layer_surface->client_pending.margin.bottom,  		layer_surface->client_pending.margin.left); -	struct sway_layer_surface *sway_layer = -		calloc(1, sizeof(struct sway_layer_surface)); -	if (!sway_layer) { -		return; -	} -  	if (!layer_surface->output) {  		// Assign last active output  		struct sway_container *output = NULL; @@ -352,6 +346,12 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {  		layer_surface->output = output->sway_output->wlr_output;  	} +	struct sway_layer_surface *sway_layer = +		calloc(1, sizeof(struct sway_layer_surface)); +	if (!sway_layer) { +		return; +	} +  	sway_layer->surface_commit.notify = handle_surface_commit;  	wl_signal_add(&layer_surface->surface->events.commit,  		&sway_layer->surface_commit); diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 17fe823a..4c85e516 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -256,6 +256,10 @@ static void render_view(struct sway_output *output, pixman_region32_t *damage,  		render_view_surfaces(view, output, damage, view->swayc->alpha);  	} +	if (view->using_csd) { +		return; +	} +  	struct wlr_box box;  	float output_scale = output->wlr_output->scale;  	float color[4]; @@ -553,7 +557,11 @@ static void render_container_simple(struct sway_output *output,  			struct wlr_texture *marks_texture;  			struct sway_container_state *state = &child->current; -			if (state->focused || parent_focused) { +			if (view_is_urgent(view)) { +				colors = &config->border_colors.urgent; +				title_texture = child->title_urgent; +				marks_texture = view->marks_urgent; +			} else if (state->focused || parent_focused) {  				colors = &config->border_colors.focused;  				title_texture = child->title_focused;  				marks_texture = view->marks_focused; @@ -567,12 +575,14 @@ static void render_container_simple(struct sway_output *output,  				marks_texture = view->marks_unfocused;  			} -			if (state->border == B_NORMAL) { -				render_titlebar(output, damage, child, state->swayc_x, -						state->swayc_y, state->swayc_width, colors, -						title_texture, marks_texture); -			} else { -				render_top_border(output, damage, child, colors); +			if (!view->using_csd) { +				if (state->border == B_NORMAL) { +					render_titlebar(output, damage, child, state->swayc_x, +							state->swayc_y, state->swayc_width, colors, +							title_texture, marks_texture); +				} else { +					render_top_border(output, damage, child, colors); +				}  			}  			render_view(output, damage, child, colors);  		} else { @@ -607,8 +617,14 @@ static void render_container_tabbed(struct sway_output *output,  		struct border_colors *colors;  		struct wlr_texture *title_texture;  		struct wlr_texture *marks_texture; - -		if (cstate->focused || parent_focused) { +		bool urgent = view ? +			view_is_urgent(view) : container_has_urgent_child(child); + +		if (urgent) { +			colors = &config->border_colors.urgent; +			title_texture = child->title_urgent; +			marks_texture = view ? view->marks_urgent : NULL; +		} else if (cstate->focused || parent_focused) {  			colors = &config->border_colors.focused;  			title_texture = child->title_focused;  			marks_texture = view ? view->marks_focused : NULL; @@ -670,8 +686,14 @@ static void render_container_stacked(struct sway_output *output,  		struct border_colors *colors;  		struct wlr_texture *title_texture;  		struct wlr_texture *marks_texture; - -		if (cstate->focused || parent_focused) { +		bool urgent = view ? +			view_is_urgent(view) : container_has_urgent_child(child); + +		if (urgent) { +			colors = &config->border_colors.urgent; +			title_texture = child->title_urgent; +			marks_texture = view ? view->marks_urgent : NULL; +		} else if (cstate->focused || parent_focused) {  			colors = &config->border_colors.focused;  			title_texture = child->title_focused;  			marks_texture = view ? view->marks_focused : NULL; @@ -731,7 +753,11 @@ static void render_floating_container(struct sway_output *soutput,  		struct wlr_texture *title_texture;  		struct wlr_texture *marks_texture; -		if (con->current.focused) { +		if (view_is_urgent(view)) { +			colors = &config->border_colors.urgent; +			title_texture = con->title_urgent; +			marks_texture = view->marks_urgent; +		} else if (con->current.focused) {  			colors = &config->border_colors.focused;  			title_texture = con->title_focused;  			marks_texture = view->marks_focused; @@ -741,12 +767,14 @@ static void render_floating_container(struct sway_output *soutput,  			marks_texture = view->marks_unfocused;  		} -		if (con->current.border == B_NORMAL) { -			render_titlebar(soutput, damage, con, con->current.swayc_x, -					con->current.swayc_y, con->current.swayc_width, colors, -					title_texture, marks_texture); -		} else if (con->current.border != B_NONE) { -			render_top_border(soutput, damage, con, colors); +		if (!view->using_csd) { +			if (con->current.border == B_NORMAL) { +				render_titlebar(soutput, damage, con, con->current.swayc_x, +						con->current.swayc_y, con->current.swayc_width, colors, +						title_texture, marks_texture); +			} else if (con->current.border != B_NONE) { +				render_top_border(soutput, damage, con, colors); +			}  		}  		render_view(soutput, damage, con, colors);  	} else { diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 11516673..9df7977d 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -297,6 +297,10 @@ static void handle_commit(struct wl_listener *listener, void *data) {  	}  	view_damage_from(view); + +	if (view->allow_request_urgent) { +		view_set_urgent(view, (bool)xsurface->hints_urgency); +	}  }  static void handle_unmap(struct wl_listener *listener, void *data) {  | 
