summaryrefslogtreecommitdiffstats
path: root/sway/desktop/render.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-07-25 08:32:32 -0400
committerLibravatar GitHub <noreply@github.com>2018-07-25 08:32:32 -0400
commit53dbe2da4bd2563ec69211d0c51fb347109fc70d (patch)
treeb7de5dc2d2556866aec06c5c513ac3020b6af2d6 /sway/desktop/render.c
parentMerge pull request #2350 from ppascher/xwayland-optional (diff)
parentImprove rendering with a fullscreen opaque overlay surface (diff)
downloadsway-53dbe2da4bd2563ec69211d0c51fb347109fc70d.tar.gz
sway-53dbe2da4bd2563ec69211d0c51fb347109fc70d.tar.zst
sway-53dbe2da4bd2563ec69211d0c51fb347109fc70d.zip
Merge pull request #2353 from emersion/render-opaque-overlay
Improve rendering with a fullscreen opaque overlay surface
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 3e7bd94b..15c5b94c 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -837,21 +837,12 @@ void output_render(struct sway_output *output, struct timespec *when,
837 837
838 struct sway_container *workspace = output_get_active_workspace(output); 838 struct sway_container *workspace = output_get_active_workspace(output);
839 struct sway_view *fullscreen_view = workspace->current.ws_fullscreen; 839 struct sway_view *fullscreen_view = workspace->current.ws_fullscreen;
840 struct sway_seat *seat = input_manager_current_seat(input_manager); 840
841 841 if (output_has_opaque_overlay_layer_surface(output)) {
842 if (output_has_opaque_lockscreen(output, seat) && seat->focused_layer) { 842 goto render_overlay;
843 struct wlr_layer_surface *wlr_layer_surface = seat->focused_layer; 843 }
844 struct sway_layer_surface *sway_layer_surface = 844
845 layer_from_wlr_layer_surface(seat->focused_layer); 845 if (fullscreen_view) {
846 struct render_data data = {
847 .output = output,
848 .damage = damage,
849 .alpha = 1.0f,
850 };
851 output_surface_for_each_surface(wlr_layer_surface->surface,
852 sway_layer_surface->geo.x, sway_layer_surface->geo.y,
853 &data.root_geo, render_surface_iterator, &data);
854 } else if (fullscreen_view) {
855 float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f}; 846 float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f};
856 847
857 int nrects; 848 int nrects;
@@ -897,6 +888,8 @@ void output_render(struct sway_output *output, struct timespec *when,
897 render_layer(output, damage, 888 render_layer(output, damage,
898 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); 889 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]);
899 } 890 }
891
892render_overlay:
900 render_layer(output, damage, 893 render_layer(output, damage,
901 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); 894 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]);
902 render_drag_icons(output, damage, &root_container.sway_root->drag_icons); 895 render_drag_icons(output, damage, &root_container.sway_root->drag_icons);