diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-08-02 09:05:46 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-08-02 09:05:46 -0400 |
commit | 9aa258d33a9baa42895214da7e82f4568fcb8f76 (patch) | |
tree | 229419214ed67a2e4237b36cf0d1185f1406dad1 /sway/desktop/render.c | |
parent | Merge pull request #2404 from RyanDwyer/move-containers-when-workspace-focused (diff) | |
download | sway-9aa258d33a9baa42895214da7e82f4568fcb8f76.tar.gz sway-9aa258d33a9baa42895214da7e82f4568fcb8f76.tar.zst sway-9aa258d33a9baa42895214da7e82f4568fcb8f76.zip |
Revert "Fix popups"
This reverts commit de86d65627e96cffe77f4abf11c4a0b982326ff9.
Diffstat (limited to 'sway/desktop/render.c')
-rw-r--r-- | sway/desktop/render.c | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 1f374740..f0e47c95 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c | |||
@@ -186,36 +186,13 @@ static void premultiply_alpha(float color[4], float opacity) { | |||
186 | color[2] *= color[3]; | 186 | color[2] *= color[3]; |
187 | } | 187 | } |
188 | 188 | ||
189 | static void render_view_toplevels(struct sway_view *view, | 189 | static void render_view_surfaces(struct sway_view *view, |
190 | struct sway_output *output, pixman_region32_t *damage, float alpha) { | 190 | struct sway_output *output, pixman_region32_t *damage, float alpha) { |
191 | struct render_data data = { | 191 | struct render_data data = { |
192 | .damage = damage, | 192 | .damage = damage, |
193 | .alpha = alpha, | 193 | .alpha = alpha, |
194 | }; | 194 | }; |
195 | // Render all toplevels without descending into popups | 195 | output_view_for_each_surface(output, view, render_surface_iterator, &data); |
196 | output_surface_for_each_surface(output, view->surface, | ||
197 | view->swayc->current.view_x, view->swayc->current.view_y, | ||
198 | render_surface_iterator, &data); | ||
199 | } | ||
200 | |||
201 | static void render_popup_iterator(struct sway_output *output, | ||
202 | struct wlr_surface *surface, struct wlr_box *box, float rotation, | ||
203 | void *data) { | ||
204 | // Render this popup's surface | ||
205 | render_surface_iterator(output, surface, box, rotation, data); | ||
206 | |||
207 | // Render this popup's child toplevels | ||
208 | output_surface_for_each_surface(output, surface, box->x, box->y, | ||
209 | render_surface_iterator, data); | ||
210 | } | ||
211 | |||
212 | static void render_view_popups(struct sway_view *view, | ||
213 | struct sway_output *output, pixman_region32_t *damage, float alpha) { | ||
214 | struct render_data data = { | ||
215 | .damage = damage, | ||
216 | .alpha = alpha, | ||
217 | }; | ||
218 | output_view_for_each_popup(output, view, render_popup_iterator, &data); | ||
219 | } | 196 | } |
220 | 197 | ||
221 | static void render_saved_view(struct sway_view *view, | 198 | static void render_saved_view(struct sway_view *view, |
@@ -262,7 +239,7 @@ static void render_view(struct sway_output *output, pixman_region32_t *damage, | |||
262 | if (view->saved_buffer) { | 239 | if (view->saved_buffer) { |
263 | render_saved_view(view, output, damage, view->swayc->alpha); | 240 | render_saved_view(view, output, damage, view->swayc->alpha); |
264 | } else { | 241 | } else { |
265 | render_view_toplevels(view, output, damage, view->swayc->alpha); | 242 | render_view_surfaces(view, output, damage, view->swayc->alpha); |
266 | } | 243 | } |
267 | 244 | ||
268 | if (view->using_csd) { | 245 | if (view->using_csd) { |
@@ -866,7 +843,7 @@ void output_render(struct sway_output *output, struct timespec *when, | |||
866 | render_saved_view(fullscreen_con->sway_view, | 843 | render_saved_view(fullscreen_con->sway_view, |
867 | output, damage, 1.0f); | 844 | output, damage, 1.0f); |
868 | } else { | 845 | } else { |
869 | render_view_toplevels(fullscreen_con->sway_view, | 846 | render_view_surfaces(fullscreen_con->sway_view, |
870 | output, damage, 1.0f); | 847 | output, damage, 1.0f); |
871 | } | 848 | } |
872 | } else { | 849 | } else { |
@@ -902,12 +879,6 @@ void output_render(struct sway_output *output, struct timespec *when, | |||
902 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); | 879 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); |
903 | } | 880 | } |
904 | 881 | ||
905 | struct sway_seat *seat = input_manager_current_seat(input_manager); | ||
906 | struct sway_container *focus = seat_get_focus(seat); | ||
907 | if (focus && focus->type == C_VIEW) { | ||
908 | render_view_popups(focus->sway_view, output, damage, focus->alpha); | ||
909 | } | ||
910 | |||
911 | render_overlay: | 882 | render_overlay: |
912 | render_layer(output, damage, | 883 | render_layer(output, damage, |
913 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); | 884 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); |