Made fullscreen rendering a bit more clear

This commit is contained in:
Erik Reider 2024-01-26 19:32:32 +01:00
parent d7ca31c596
commit 5bb8877abe

View file

@ -2215,22 +2215,17 @@ void output_render(struct sway_output *output, struct timespec *when,
// Render the fullscreen containers on top // Render the fullscreen containers on top
if (has_fullscreen) { if (has_fullscreen) {
struct sway_workspace *workspaces[2] = { other_ws, workspace }; // Render a blank rect next to the fullscreen container if
for (int i = 0; i < 2; i++) { // there's no sibling workspace in the swipes direction
struct sway_workspace *ws = workspaces[i]; if (!other_ws) {
if (!ws) { struct wlr_box mon_box = { 0, 0, output->width, output->height };
// Render a blank rect next to the fullscreen container if adjust_box_to_workspace_offset(&mon_box, false, output);
// there's nothing to render scale_box(&mon_box, output->wlr_output->scale);
struct wlr_box mon_box = { 0, 0, output->width, output->height }; render_rect(output, damage, &mon_box, clear_color);
adjust_box_to_workspace_offset(&mon_box, false, output);
scale_box(&mon_box, output->wlr_output->scale);
render_rect(output, damage, &mon_box, clear_color);
// Render a shadow to separate the edge and the fullscreen // Render a shadow to separate the edge and the fullscreen
// container // container
if (!config_should_parameters_shadow()) { if (config_should_parameters_shadow()) {
continue;
}
struct wlr_box shadow_box = { 0, 0, output->width, output->height }; struct wlr_box shadow_box = { 0, 0, output->width, output->height };
adjust_box_to_workspace_offset(&shadow_box, true, output); adjust_box_to_workspace_offset(&shadow_box, true, output);
scale_box(&shadow_box, output->wlr_output->scale); scale_box(&shadow_box, output->wlr_output->scale);
@ -2240,15 +2235,18 @@ void output_render(struct sway_output *output, struct timespec *when,
render_box_shadow(output, damage, &shadow_box, render_box_shadow(output, damage, &shadow_box,
config->shadow_color, config->shadow_blur_sigma, 0, config->shadow_color, config->shadow_blur_sigma, 0,
0, 0); 0, 0);
continue;
} }
} else {
struct sway_container *f_con = ws == workspace ? // Render sibling fullscreen container
fullscreen_con : ws->current.fullscreen; struct sway_container *f_con = other_ws->current.fullscreen;
if (f_con) { if (other_ws->current.fullscreen) {
render_fullscreen_con(damage, output, f_con, ws, false); render_fullscreen_con(damage, output, f_con, other_ws, false);
} }
} }
// Render focused fullscreen container
if (fullscreen_con) {
render_fullscreen_con(damage, output, fullscreen_con, workspace, false);
}
} }
} }