mirror of
https://github.com/swaywm/sway.git
synced 2025-11-24 06:59:51 -05:00
Implement enough IPC for swaybar to work
This commit is contained in:
parent
b72825441b
commit
6836074fed
8 changed files with 251 additions and 31 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include "sway/input/cursor.h"
|
||||
#include "sway/input/input-manager.h"
|
||||
#include "sway/input/keyboard.h"
|
||||
#include "sway/ipc-server.h"
|
||||
#include "sway/output.h"
|
||||
#include "sway/view.h"
|
||||
#include "log.h"
|
||||
|
|
@ -309,18 +310,31 @@ void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container) {
|
|||
if (container->type == C_VIEW) {
|
||||
struct sway_view *view = container->sway_view;
|
||||
view_set_activated(view, true);
|
||||
struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat->wlr_seat);
|
||||
struct wlr_keyboard *keyboard =
|
||||
wlr_seat_get_keyboard(seat->wlr_seat);
|
||||
if (keyboard) {
|
||||
wlr_seat_keyboard_notify_enter(seat->wlr_seat, view->surface,
|
||||
keyboard->keycodes, keyboard->num_keycodes,
|
||||
&keyboard->modifiers);
|
||||
wlr_seat_keyboard_notify_enter(seat->wlr_seat,
|
||||
view->surface, keyboard->keycodes,
|
||||
keyboard->num_keycodes, &keyboard->modifiers);
|
||||
} else {
|
||||
wlr_seat_keyboard_notify_enter(seat->wlr_seat, view->surface,
|
||||
NULL, 0, NULL);
|
||||
wlr_seat_keyboard_notify_enter(
|
||||
seat->wlr_seat, view->surface, NULL, 0, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (last_focus) {
|
||||
swayc_t *last_ws = last_focus;
|
||||
if (last_ws && last_ws->type != C_WORKSPACE) {
|
||||
last_ws = swayc_parent_by_type(
|
||||
last_focus, C_WORKSPACE);
|
||||
}
|
||||
if (last_ws) {
|
||||
wlr_log(L_DEBUG, "sending workspace event");
|
||||
ipc_event_workspace(last_ws, container, "focus");
|
||||
}
|
||||
}
|
||||
|
||||
if (last_focus && last_focus->type == C_VIEW &&
|
||||
!sway_input_manager_has_focus(seat->input, last_focus)) {
|
||||
struct sway_view *view = last_focus->sway_view;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue