aboutsummaryrefslogtreecommitdiff
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:
* libcap
* asciidoc
* pcre
-* json-c <= 0.12.1
+* json-c >= 0.13
* pango
* cairo
* 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 και θα με βρείτ
* libcap
* asciidoc
* pcre
-* json-c <= 0.12.1
+* json-c >= 0.13
* pango
* cairo
* 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 :
* libcap
* asciidoc
* pcre
-* json-c <= 0.12.1
+* json-c >= 0.13
* pango
* cairo
* 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:
* libcap
* asciidoc
* pcre
-* json-c <= 0.12.1
+* json-c >= 0.13
* pango
* cairo
* 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は沢山のディストリビューションで提供されています。"
* libcap
* asciidoc
* pcre
-* json-c <= 0.12.1
+* json-c >= 0.13
* pango
* cairo
* 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:
* libcap
* asciidoc
* pcre
-* json-c <= 0.12.1
+* json-c >= 0.13
* pango
* cairo
* 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:
* libcap
* asciidoc
* pcre
-* json-c <= 0.12.1
+* json-c >= 0.13
* pango
* cairo
* 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 доступен во многих дистрибутивах и наход
* libcap
* asciidoc
* pcre
-* json-c <= 0.12.1
+* json-c >= 0.13
* pango
* cairo
* 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 (а
* libcap
* asciidoc
* pcre
-* json-c <= 0.12.1
+* json-c >= 0.13
* pango
* cairo
* 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 {
void (*configure)(struct sway_view *view, double ox, double oy, int width,
int height);
void (*set_activated)(struct sway_view *view, bool activated);
+ void (*for_each_surface)(struct sway_view *view,
+ wlr_surface_iterator_func_t iterator, void *user_data);
void (*close)(struct sway_view *view);
void (*destroy)(struct sway_view *view);
};
@@ -159,6 +161,9 @@ void view_damage_whole(struct sway_view *view);
void view_damage_from(struct sway_view *view);
+void view_for_each_surface(struct sway_view *view,
+ wlr_surface_iterator_func_t iterator, void *user_data);
+
// view implementation
void 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) {
}
}
+static void for_each_surface(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_surface(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;
@@ -146,6 +155,7 @@ static const struct sway_view_impl view_impl = {
.get_prop = get_prop,
.configure = configure,
.set_activated = set_activated,
+ .for_each_surface = for_each_surface,
.close = _close,
.destroy = destroy,
};
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) {
surface->lx = xsurface->x;
surface->ly = xsurface->y;
desktop_damage_whole_surface(xsurface->surface, surface->lx, surface->ly);
+
+ // TODO: we don't send surface enter/leave events to xwayland unmanaged
+ // surfaces, but xwayland doesn't support HiDPI anyway
}
static 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) {
box->height = view->height;
}
+void view_for_each_surface(struct sway_view *view,
+ wlr_surface_iterator_func_t iterator, void *user_data) {
+ if (view->impl->for_each_surface) {
+ view->impl->for_each_surface(view, iterator, user_data);
+ } else {
+ wlr_surface_for_each_surface(view->surface, iterator, user_data);
+ }
+}
+
static void view_subsurface_create(struct sway_view *view,
struct wlr_subsurface *subsurface);
@@ -116,6 +125,18 @@ static void view_handle_surface_new_subsurface(struct wl_listener *listener,
view_subsurface_create(view, subsurface);
}
+static void surface_send_enter_iterator(struct wlr_surface *surface,
+ int x, int y, void *data) {
+ struct wlr_output *wlr_output = data;
+ wlr_surface_send_enter(surface, wlr_output);
+}
+
+static void surface_send_leave_iterator(struct wlr_surface *surface,
+ int x, int y, void *data) {
+ struct wlr_output *wlr_output = data;
+ wlr_surface_send_leave(surface, wlr_output);
+}
+
static void view_handle_container_reparent(struct wl_listener *listener,
void *data) {
struct sway_view *view =
@@ -137,11 +158,11 @@ static void view_handle_container_reparent(struct wl_listener *listener,
}
if (old_output != NULL) {
- wlr_surface_send_leave(view->surface,
+ view_for_each_surface(view, surface_send_leave_iterator,
old_output->sway_output->wlr_output);
}
if (new_output != NULL) {
- wlr_surface_send_enter(view->surface,
+ view_for_each_surface(view, surface_send_enter_iterator,
new_output->sway_output->wlr_output);
}
}
@@ -283,6 +304,14 @@ void view_child_init(struct sway_view_child *child,
wl_signal_add(&view->events.unmap, &child->view_unmap);
child->view_unmap.notify = view_child_handle_view_unmap;
+ struct sway_container *output = child->view->swayc->parent;
+ if (output != NULL) {
+ if (output->type != C_OUTPUT) {
+ output = container_parent(output, C_OUTPUT);
+ }
+ wlr_surface_send_enter(child->surface, output->sway_output->wlr_output);
+ }
+
view_init_subsurfaces(child->view, surface);
// TODO: only damage the whole child