diff options
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r-- | sway/input/cursor.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index e47410a5..b168afc5 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -253,6 +253,32 @@ int cursor_get_timeout(struct sway_cursor *cursor) { | |||
253 | return timeout; | 253 | return timeout; |
254 | } | 254 | } |
255 | 255 | ||
256 | void cursor_notify_key_press(struct sway_cursor *cursor) { | ||
257 | if (cursor->hidden) { | ||
258 | return; | ||
259 | } | ||
260 | |||
261 | if (cursor->hide_when_typing == HIDE_WHEN_TYPING_DEFAULT) { | ||
262 | // No cached value, need to lookup in the seat_config | ||
263 | const struct seat_config *seat_config = seat_get_config(cursor->seat); | ||
264 | if (!seat_config) { | ||
265 | seat_config = seat_get_config_by_name("*"); | ||
266 | if (!seat_config) { | ||
267 | return; | ||
268 | } | ||
269 | } | ||
270 | cursor->hide_when_typing = seat_config->hide_cursor_when_typing; | ||
271 | // The default is currently disabled | ||
272 | if (cursor->hide_when_typing == HIDE_WHEN_TYPING_DEFAULT) { | ||
273 | cursor->hide_when_typing = HIDE_WHEN_TYPING_DISABLE; | ||
274 | } | ||
275 | } | ||
276 | |||
277 | if (cursor->hide_when_typing == HIDE_WHEN_TYPING_ENABLE) { | ||
278 | cursor_hide(cursor); | ||
279 | } | ||
280 | } | ||
281 | |||
256 | static enum sway_input_idle_source idle_source_from_device( | 282 | static enum sway_input_idle_source idle_source_from_device( |
257 | struct wlr_input_device *device) { | 283 | struct wlr_input_device *device) { |
258 | switch (device->type) { | 284 | switch (device->type) { |