Skip to content

Commit 74de29c

Browse files
fix: separate text fields without window identity
1 parent a9136fb commit 74de29c

10 files changed

Lines changed: 38 additions & 11 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lay"
3-
version = "0.1.218"
3+
version = "0.1.219"
44
edition = "2021"
55
description = "Alpha Double Shift RU/EN layout rescue for Linux desktops"
66
license = "MIT"

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ curl -fsSL https://raw.githubusercontent.com/radislabus-star/lay-public/main/scr
4444
По умолчанию double Shift исправляет **1 последнее слово**. Области `2 слова`
4545
и `3 слова` можно включить отдельно в трее.
4646

47+
## Что нового в 0.1.219
48+
49+
- исправлен Niri/backend-кейс без `focused_window_identity`: при смене
50+
текстового поля буфер теперь разделяется по `field_context_epoch`, поэтому
51+
хвост из одного поля не склеивается с вводом в другом поле;
52+
- добавлен регрессионный тест на сценарий без информации об окне.
53+
4754
## Что нового в 0.1.218
4855

4956
- GNOME extension больше не пишет штатные success-сообщения в журнал при каждом

VERSIONING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ number from `git rev-list`.
1313

1414
Current publication branch version:
1515

16-
- `0.1.218`
16+
- `0.1.219`
1717

1818
Do not rely on commit counts. Before publishing or pushing, run the bump script
1919
or verify the version fields manually.

extension/lay@radislabus-star.github.io/metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"uuid": "lay@radislabus-star.github.io",
33
"name": "Lay Layout Switcher",
4-
"version": 218,
5-
"version-name": "0.1.218",
4+
"version": 219,
5+
"version-name": "0.1.219",
66
"description": "Alpha GNOME Shell extension для lay-daemon. Показывает EN/RU в трее, переключает раскладку по клику. Минимальный DBus bridge для layout activation и fallback text insert.",
77
"shell-version": ["45", "46", "47", "50"],
88
"url": "https://github.com/radislabus-star/lay-public"

extension/lay@radislabus-star.github.io/prefs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Gtk from 'gi://Gtk';
66
import {ExtensionPreferences} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
77

88
const CONFIG_PATH = GLib.get_home_dir() + '/.config/lay/config.json';
9-
const APP_VERSION = '0.1.218';
9+
const APP_VERSION = '0.1.219';
1010
const APP_RELEASE_DATE = '2026-06-07';
1111
const APP_URL = 'https://github.com/radislabus-star/lay-public';
1212
const APP_ICON_NAME = 'input-keyboard-symbolic';

extension/lay@radislabus-star.github.io/settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import GLib from 'gi://GLib';
44
import Gtk from 'gi://Gtk';
55

66
const CONFIG_PATH = GLib.get_home_dir() + '/.config/lay/config.json';
7-
const APP_VERSION = '0.1.218';
7+
const APP_VERSION = '0.1.219';
88
const APP_RELEASE_DATE = '2026-06-07';
99
const APP_URL = 'https://github.com/radislabus-star/lay-public';
1010
const APP_ICON_NAME = 'input-keyboard-symbolic';

extension/lay@radislabus-star.github.io/tray_support.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const STATS_PATH = GLib.get_home_dir() + '/.local/share/lay/stats.json';
66
export const RECENT_ACTIONS_PATH = GLib.get_home_dir() + '/.local/share/lay/recent_actions.jsonl';
77
export const PROJECT_DIR = GLib.get_home_dir() + '/projects/lay';
88
export const UPDATE_LOG_PATH = GLib.get_home_dir() + '/.local/state/lay/update.log';
9-
export const APP_VERSION = '0.1.218';
9+
export const APP_VERSION = '0.1.219';
1010
export const APP_DESCRIPTION = 'Альфа: RU/EN-переключатель по двойному Shift и помощь при наборе';
1111
export const APP_RELEASE_DATE = '2026-06-07';
1212
export const APP_LICENSE = 'MIT';

src/bin/lay_daemon/daemon_state.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,10 @@ impl DaemonLoopState {
151151
}
152152

153153
fn active_text_context_identity(&self) -> Option<String> {
154-
self.focused_window_identity
155-
.as_ref()
156-
.map(|window| format!("{window}:field:{}", self.field_context_epoch))
154+
Some(match self.focused_window_identity.as_ref() {
155+
Some(window) => format!("{window}:field:{}", self.field_context_epoch),
156+
None => format!("field:{}", self.field_context_epoch),
157+
})
157158
}
158159

159160
fn should_save_current_text_context(&self) -> bool {

src/bin/lay_daemon/tests/runtime_state.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,25 @@ fn text_field_context_keeps_unfinished_words_separate_inside_same_window() {
228228
);
229229
}
230230

231+
#[test]
232+
fn text_field_context_separates_fields_without_window_identity() {
233+
let mut state = DaemonLoopState::new(&LayConfig::default(), false, false);
234+
235+
push_text_as_layout(&mut state.buffer, "qwe", false);
236+
assert_eq!(
237+
map_original_events(&state.buffer.what_to_replay(1).unwrap().0),
238+
"qwe"
239+
);
240+
241+
assert!(state.switch_field_context_epoch(1));
242+
assert!(state.buffer.current_is_empty());
243+
push_text_as_layout(&mut state.buffer, "qwe", false);
244+
assert_eq!(
245+
map_original_events(&state.buffer.what_to_replay(1).unwrap().0),
246+
"qwe"
247+
);
248+
}
249+
231250
#[test]
232251
fn text_field_context_does_not_accumulate_empty_slots() {
233252
let mut state = DaemonLoopState::new(&LayConfig::default(), false, false);

0 commit comments

Comments
 (0)