aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xdg_shell_v6.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-10 10:25:56 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-10 10:25:56 -0500
commit0fdecb4d3a36d4c73a906bcc0465620293b6e6d2 (patch)
tree08a071ae7c4725a633209b47daa339ef33046a0f /sway/desktop/xdg_shell_v6.c
parentbutton and axis events (diff)
parentMerge pull request #1501 from emersion/command-include (diff)
downloadsway-0fdecb4d3a36d4c73a906bcc0465620293b6e6d2.tar.gz
sway-0fdecb4d3a36d4c73a906bcc0465620293b6e6d2.tar.zst
sway-0fdecb4d3a36d4c73a906bcc0465620293b6e6d2.zip
Merge branch 'wlroots' into feature/input
Diffstat (limited to 'sway/desktop/xdg_shell_v6.c')
-rw-r--r--sway/desktop/xdg_shell_v6.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index 37e39f37..2435c256 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -45,6 +45,16 @@ static void set_position(struct sway_view *view, double ox, double oy) {
45 view->swayc->y = oy; 45 view->swayc->y = oy;
46} 46}
47 47
48static void set_activated(struct sway_view *view, bool activated) {
49 if (!assert_xdg(view)) {
50 return;
51 }
52 struct wlr_xdg_surface_v6 *surface = view->wlr_xdg_surface_v6;
53 if (surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL) {
54 wlr_xdg_toplevel_v6_set_activated(surface, activated);
55 }
56}
57
48static void handle_commit(struct wl_listener *listener, void *data) { 58static void handle_commit(struct wl_listener *listener, void *data) {
49 struct sway_xdg_surface_v6 *sway_surface = 59 struct sway_xdg_surface_v6 *sway_surface =
50 wl_container_of(listener, sway_surface, commit); 60 wl_container_of(listener, sway_surface, commit);
@@ -96,6 +106,7 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
96 sway_view->iface.get_prop = get_prop; 106 sway_view->iface.get_prop = get_prop;
97 sway_view->iface.set_size = set_size; 107 sway_view->iface.set_size = set_size;
98 sway_view->iface.set_position = set_position; 108 sway_view->iface.set_position = set_position;
109 sway_view->iface.set_activated = set_activated;
99 sway_view->wlr_xdg_surface_v6 = xdg_surface; 110 sway_view->wlr_xdg_surface_v6 = xdg_surface;
100 sway_view->sway_xdg_surface_v6 = sway_surface; 111 sway_view->sway_xdg_surface_v6 = sway_surface;
101 sway_view->surface = xdg_surface->surface; 112 sway_view->surface = xdg_surface->surface;