Commit Graph

563 Commits

Author SHA1 Message Date
Dorota Czaplejewicz
b409df15bb ui: Update UI state based on output events 2020-03-12 11:26:49 +00:00
Dorota Czaplejewicz
7dd2866b17 ui manager: Update state and calculate new size on ouptut change 2020-03-12 11:26:49 +00:00
Dorota Czaplejewicz
f6fc6c83dc outputs: Pass output updates
Introduce a callback in `outputs::Outputs` that calls on every `wl_output.done`, and a dummy consumer in `ui_manager`.

This is sufficient to detect display height changes.
2020-03-12 11:26:49 +00:00
Dorota Czaplejewicz
fa5c7c63d9 ui_manager: Calculate max_height in a purer fashion 2020-03-12 11:26:49 +00:00
Dorota Czaplejewicz
1093e32325 sizing: Use physical dimensions of the display to determine optimal keyboard height.
Parameters fudged appropriately to preserve dimensions from the original design targting Librem5:

- 720×1440 results in 420px height, via max finger size
- 1440×720 results in 360px height, via not exceeding half the display

In absence of physical dimensions, a pixel is assumed to measure half the size as on the Librem5, and then shrunk by the current display scale factor.This gives the ability to test in nested phoc at selected scale factors like before (2x being most accurate), and keeps the right size in QEMU.
2020-03-12 11:26:49 +00:00
Dorota Czaplejewicz
3d1a641ca3 Merge remote-tracking branch 'upstream/master' into scaling 2020-03-12 10:51:30 +00:00
Dorota Czaplejewicz
0466a520f2 Merge branch 'predictoin_ui' into 'master'
Cleanups to make EekGtkKeyboard more standalone

See merge request Librem5/squeekboard!336
2020-03-12 10:46:14 +00:00
Dorota Czaplejewicz
9e8aca1cbf Merge branch 'unavailable' into 'master'
Crash less when outside resources are unavailable

See merge request Librem5/squeekboard!341
2020-03-11 10:55:05 +00:00
Dorota Czaplejewicz
8ff8e8ac48 Merge remote-tracking branch 'upstream/master' into scaling 2020-03-07 10:46:09 +00:00
Dorota Czaplejewicz
abaaf04b87 Merge branch 'modifiers' into 'master'
Add simple modifiers support

See merge request Librem5/squeekboard!306
2020-03-07 10:32:33 +00:00
Dorota Czaplejewicz
3cd170acc3 sizing: Create a standalone UI shape manager
The manager is used for sizing the layer surface. It promises never to exceed half the output height.

The selection of the current layout is not being done here, leading to worse behaviour in 1:1 scaling.

In the future, it could be used for sizing the keyboard itself and the suggestion box, as well as decide which layout to use, because layouts should have some sizing hints.
2020-03-07 10:31:39 +00:00
Dorota Czaplejewicz
61e1ab5c5a layout: Split out choice to a struct on its own 2020-03-07 10:26:52 +00:00
&t
67cc4f11cf Fix minor comment typos 2020-03-04 04:53:53 +00:00
Dorota Czaplejewicz
8ac2b5a713 gsettings: Don't crash on switching when unavailable 2020-03-03 19:46:53 +00:00
Dorota Czaplejewicz
8bae8fe5bb dbus: Don't crash if can't make a connection 2020-03-03 19:25:49 +00:00
Dorota Czaplejewicz
92e9d994fe modifiers: Support Control and Alt
Control and Alt are special in that they aren't expected to switch levels, and so don't need to change what characters are output.

Use in layouts by adding `modifier: Control` or `modifier: Alt` in place of `text: "foo"`.

The latching of the modifier will force the keyboard to emit raw key presses and prevent it from outputting text.
2020-02-28 11:21:07 +00:00
Dorota Czaplejewicz
80919dbc42 Merge branch 'fix_ref' into 'master'
Variant: Use proper pointer conversion between C and Rust

See merge request Librem5/squeekboard!334
2020-02-28 11:08:46 +00:00
Dorota Czaplejewicz
46cbaf8e87 keyboard: Remove unused code 2020-02-23 12:15:19 +00:00
Dorota Czaplejewicz
c0aee5de26 Variant: Use proper pointer conversion between C and Rust 2020-02-20 12:17:50 +00:00
Dorota Czaplejewicz
cb802cfb50 layout: Improve press handling
Makes it more similar to release handling, removes some redundant checks.

This makes it easier to integrate modifiers in the future.
2020-02-19 15:40:39 +00:00
Dorota Czaplejewicz
85be855032 text input: Disable erasing
Erasing with zwp_text_input_v3 version 1 requires bytes, and bytes require get_surrounding_text. That, however, is optional. That's a mistake in protocol design.

Easiest to drop this until the mess is solved on the protocol side.
2020-02-12 10:56:07 +00:00
Dorota Czaplejewicz
a57a78aa2e Merge branch 'center' into 'master'
Center views relative to layout space

See merge request Librem5/squeekboard!326
2020-02-09 20:34:31 +00:00
Sebastian Krzyszkowiak
41be2747d5 Merge branch 'fix' into 'master'
layout: Improve scoping of locked variable

