From a120d4c79f9406a2f7cc38c60069d3183c98ea87 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 15 Jul 2018 15:20:21 +1000 Subject: Make focus part of transactions Rather than maintain copies of the entire focus stack, this PR transactionises the focus by introducing two new properties to the container state and using those when rendering. * `bool focused` means this container has actual focus. Only one container should have this equalling true in its current state. * `struct sway_container *focus_inactive_child` points to the immediate child that was most recently focused (eg. for tabbed and stacked containers). --- sway/input/cursor.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sway/input/cursor.c') diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 307eedd4..7a9f3ed7 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -10,6 +10,7 @@ #include #include "list.h" #include "log.h" +#include "sway/desktop/transaction.h" #include "sway/input/cursor.h" #include "sway/layers.h" #include "sway/output.h" @@ -219,6 +220,7 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec, struct sway_drag_icon *drag_icon = wlr_drag_icon->data; drag_icon_update_position(drag_icon); } + transaction_commit_dirty(); } static void handle_cursor_motion(struct wl_listener *listener, void *data) { @@ -278,6 +280,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor, wlr_seat_pointer_notify_button(cursor->seat->wlr_seat, time_msec, button, state); + transaction_commit_dirty(); } static void handle_cursor_button(struct wl_listener *listener, void *data) { -- cgit v1.2.3-54-g00ecf