aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-04-04 15:53:46 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-04-04 22:03:14 -0400
commit8eff00f72395add1881aa677e3c718c0554cb096 (patch)
tree803dc03246326c754732f3b8f635d8a67a2a3441
parentRemove unused sway_view.unmanaged_link (diff)
downloadsway-8eff00f72395add1881aa677e3c718c0554cb096.tar.gz
sway-8eff00f72395add1881aa677e3c718c0554cb096.tar.zst
sway-8eff00f72395add1881aa677e3c718c0554cb096.zip
Remove unused SWAY_VIEW_TYPES
-rw-r--r--include/sway/tree/view.h8
-rw-r--r--sway/desktop/output.c9
-rw-r--r--sway/desktop/wl_shell.c4
-rw-r--r--sway/desktop/xdg_shell_v6.c4
-rw-r--r--sway/desktop/xwayland.c4
-rw-r--r--sway/input/seat.c2
-rw-r--r--sway/tree/container.c47
7 files changed, 36 insertions, 42 deletions
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index 6bc5ceda..f32ccc5a 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -59,11 +59,9 @@ struct sway_wl_shell_surface {
59}; 59};
60 60
61enum sway_view_type { 61enum sway_view_type {
62 SWAY_WL_SHELL_VIEW, 62 SWAY_VIEW_WL_SHELL,
63 SWAY_XDG_SHELL_V6_VIEW, 63 SWAY_VIEW_XDG_SHELL_V6,
64 SWAY_XWAYLAND_VIEW, 64 SWAY_VIEW_XWAYLAND,
65 // Keep last
66 SWAY_VIEW_TYPES,
67}; 65};
68 66
69enum sway_view_prop { 67enum sway_view_prop {
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 6cf5da48..38b52a41 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -188,7 +188,7 @@ static void render_view(struct sway_container *view, void *data) {
188 } 188 }
189 189
190 switch (sway_view->type) { 190 switch (sway_view->type) {
191 case SWAY_XDG_SHELL_V6_VIEW: { 191 case SWAY_VIEW_XDG_SHELL_V6: {
192 int window_offset_x = view->sway_view->wlr_xdg_surface_v6->geometry.x; 192 int window_offset_x = view->sway_view->wlr_xdg_surface_v6->geometry.x;
193 int window_offset_y = view->sway_view->wlr_xdg_surface_v6->geometry.y; 193 int window_offset_y = view->sway_view->wlr_xdg_surface_v6->geometry.y;
194 render_surface(surface, wlr_output, when, 194 render_surface(surface, wlr_output, when,
@@ -197,13 +197,12 @@ static void render_view(struct sway_container *view, void *data) {
197 when, view->x - window_offset_x, view->y - window_offset_y, 0, alpha); 197 when, view->x - window_offset_x, view->y - window_offset_y, 0, alpha);
198 break; 198 break;
199 } 199 }
200 case SWAY_WL_SHELL_VIEW: 200 case SWAY_VIEW_WL_SHELL:
201 render_wl_shell_surface(sway_view->wlr_wl_shell_surface, wlr_output, 201 render_wl_shell_surface(sway_view->wlr_wl_shell_surface, wlr_output,
202 when, view->x, view->y, 0, alpha, false); 202 when, view->x, view->y, 0, alpha, false);
203 break; 203 break;
204 case SWAY_XWAYLAND_VIEW: 204 case SWAY_VIEW_XWAYLAND:
205 render_surface(surface, wlr_output, when, view->x, view->y, 205 render_surface(surface, wlr_output, when, view->x, view->y, 0, alpha);
206 0, alpha);
207 break; 206 break;
208 default: 207 default:
209 break; 208 break;
diff --git a/sway/desktop/wl_shell.c b/sway/desktop/wl_shell.c
index 6528a397..a470674d 100644
--- a/sway/desktop/wl_shell.c
+++ b/sway/desktop/wl_shell.c
@@ -12,7 +12,7 @@
12#include "log.h" 12#include "log.h"
13 13
14static bool assert_wl_shell(struct sway_view *view) { 14static bool assert_wl_shell(struct sway_view *view) {
15 return sway_assert(view->type == SWAY_WL_SHELL_VIEW, 15 return sway_assert(view->type == SWAY_VIEW_WL_SHELL,
16 "Expecting wl_shell view!"); 16 "Expecting wl_shell view!");
17} 17}
18 18
@@ -97,7 +97,7 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) {
97 return; 97 return;
98 } 98 }
99 99
100 struct sway_view *view = view_create(SWAY_WL_SHELL_VIEW, &view_impl); 100 struct sway_view *view = view_create(SWAY_VIEW_WL_SHELL, &view_impl);
101 if (!sway_assert(view, "Failed to allocate view")) { 101 if (!sway_assert(view, "Failed to allocate view")) {
102 return; 102 return;
103 } 103 }
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index 49305b39..5cdb8f9f 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -12,7 +12,7 @@
12#include "log.h" 12#include "log.h"
13 13
14static bool assert_xdg(struct sway_view *view) { 14static bool assert_xdg(struct sway_view *view) {
15 return sway_assert(view->type == SWAY_XDG_SHELL_V6_VIEW, 15 return sway_assert(view->type == SWAY_VIEW_XDG_SHELL_V6,
16 "Expected xdg shell v6 view!"); 16 "Expected xdg shell v6 view!");
17} 17}
18 18
@@ -126,7 +126,7 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
126 return; 126 return;
127 } 127 }
128 128
129 struct sway_view *view = view_create(SWAY_XDG_SHELL_V6_VIEW, &view_impl); 129 struct sway_view *view = view_create(SWAY_VIEW_XDG_SHELL_V6, &view_impl);
130 if (!sway_assert(view, "Failed to allocate view")) { 130 if (!sway_assert(view, "Failed to allocate view")) {
131 return; 131 return;
132 } 132 }
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index bfef68cf..a793928c 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -42,7 +42,7 @@ static void create_unmanaged(struct wlr_xwayland_surface *xsurface) {
42 42
43 43
44static bool assert_xwayland(struct sway_view *view) { 44static bool assert_xwayland(struct sway_view *view) {
45 return sway_assert(view->type == SWAY_XWAYLAND_VIEW, 45 return sway_assert(view->type == SWAY_VIEW_XWAYLAND,
46 "Expected xwayland view!"); 46 "Expected xwayland view!");
47} 47}
48 48
@@ -185,7 +185,7 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
185 return; 185 return;
186 } 186 }
187 187
188 struct sway_view *view = view_create(SWAY_XWAYLAND_VIEW, &view_impl); 188 struct sway_view *view = view_create(SWAY_VIEW_XWAYLAND, &view_impl);
189 if (!sway_assert(view, "Failed to allocate view")) { 189 if (!sway_assert(view, "Failed to allocate view")) {
190 return; 190 return;
191 } 191 }
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 0699324a..87dbd870 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -66,7 +66,7 @@ static void seat_send_focus(struct sway_seat *seat,
66 return; 66 return;
67 } 67 }
68 struct sway_view *view = con->sway_view; 68 struct sway_view *view = con->sway_view;
69 if (view->type == SWAY_XWAYLAND_VIEW) { 69 if (view->type == SWAY_VIEW_XWAYLAND) {
70 struct wlr_xwayland *xwayland = 70 struct wlr_xwayland *xwayland =
71 seat->input->server->xwayland; 71 seat->input->server->xwayland;
72 wlr_xwayland_set_seat(xwayland, seat->wlr_seat); 72 wlr_xwayland_set_seat(xwayland, seat->wlr_seat);
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 3be08645..1ea10759 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -413,31 +413,28 @@ struct sway_container *container_at(struct sway_container *parent,
413 double view_sy = oy - swayc->y; 413 double view_sy = oy - swayc->y;
414 414
415 switch (sview->type) { 415 switch (sview->type) {
416 case SWAY_WL_SHELL_VIEW: 416 case SWAY_VIEW_XWAYLAND:
417 break; 417 case SWAY_VIEW_WL_SHELL:
418 case SWAY_XDG_SHELL_V6_VIEW: 418 break;
419 // the top left corner of the sway container is the 419 case SWAY_VIEW_XDG_SHELL_V6:
420 // coordinate of the top left corner of the window geometry 420 // the top left corner of the sway container is the
421 view_sx += sview->wlr_xdg_surface_v6->geometry.x; 421 // coordinate of the top left corner of the window geometry
422 view_sy += sview->wlr_xdg_surface_v6->geometry.y; 422 view_sx += sview->wlr_xdg_surface_v6->geometry.x;
423 423 view_sy += sview->wlr_xdg_surface_v6->geometry.y;
424 // check for popups 424
425 double popup_sx, popup_sy; 425 // check for popups
426 struct wlr_xdg_surface_v6 *popup = 426 double popup_sx, popup_sy;
427 wlr_xdg_surface_v6_popup_at(sview->wlr_xdg_surface_v6, 427 struct wlr_xdg_surface_v6 *popup =
428 view_sx, view_sy, &popup_sx, &popup_sy); 428 wlr_xdg_surface_v6_popup_at(sview->wlr_xdg_surface_v6,
429 429 view_sx, view_sy, &popup_sx, &popup_sy);
430 if (popup) { 430
431 *sx = view_sx - popup_sx; 431 if (popup) {
432 *sy = view_sy - popup_sy; 432 *sx = view_sx - popup_sx;
433 *surface = popup->surface; 433 *sy = view_sy - popup_sy;
434 return swayc; 434 *surface = popup->surface;
435 } 435 return swayc;
436 break; 436 }
437 case SWAY_XWAYLAND_VIEW: 437 break;
438 break;
439 default:
440 break;
441 } 438 }
442 439
443 // check for subsurfaces 440 // check for subsurfaces