Skip to content

Commit

Permalink
Also check title change event (it occurs in case tab change in browser)
Browse files Browse the repository at this point in the history
So for now we remember keyboard layout for each tab in browser and
reapply it on focus
  • Loading branch information
dmitry-j-mikhin committed Oct 10, 2023
1 parent 6409272 commit a7a0dac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sway.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ int sway_monitor(on_focus fn_focus, on_close fn_close, on_layout fn_layout)
struct json_object* event_node;
if (json_object_object_get_ex(msg, "change", &event_node)) {
const char* event_name = json_object_get_string(event_node);
if (strcmp(event_name, "focus") == 0) {
if (strcmp(event_name, "focus") == 0 || strcmp(event_name, "title") == 0) {
char w_str[CACHE_MAX_KEY_SIZE];
fill_window_name(w_str, sizeof(w_str), msg);
const int layout = fn_focus(w_str);
Expand Down

0 comments on commit a7a0dac

Please sign in to comment.