aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-04 19:23:04 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-04 19:36:19 +1000
commit32cb631143fe9087d9d14e96f42a38f602369212 (patch)
tree1f7e9fcb9858e02b3d97e5a8cf78f54829954e2b /sway/input
parentMerge pull request #2759 from minus7/fix-view-container-null (diff)
downloadsway-32cb631143fe9087d9d14e96f42a38f602369212.tar.gz
sway-32cb631143fe9087d9d14e96f42a38f602369212.tar.zst
sway-32cb631143fe9087d9d14e96f42a38f602369212.zip
Give focus to another swaylock surface when output is disconnected
* Have multiple outputs * Launch swaylock * Unplug an output (possibly has to be the last "connected" one) * The swaylock surface on the remaining output would not respond to key events This was happening because when the output destroys, focus was not given to the other swaylock surface. This patch makes focus be transferred to another surface owned by the same Wayland client, but only if input was inhibited by the surface being destroyed, and only if it's in the overlay layer. I figure it's best to be overly specific and relax the requirements later if needed. This patch removes a check in seat_set_focus_surface which was preventing focus from being passed from a layer surface to any other surface. I don't know of a use case for this check, but it's possible that this change could produce issues.
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/seat.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 15c56a43..415f85ac 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -800,9 +800,6 @@ void seat_set_focus_workspace(struct sway_seat *seat,
800 800
801void seat_set_focus_surface(struct sway_seat *seat, 801void seat_set_focus_surface(struct sway_seat *seat,
802 struct wlr_surface *surface, bool unfocus) { 802 struct wlr_surface *surface, bool unfocus) {
803 if (seat->focused_layer != NULL) {
804 return;
805 }
806 if (seat->has_focus && unfocus) { 803 if (seat->has_focus && unfocus) {
807 struct sway_node *focus = seat_get_focus(seat); 804 struct sway_node *focus = seat_get_focus(seat);
808 seat_send_unfocus(focus, seat); 805 seat_send_unfocus(focus, seat);