An application can keep the keyboard to itself and see Alt, an external field declares what it is for, and the size hint is fitted to the screen before the first commit
A terminal takes every key and turns it into bytes for its program, which ltk's key handling got in the way of in three ways. Enter and Space pressed the widget that had the focus, or the one hovered, as well as reaching the application: in prompt a tap on the extra keys row's up arrow left that button focused, so the next Enter ran the command and then pressed the arrow again, bringing the command back on the prompt. The field held by `external_text_input` was always enabled with the normal purpose, so the on-screen keyboard never offered its row of terminal keys to an application that draws its own text area. And `on_raw_key` reports Ctrl and Shift but not Alt, which a terminal sends as a prefix or a parameter. Keeping the keyboard. `App::claims_keyboard`, false by default, makes `press_key` stop after `on_raw_key` while it is true: the key is not dispatched to the widgets, so neither Enter nor Space presses anything and arrows do not move the keyboard hover, and ltk does not start its own repeat; a repeat already running is stopped as before. `XF86_Back` still goes through the dispatch and `on_back`. An application returns it while its own surface has the keys, and false when one of its menus is up, which then behaves as before. The external field's purpose. `App::external_text_purpose`, `Purpose::Normal` by default, is what `sync_external_text_input` enables the text-input with, and what it renews it with when the serial changes, so `Purpose::Terminal` reaches the compositor as `ContentPurpose::Terminal` and forge shows the terminal row above the layout. Alt. `AppData` gains `alt_pressed`, kept by `update_modifiers` with the other two. The runtime now calls `App::on_raw_key_with_alt`, on press and on release, with the same arguments as `on_raw_key` plus Alt; its default forwards to `on_raw_key`, so the applications that implement only that one see no change, and an application that needs Alt overrides the new one instead. The size hint. A window size hint bigger than the screen used to be fitted only after the first configure, so the first commit asked the compositor for a size it could not give, and a mobile compositor would rescale the window to honour it. Before the first commit `try_run` now reads the logical size of the first output through `output_probe`, on an event queue of its own, and fits the hint within `window_fit::output_share` of it, the same 90 % the later fit uses; that size is what the toplevel is pinned to and what `fitted_size_hint` starts with, and the fit after the first configure is skipped when it was done. The documentation of `window_resizable` now says both the minimum and the maximum are released from the first configure, since a minimum left in place has the same effect on a mobile compositor. Pointer hooks. The documentation of `on_pointer_move` and of the left-button hook now says they are also called for the primary finger's touch down, motion and up. Not done. A key held when the window loses the keyboard is stopped by ltk's own repeat but not by an application that repeats keys itself, since there is no hook for the keyboard leaving. Logo and AltGr are still not reported to `on_raw_key_with_alt`.
This commit is contained in:
@@ -163,6 +163,7 @@ pub struct AppData<A: App>
|
||||
smithay_client_toolkit::foreign_toplevel_list::ForeignToplevelList,
|
||||
pub shift_pressed: bool,
|
||||
pub ctrl_pressed: bool,
|
||||
pub alt_pressed: bool,
|
||||
/// Calloop handle for inserting timers / channels. Used by the
|
||||
/// key-repeat machinery and any future feature that needs to
|
||||
/// schedule work on the run loop without going through the message
|
||||
|
||||
Reference in New Issue
Block a user