aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-10 15:13:27 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-10 15:13:27 -0500
commit5e9ee32d63d7a02e65f05ee00295ef41e115b2eb (patch)
tree2497fcd2069f5cd9b89995a3cd5400c98c8b3e2b /sway
parentbasic keyboard (diff)
downloadsway-5e9ee32d63d7a02e65f05ee00295ef41e115b2eb.tar.gz
sway-5e9ee32d63d7a02e65f05ee00295ef41e115b2eb.tar.zst
sway-5e9ee32d63d7a02e65f05ee00295ef41e115b2eb.zip
set focus on new window
Diffstat (limited to 'sway')
-rw-r--r--sway/desktop/wl_shell.c7
-rw-r--r--sway/desktop/xdg_shell_v6.c7
-rw-r--r--sway/desktop/xwayland.c7
3 files changed, 21 insertions, 0 deletions
diff --git a/sway/desktop/wl_shell.c b/sway/desktop/wl_shell.c
index 3f5a358a..3d3b1c44 100644
--- a/sway/desktop/wl_shell.c
+++ b/sway/desktop/wl_shell.c
@@ -7,6 +7,8 @@
7#include "sway/layout.h" 7#include "sway/layout.h"
8#include "sway/server.h" 8#include "sway/server.h"
9#include "sway/view.h" 9#include "sway/view.h"
10#include "sway/input/seat.h"
11#include "sway/input/input-manager.h"
10#include "log.h" 12#include "log.h"
11 13
12static bool assert_wl_shell(struct sway_view *view) { 14static bool assert_wl_shell(struct sway_view *view) {
@@ -126,4 +128,9 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) {
126 sway_view->swayc = cont; 128 sway_view->swayc = cont;
127 129
128 arrange_windows(cont->parent, -1, -1); 130 arrange_windows(cont->parent, -1, -1);
131
132 for (int i = 0; i < server->input->seats->length; ++i) {
133 struct sway_seat *seat = server->input->seats->items[i];
134 sway_seat_set_focus(seat, cont);
135 }
129} 136}
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index 2435c256..8ad6a5ec 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -7,6 +7,8 @@
7#include "sway/layout.h" 7#include "sway/layout.h"
8#include "sway/server.h" 8#include "sway/server.h"
9#include "sway/view.h" 9#include "sway/view.h"
10#include "sway/input/seat.h"
11#include "sway/input/input-manager.h"
10#include "log.h" 12#include "log.h"
11 13
12static bool assert_xdg(struct sway_view *view) { 14static bool assert_xdg(struct sway_view *view) {
@@ -132,4 +134,9 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
132 sway_view->swayc = cont; 134 sway_view->swayc = cont;
133 135
134 arrange_windows(cont->parent, -1, -1); 136 arrange_windows(cont->parent, -1, -1);
137
138 for (int i = 0; i < server->input->seats->length; ++i) {
139 struct sway_seat *seat = server->input->seats->items[i];
140 sway_seat_set_focus(seat, cont);
141 }
135} 142}
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 65c7e1ec..724c8a82 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -10,6 +10,8 @@
10#include "sway/server.h" 10#include "sway/server.h"
11#include "sway/view.h" 11#include "sway/view.h"
12#include "sway/output.h" 12#include "sway/output.h"
13#include "sway/input/seat.h"
14#include "sway/input/input-manager.h"
13#include "log.h" 15#include "log.h"
14 16
15 static bool assert_xwayland(struct sway_view *view) { 17 static bool assert_xwayland(struct sway_view *view) {
@@ -171,4 +173,9 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
171 sway_view->swayc = cont; 173 sway_view->swayc = cont;
172 174
173 arrange_windows(cont->parent, -1, -1); 175 arrange_windows(cont->parent, -1, -1);
176
177 for (int i = 0; i < server->input->seats->length; ++i) {
178 struct sway_seat *seat = server->input->seats->items[i];
179 sway_seat_set_focus(seat, cont);
180 }
174} 181}