aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-08-02 09:05:46 -0400
committerDrew DeVault <sir@cmpwn.com>2018-08-02 09:05:46 -0400
commit9aa258d33a9baa42895214da7e82f4568fcb8f76 (patch)
tree229419214ed67a2e4237b36cf0d1185f1406dad1 /sway/desktop
parent8e60f6a73263c444ab5fecdeacdaf7883a9b1505 (diff)
downloadsway-9aa258d33a9baa42895214da7e82f4568fcb8f76.tar.xz
Revert "Fix popups"
This reverts commit de86d65627e96cffe77f4abf11c4a0b982326ff9.
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/output.c19
-rw-r--r--sway/desktop/render.c37
-rw-r--r--sway/desktop/xdg_shell.c9
-rw-r--r--sway/desktop/xdg_shell_v6.c10
4 files changed, 5 insertions, 70 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 66747a3f..31b53213 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -119,7 +119,7 @@ static void output_for_each_surface_iterator(struct wlr_surface *surface,
data->user_data);
}
-void output_surface_for_each_surface(struct sway_output *output,
+static void output_surface_for_each_surface(struct sway_output *output,
struct wlr_surface *surface, double ox, double oy,
sway_surface_iterator_func_t iterator, void *user_data) {
struct surface_iterator_data data = {
@@ -155,23 +155,6 @@ void output_view_for_each_surface(struct sway_output *output,
output_for_each_surface_iterator, &data);
}
-void output_view_for_each_popup(struct sway_output *output,
- struct sway_view *view, sway_surface_iterator_func_t iterator,
- void *user_data) {
- struct surface_iterator_data data = {
- .user_iterator = iterator,
- .user_data = user_data,
- .output = output,
- .ox = view->swayc->current.view_x - output->swayc->current.swayc_x,
- .oy = view->swayc->current.view_y - output->swayc->current.swayc_y,
- .width = view->swayc->current.view_width,
- .height = view->swayc->current.view_height,
- .rotation = 0, // TODO
- };
-
- view_for_each_popup(view, output_for_each_surface_iterator, &data);
-}
-
void output_layer_for_each_surface(struct sway_output *output,
struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator,
void *user_data) {
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) {
color[2] *= color[3];
}
-static void render_view_toplevels(struct sway_view *view,
+static void render_view_surfaces(struct sway_view *view,
struct sway_output *output, pixman_region32_t *damage, float alpha) {
struct render_data data = {
.damage = damage,
.alpha = alpha,
};
- // Render all toplevels without descending into popups
- output_surface_for_each_surface(output, view->surface,
- view->swayc->current.view_x, view->swayc->current.view_y,
- render_surface_iterator, &data);
-}
-
-static void render_popup_iterator(struct sway_output *output,
- struct wlr_surface *surface, struct wlr_box *box, float rotation,
- void *data) {
- // Render this popup's surface
- render_surface_iterator(output, surface, box, rotation, data);
-
- // Render this popup's child toplevels
- output_surface_for_each_surface(output, surface, box->x, box->y,
- render_surface_iterator, data);
-}
-
-static void render_view_popups(struct sway_view *view,
- struct sway_output *output, pixman_region32_t *damage, float alpha) {
- struct render_data data = {
- .damage = damage,
- .alpha = alpha,
- };
- output_view_for_each_popup(output, view, render_popup_iterator, &data);
+ output_view_for_each_surface(output, view, render_surface_iterator, &data);
}
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,
if (view->saved_buffer) {
render_saved_view(view, output, damage, view->swayc->alpha);
} else {
- render_view_toplevels(view, output, damage, view->swayc->alpha);
+ render_view_surfaces(view, output, damage, view->swayc->alpha);
}
if (view->using_csd) {
@@ -866,7 +843,7 @@ void output_render(struct sway_output *output, struct timespec *when,
render_saved_view(fullscreen_con->sway_view,
output, damage, 1.0f);
} else {
- render_view_toplevels(fullscreen_con->sway_view,
+ render_view_surfaces(fullscreen_con->sway_view,
output, damage, 1.0f);
}
} else {
@@ -902,12 +879,6 @@ void output_render(struct sway_output *output, struct timespec *when,
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]);
}
- struct sway_seat *seat = input_manager_current_seat(input_manager);
- struct sway_container *focus = seat_get_focus(seat);
- if (focus && focus->type == C_VIEW) {
- render_view_popups(focus->sway_view, output, damage, focus->alpha);
- }
-
render_overlay:
render_layer(output, damage,
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]);
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index b364663d..9d6b27e5 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -179,14 +179,6 @@ static void for_each_surface(struct sway_view *view,
user_data);
}
-static void for_each_popup(struct sway_view *view,
- wlr_surface_iterator_func_t iterator, void *user_data) {
- if (xdg_shell_view_from_view(view) == NULL) {
- return;
- }
- wlr_xdg_surface_for_each_popup(view->wlr_xdg_surface, iterator, user_data);
-}
-
static void _close(struct sway_view *view) {
if (xdg_shell_view_from_view(view) == NULL) {
return;
@@ -227,7 +219,6 @@ static const struct sway_view_impl view_impl = {
.set_fullscreen = set_fullscreen,
.wants_floating = wants_floating,
.for_each_surface = for_each_surface,
- .for_each_popup = for_each_popup,
.close = _close,
.close_popups = close_popups,
.destroy = destroy,
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index ffea03ad..6e4aae62 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -175,15 +175,6 @@ static void for_each_surface(struct sway_view *view,
user_data);
}
-static void for_each_popup(struct sway_view *view,
- wlr_surface_iterator_func_t iterator, void *user_data) {
- if (xdg_shell_v6_view_from_view(view) == NULL) {
- return;
- }
- wlr_xdg_surface_v6_for_each_popup(view->wlr_xdg_surface_v6, iterator,
- user_data);
-}
-
static void _close(struct sway_view *view) {
if (xdg_shell_v6_view_from_view(view) == NULL) {
return;
@@ -224,7 +215,6 @@ static const struct sway_view_impl view_impl = {
.set_fullscreen = set_fullscreen,
.wants_floating = wants_floating,
.for_each_surface = for_each_surface,
- .for_each_popup = for_each_popup,
.close = _close,
.close_popups = close_popups,
.destroy = destroy,