See merge request Librem5/squeekboard!329
2020-02-05 13:19:19 +00:00
Dorota Czaplejewicz
c766fae686 layout: Improve scoping of locked variable 2020-02-05 12:55:31 +00:00
Dorota Czaplejewicz
aadcdbf276 Merge branch 'langs' into 'master'
Update translations & greek

See merge request Librem5/squeekboard!315
2020-02-05 11:05:42 +00:00
Dorota Czaplejewicz
10178d204b Merge remote-tracking branch 'upstream/master' into center 2020-02-05 10:32:07 +00:00
Sebastian Krzyszkowiak
0ac8c620fd Merge branch 'lock' into 'master'
Turn locking stateless

See merge request Librem5/squeekboard!322
2020-02-05 09:25:49 +00:00
Guido Gunther
80e83781bb Merge branch 'leaks' into 'master'
Allocation problems

See merge request Librem5/squeekboard!327
2020-02-05 09:24:46 +00:00
Dorota Czaplejewicz
37e1ed93a6 Merge branch 'text_input_enable' into 'master'
Submit and delete strings via text_input

See merge request Librem5/squeekboard!304
2020-02-03 15:06:25 +00:00
Dorota Czaplejewicz
1cbc21ad11 variant: Fix double-free
gio::Settings::set_value takes over ownership of the Variant sometimes, but in other cases it doesn't. To prevent this being a problem, the custom Variant is made of the type that will never have its ownership taken.

This is not necessarily consistent with what gtk-rs authors intended.

In practice, the ownership is shared by refcounting, and after the Rust reference is dropped, one taken by Settings survives.
2020-02-03 14:53:24 +00:00
Dorota Czaplejewicz
416bc6163e drawing: Generalized foreach_visible_button 2020-02-02 18:29:29 +00:00
Dorota Czaplejewicz
40b79f6209 layout: Center views relative to each other and the layout bounds 2020-02-02 18:07:28 +00:00
Dorota Czaplejewicz
782d80a007 row: Eliminate angle 2020-02-02 17:11:25 +00:00
Dorota Czaplejewicz
500c23beec locking: Lock keys statelessly
Locking is not determined by button state any more, but rather based on the view active at the moment. If pressing/locking a key results in the current view being active, the key is active. If locking a key results in the current view, the unlock view is activated.
2020-02-02 15:41:47 +00:00
Dorota Czaplejewicz
97d8dfe4cb locks: Draw based on current view 2020-02-02 14:45:33 +00:00
Sebastian Krzyszkowiak
b9db00c00c layouts: Add Polish layouts 2020-01-30 21:19:13 +01:00
Dorota Czaplejewicz
7a588460bf setup: Connect ui to the state manager
This ensures that the layout type information is accessible to the state manager when new layout information arrive.

The should be thought of as a stopgap measure. A proper solution would be to separate the state properly, and probably turn layout information coming from random places into messages that some object (thread?) collects and displays.
2020-01-28 21:32:47 +00:00
Dorota Czaplejewicz
7f32c5cf23 greek: Rename to gr which is used by gnome settings 2020-01-28 19:17:47 +00:00
Dorota Czaplejewicz
2ffbdde758 layouts: Fix segfault on switching to wide 2020-01-28 16:42:58 +00:00
Dorota Czaplejewicz
cd252634bd logging: Use in merged functions 2020-01-28 12:45:45 +00:00
Dorota Czaplejewicz
de8aaa1a47 Merge remote-tracking branch 'upstream/master' into text_input_enable 2020-01-28 12:39:42 +00:00
Dorota Czaplejewicz
ac360b610f Merge branch 'log' into 'master'
Unify logging

See merge request Librem5/squeekboard!308
2020-01-28 11:42:02 +00:00
Dorota Czaplejewicz
f326929634 Merge branch 'text_input' into 'master'
Text input integration

See merge request Librem5/squeekboard!302
2020-01-24 09:41:14 +00:00
Dorota Czaplejewicz
585ed5e97d input_method: Use for erasing 2020-01-23 15:39:40 +00:00
Dorota Czaplejewicz
2b65beba44 press_key: Use proper logging 2020-01-20 15:40:30 +00:00
Dorota Czaplejewicz
5129d42577 Merge remote-tracking branch 'upstream/master' into log 2020-01-20 15:40:01 +00:00
Dorota Czaplejewicz
8d06815279 Merge branch 'cleanups' into 'master'
C-side Cleanups

See merge request Librem5/squeekboard!300
2020-01-19 12:57:40 +00:00
Dorota Czaplejewicz
c75e085dc8 logging: Unified to remove random eprint calls 2020-01-17 12:25:39 +00:00
Dorota Czaplejewicz
cc418c3609 imservice: Return something more resembling an Error on failure
The error type is expected to be printable by logging utilities.
2020-01-17 11:59:47 +00:00
Dorota Czaplejewicz
ea84f4f031 logging: Try to improve common operations
This adds sugar for logging `Result`s with a handler, makes names evoke something closer to "logging" than "warning", tries to remove any redundant `Logging` where the module name will do, and introduces a type strictly for bad things happening.
2020-01-16 15:57:46 +00:00