aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-02-25 12:55:19 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-02-25 12:55:19 -0500
commit61c1c3e7afd431de08e037205c4849b5f485ff4f (patch)
tree622ebfb034c529b84103defbb669f1a96e189dee /sway/desktop
parentDocument updates to the output command (diff)
downloadsway-61c1c3e7afd431de08e037205c4849b5f485ff4f.tar.gz
sway-61c1c3e7afd431de08e037205c4849b5f485ff4f.tar.zst
sway-61c1c3e7afd431de08e037205c4849b5f485ff4f.zip
Use focus for new windows xwayland/wl_shell
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/wl_shell.c9
-rw-r--r--sway/desktop/xwayland.c7
2 files changed, 6 insertions, 10 deletions
diff --git a/sway/desktop/wl_shell.c b/sway/desktop/wl_shell.c
index 0cde6583..0356aa81 100644
--- a/sway/desktop/wl_shell.c
+++ b/sway/desktop/wl_shell.c
@@ -131,14 +131,11 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) {
131 sway_surface->destroy.notify = handle_destroy; 131 sway_surface->destroy.notify = handle_destroy;
132 wl_signal_add(&shell_surface->events.destroy, &sway_surface->destroy); 132 wl_signal_add(&shell_surface->events.destroy, &sway_surface->destroy);
133 133
134 // TODO: actual focus semantics 134 struct sway_seat *seat = input_manager_current_seat(input_manager);
135 swayc_t *parent = root_container.children->items[0]; 135 swayc_t *focus = sway_seat_get_focus_inactive(seat, &root_container);
136 parent = parent->children->items[0]; // workspace 136 swayc_t *cont = new_view(focus, sway_view);
137
138 swayc_t *cont = new_view(parent, sway_view);
139 sway_view->swayc = cont; 137 sway_view->swayc = cont;
140 138
141 arrange_windows(cont->parent, -1, -1); 139 arrange_windows(cont->parent, -1, -1);
142
143 sway_input_manager_set_focus(input_manager, cont); 140 sway_input_manager_set_focus(input_manager, cont);
144} 141}
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 7603d3ca..7933f7b2 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -233,10 +233,9 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
233 return; 233 return;
234 } 234 }
235 235
236 swayc_t *parent = root_container.children->items[0]; 236 struct sway_seat *seat = input_manager_current_seat(input_manager);
237 parent = parent->children->items[0]; // workspace 237 swayc_t *focus = sway_seat_get_focus_inactive(seat, &root_container);
238 238 swayc_t *cont = new_view(focus, sway_view);
239 swayc_t *cont = new_view(parent, sway_view);
240 sway_view->swayc = cont; 239 sway_view->swayc = cont;
241 240
242 arrange_windows(cont->parent, -1, -1); 241 arrange_windows(cont->parent, -1, -1);