summaryrefslogtreecommitdiffstats
path: root/sway/desktop/render.c
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-07-25 08:50:06 +0100
committerLibravatar emersion <contact@emersion.fr>2018-07-25 08:55:41 +0100
commit0e79b2114c0bd374c6b4a37fc2ee0e672b8fbb38 (patch)
treed0067d3466d26526bf2531e19e3a5e24532d312b /sway/desktop/render.c
parentMerge pull request #2342 from RyanDwyer/update-cursor (diff)
downloadsway-0e79b2114c0bd374c6b4a37fc2ee0e672b8fbb38.tar.gz
sway-0e79b2114c0bd374c6b4a37fc2ee0e672b8fbb38.tar.zst
sway-0e79b2114c0bd374c6b4a37fc2ee0e672b8fbb38.zip
Improve rendering with a fullscreen opaque overlay surface
The rendering code doesn't use the exclusive input surface at all anymore to decide to skip rendering of shell surfaces. This fixes a weird situation in which a client requests exclusive input but isn't an overlay layer surface. The renderer also renders all overlay surfaces in this situation, not just one. This simplifies the code and fixes rendering when there are more than one overlay surfaces (e.g. for a virtual keyboard to type the lockscreen password).
Diffstat (limited to 'sway/desktop/render.c')
-rw-r--r--sway/desktop/render.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 7da54594..d6c3fa8c 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -836,21 +836,12 @@ void output_render(struct sway_output *output, struct timespec *when,
836 836
837 struct sway_container *workspace = output_get_active_workspace(output); 837 struct sway_container *workspace = output_get_active_workspace(output);
838 struct sway_view *fullscreen_view = workspace->current.ws_fullscreen; 838 struct sway_view *fullscreen_view = workspace->current.ws_fullscreen;
839 struct sway_seat *seat = input_manager_current_seat(input_manager); 839
840 840 if (output_has_opaque_overlay_layer_surface(output)) {
841 if (output_has_opaque_lockscreen(output, seat) && seat->focused_layer) { 841 goto render_overlay;
842 struct wlr_layer_surface *wlr_layer_surface = seat->focused_layer; 842 }
843 struct sway_layer_surface *sway_layer_surface = 843
844 layer_from_wlr_layer_surface(seat->focused_layer); 844 if (fullscreen_view) {
845 struct render_data data = {
846 .output = output,
847 .damage = damage,
848 .alpha = 1.0f,
849 };
850 output_surface_for_each_surface(wlr_layer_surface->surface,
851 sway_layer_surface->geo.x, sway_layer_surface->geo.y,
852 &data.root_geo, render_surface_iterator, &data);
853 } else if (fullscreen_view) {
854 float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f}; 845 float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f};
855 846
856 int nrects; 847 int nrects;
@@ -894,6 +885,8 @@ void output_render(struct sway_output *output, struct timespec *when,
894 render_layer(output, damage, 885 render_layer(output, damage,
895 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); 886 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]);
896 } 887 }
888
889render_overlay:
897 render_layer(output, damage, 890 render_layer(output, damage,
898 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); 891 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]);
899 render_drag_icons(output, damage, &root_container.sway_root->drag_icons); 892 render_drag_icons(output, damage, &root_container.sway_root->drag_icons);