summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.de.md2
-rw-r--r--README.el.md2
-rw-r--r--README.fr.md2
-rw-r--r--README.it.md2
-rw-r--r--README.ja.md2
-rw-r--r--README.md2
-rw-r--r--README.pt.md2
-rw-r--r--README.ru.md2
-rw-r--r--README.uk.md2
-rw-r--r--include/sway/tree/view.h5
-rw-r--r--sway/desktop/xdg_shell_v6.c10
-rw-r--r--sway/desktop/xwayland.c3
-rw-r--r--sway/tree/view.c33
13 files changed, 58 insertions, 11 deletions
diff --git a/README.de.md b/README.de.md
index dbef4ee6..530d8dd7 100644
--- a/README.de.md
+++ b/README.de.md
@@ -60,7 +60,7 @@ Abhängigkeiten:
60* libcap 60* libcap
61* asciidoc 61* asciidoc
62* pcre 62* pcre
63* json-c <= 0.12.1 63* json-c >= 0.13
64* pango 64* pango
65* cairo 65* cairo
66* gdk-pixbuf2 * 66* gdk-pixbuf2 *
diff --git a/README.el.md b/README.el.md
index 8d8f0f3e..682dbc84 100644
--- a/README.el.md
+++ b/README.el.md
@@ -53,7 +53,7 @@ To username μου στο Freenode είναι kon14 και θα με βρείτ
53* libcap 53* libcap
54* asciidoc 54* asciidoc
55* pcre 55* pcre
56* json-c <= 0.12.1 56* json-c >= 0.13
57* pango 57* pango
58* cairo 58* cairo
59* gdk-pixbuf2 * 59* gdk-pixbuf2 *
diff --git a/README.fr.md b/README.fr.md
index 1ffcd478..360fe618 100644
--- a/README.fr.md
+++ b/README.fr.md
@@ -55,7 +55,7 @@ Installez les dépendances :
55* libcap 55* libcap
56* asciidoc 56* asciidoc
57* pcre 57* pcre
58* json-c <= 0.12.1 58* json-c >= 0.13
59* pango 59* pango
60* cairo 60* cairo
61* gdk-pixbuf2 * 61* gdk-pixbuf2 *
diff --git a/README.it.md b/README.it.md
index ef5b81a7..94dc96c6 100644
--- a/README.it.md
+++ b/README.it.md
@@ -56,7 +56,7 @@ Installa queste dipendenze:
56* libcap 56* libcap
57* asciidoc 57* asciidoc
58* pcre 58* pcre
59* json-c <= 0.12.1 59* json-c >= 0.13
60* pango 60* pango
61* cairo 61* cairo
62* gdk-pixbuf2 * 62* gdk-pixbuf2 *
diff --git a/README.ja.md b/README.ja.md
index aa420814..42d31b86 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -46,7 +46,7 @@ Swayは沢山のディストリビューションで提供されています。"
46* libcap 46* libcap
47* asciidoc 47* asciidoc
48* pcre 48* pcre
49* json-c <= 0.12.1 49* json-c >= 0.13
50* pango 50* pango
51* cairo 51* cairo
52* gdk-pixbuf2 * 52* gdk-pixbuf2 *
diff --git a/README.md b/README.md
index ae12ea89..cecbcdb1 100644
--- a/README.md
+++ b/README.md
@@ -61,7 +61,7 @@ Install dependencies:
61* libcap 61* libcap
62* asciidoc 62* asciidoc
63* pcre 63* pcre
64* json-c <= 0.12.1 64* json-c >= 0.13
65* pango 65* pango
66* cairo 66* cairo
67* gdk-pixbuf2 * 67* gdk-pixbuf2 *
diff --git a/README.pt.md b/README.pt.md
index 69c9538a..98ad72e3 100644
--- a/README.pt.md
+++ b/README.pt.md
@@ -62,7 +62,7 @@ Antes de iniciar a compilação, instale as dependências:
62* libcap 62* libcap
63* asciidoc 63* asciidoc
64* pcre 64* pcre
65* json-c <= 0.12.1 65* json-c >= 0.13
66* pango 66* pango
67* cairo 67* cairo
68* gdk-pixbuf2 * 68* gdk-pixbuf2 *
diff --git a/README.ru.md b/README.ru.md
index e1580c81..659880ca 100644
--- a/README.ru.md
+++ b/README.ru.md
@@ -55,7 +55,7 @@ Sway доступен во многих дистрибутивах и наход
55* libcap 55* libcap
56* asciidoc 56* asciidoc
57* pcre 57* pcre
58* json-c <= 0.12.1 58* json-c >= 0.13
59* pango 59* pango
60* cairo 60* cairo
61* gdk-pixbuf2 * 61* gdk-pixbuf2 *
diff --git a/README.uk.md b/README.uk.md
index 71b35470..81bc70fa 100644
--- a/README.uk.md
+++ b/README.uk.md
@@ -62,7 +62,7 @@ Sway доступний у багатьох дистрибутивах Linux (а
62* libcap 62* libcap
63* asciidoc 63* asciidoc
64* pcre 64* pcre
65* json-c <= 0.12.1 65* json-c >= 0.13
66* pango 66* pango
67* cairo 67* cairo
68* gdk-pixbuf2 * 68* gdk-pixbuf2 *
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index 6b2d279e..611c4f0b 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -28,6 +28,8 @@ struct sway_view_impl {
28 void (*configure)(struct sway_view *view, double ox, double oy, int width, 28 void (*configure)(struct sway_view *view, double ox, double oy, int width,
29 int height); 29 int height);
30 void (*set_activated)(struct sway_view *view, bool activated); 30 void (*set_activated)(struct sway_view *view, bool activated);
31 void (*for_each_surface)(struct sway_view *view,
32 wlr_surface_iterator_func_t iterator, void *user_data);
31 void (*close)(struct sway_view *view); 33 void (*close)(struct sway_view *view);
32 void (*destroy)(struct sway_view *view); 34 void (*destroy)(struct sway_view *view);
33}; 35};
@@ -159,6 +161,9 @@ void view_damage_whole(struct sway_view *view);
159 161
160void view_damage_from(struct sway_view *view); 162void view_damage_from(struct sway_view *view);
161 163
164void view_for_each_surface(struct sway_view *view,
165 wlr_surface_iterator_func_t iterator, void *user_data);
166
162// view implementation 167// view implementation
163 168
164void view_init(struct sway_view *view, enum sway_view_type type, 169void view_init(struct sway_view *view, enum sway_view_type type,
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index c66cc39a..8361aab3 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -118,6 +118,15 @@ static void set_activated(struct sway_view *view, bool activated) {
118 } 118 }
119} 119}
120 120
121static void for_each_surface(struct sway_view *view,
122 wlr_surface_iterator_func_t iterator, void *user_data) {
123 if (xdg_shell_v6_view_from_view(view) == NULL) {
124 return;
125 }
126 wlr_xdg_surface_v6_for_each_surface(view->wlr_xdg_surface_v6, iterator,
127 user_data);
128}
129
121static void _close(struct sway_view *view) { 130static void _close(struct sway_view *view) {
122 if (xdg_shell_v6_view_from_view(view) == NULL) { 131 if (xdg_shell_v6_view_from_view(view) == NULL) {
123 return; 132 return;
@@ -146,6 +155,7 @@ static const struct sway_view_impl view_impl = {
146 .get_prop = get_prop, 155 .get_prop = get_prop,
147 .configure = configure, 156 .configure = configure,
148 .set_activated = set_activated, 157 .set_activated = set_activated,
158 .for_each_surface = for_each_surface,
149 .close = _close, 159 .close = _close,
150 .destroy = destroy, 160 .destroy = destroy,
151}; 161};
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index e3da1da7..10bfcc89 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -58,6 +58,9 @@ static void unmanaged_handle_map(struct wl_listener *listener, void *data) {
58 surface->lx = xsurface->x; 58 surface->lx = xsurface->x;
59 surface->ly = xsurface->y; 59 surface->ly = xsurface->y;
60 desktop_damage_whole_surface(xsurface->surface, surface->lx, surface->ly); 60 desktop_damage_whole_surface(xsurface->surface, surface->lx, surface->ly);
61
62 // TODO: we don't send surface enter/leave events to xwayland unmanaged
63 // surfaces, but xwayland doesn't support HiDPI anyway
61} 64}
62 65
63static void unmanaged_handle_unmap(struct wl_listener *listener, void *data) { 66static void unmanaged_handle_unmap(struct wl_listener *listener, void *data) {
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 16d48cc9..9855c5e1 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -102,6 +102,15 @@ static void view_get_layout_box(struct sway_view *view, struct wlr_box *box) {
102 box->height = view->height; 102 box->height = view->height;
103} 103}
104 104
105void view_for_each_surface(struct sway_view *view,
106 wlr_surface_iterator_func_t iterator, void *user_data) {
107 if (view->impl->for_each_surface) {
108 view->impl->for_each_surface(view, iterator, user_data);
109 } else {
110 wlr_surface_for_each_surface(view->surface, iterator, user_data);
111 }
112}
113
105static void view_subsurface_create(struct sway_view *view, 114static void view_subsurface_create(struct sway_view *view,
106 struct wlr_subsurface *subsurface); 115 struct wlr_subsurface *subsurface);
107 116
@@ -116,6 +125,18 @@ static void view_handle_surface_new_subsurface(struct wl_listener *listener,
116 view_subsurface_create(view, subsurface); 125 view_subsurface_create(view, subsurface);
117} 126}
118 127
128static void surface_send_enter_iterator(struct wlr_surface *surface,
129 int x, int y, void *data) {
130 struct wlr_output *wlr_output = data;
131 wlr_surface_send_enter(surface, wlr_output);
132}
133
134static void surface_send_leave_iterator(struct wlr_surface *surface,
135 int x, int y, void *data) {
136 struct wlr_output *wlr_output = data;
137 wlr_surface_send_leave(surface, wlr_output);
138}
139
119static void view_handle_container_reparent(struct wl_listener *listener, 140static void view_handle_container_reparent(struct wl_listener *listener,
120 void *data) { 141 void *data) {
121 struct sway_view *view = 142 struct sway_view *view =
@@ -137,11 +158,11 @@ static void view_handle_container_reparent(struct wl_listener *listener,
137 } 158 }
138 159
139 if (old_output != NULL) { 160 if (old_output != NULL) {
140 wlr_surface_send_leave(view->surface, 161 view_for_each_surface(view, surface_send_leave_iterator,
141 old_output->sway_output->wlr_output); 162 old_output->sway_output->wlr_output);
142 } 163 }
143 if (new_output != NULL) { 164 if (new_output != NULL) {
144 wlr_surface_send_enter(view->surface, 165 view_for_each_surface(view, surface_send_enter_iterator,
145 new_output->sway_output->wlr_output); 166 new_output->sway_output->wlr_output);
146 } 167 }
147} 168}
@@ -283,6 +304,14 @@ void view_child_init(struct sway_view_child *child,
283 wl_signal_add(&view->events.unmap, &child->view_unmap); 304 wl_signal_add(&view->events.unmap, &child->view_unmap);
284 child->view_unmap.notify = view_child_handle_view_unmap; 305 child->view_unmap.notify = view_child_handle_view_unmap;
285 306
307 struct sway_container *output = child->view->swayc->parent;
308 if (output != NULL) {
309 if (output->type != C_OUTPUT) {
310 output = container_parent(output, C_OUTPUT);
311 }
312 wlr_surface_send_enter(child->surface, output->sway_output->wlr_output);
313 }
314
286 view_init_subsurfaces(child->view, surface); 315 view_init_subsurfaces(child->view, surface);
287 316
288 // TODO: only damage the whole child 317 // TODO: only damage the whole child