Commit graph

21 commits

Author SHA1 Message Date
Tadeo Kondrak
6562cf724a text-input: Add actions
Signed-off-by: Tadeo Kondrak <me@tadeo.ca>
2025-12-19 20:36:44 +01:00
dcz
0dd05d436f text-input: Reword and clarify cursor syncing
This change makes it clear that there's an extra buffer for the value.
This explains the purpose of the complicated design.

Signed-off-by: Dorota Czaplejewicz
2025-12-18 18:54:23 +01:00
Tadeo Kondrak
ba4ea256d1 text-input: Synchronize set_cursor_rectangle with the wl_surface
Signed-off-by: Tadeo Kondrak <me@tadeo.ca>
2025-12-18 18:52:19 +01:00
Tadeo Kondrak
163b040461 text-input: Add preedit_shown flag
Some clients don't show preedit text inline, so the compositor may
want to display the preedit text in a popup window instead.

Signed-off-by: Tadeo Kondrak <me@tadeo.ca>
2025-12-18 18:52:19 +01:00
fujiwarat
67be8069dc text-input: Add no Emoji input
Allow hinting input methods about if Emoji support is not useful
for special applications likes IDE, which manage or debug other
applications.

Fixes: #79

Signed-off-by: fujiwarat <takao.fujiwara1@gmail.com>
2025-12-18 18:52:19 +01:00
Dorota Czaplejewicz
afffbd8bf5 text-input: Add on_screen_input_provided hint
The new hint is meant to indicate that the text input already provides an on-screen means to enter data, and that using the system provided input method may not be needed.

It should be used when the client presents the user with a custom on-screen input method, like an on-screen keyboard, or perhaps a dropdown list.

The new hint is meant to address the issue when the system input method is an on-screen keyboard. Without the hint, the input method would not know that it's not needed, unless the client refrained from using the input method protocol at all.

With the hint, the input method can still be enabled, while not displaying a second on-screen keyboard. This allows for the system input method to still provide accessibility services, as well as text completion or prediction.

Based on discussion in https://gitlab.gnome.org/GNOME/gtk/merge_requests/978

Signed-off-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm>
2025-12-18 18:52:19 +01:00
dcz
3718d0077b text-input-v3: Replace "active"
"Active" is not defined anywhere. The meaning of "focused" can be extrapolated from surfaces to text fields.

Signed-off-by: Dorota Czaplejewicz
2025-06-05 16:23:23 +00:00
dcz
104eda7e1f text-input-v3: Clarify enabling and seats
This fixes the ambiguous language which caused https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/214 .

This also replaces "active" with "enabled" in the next sentence. No "active" state is defined anywhere in the document.

Signed-off-by: Dorota Czaplejewicz
2025-06-05 16:23:23 +00:00
Daniel Stone
3544c6dcc4 protocols: Add GitLab contact information
This is useful to know who to ping when you want to change something.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2024-10-09 09:07:11 +00:00
Carlos Garnacho
37fa0f4a4e text-input: Reword the interpretation of serials to be more specific
Here's a long story. The serial is formerly described as:

  When the client receives a done event with a serial different than the
  number of past commit requests, it must proceed as normal, except it
  should not change the current state of the zwp_text_input_v3 object.

Upon first reading it might be obvious to interpret "proceed as normal"
as "apply the changes made by the done event" and "not change the current
state" as "do not make requests on it until serial matches with
expectations again". This would turn the serial into a flow control
mechanism to avoid pushing state changes that we know might be stale.

GTK however makes another outlandish interpretation, where "proceed as
normal" means "ignore the changes made by the done event" and "not change
state of the zwp_text_input_v3 object" is "not change client state". This
makes the serial a full synchronization mechanism where IM commands that
are deemed out of sync are symply ignored.

This would seem a misinterpretation of the protocol, and I proceeded to
change the behavior in GTK. Then some deja vu feeling struck me and I found
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/384#note_344864, this
change was already done and discussed in the past. Not just that, it is
the right interpretation.

However, there's some notable disadvantages, there's 2 easy ways to
completely break the synchronization between compositor and client:
Having the IM push new state too often (i.e. multiple consecutive
.done events), or having the client .commit too often. If any of both
peers gets ahead of the other slightly, the end result is ignored input.
More specifically, IBus has no provision for this kind of transactional
behavior (probably other IMs too), so implementing "emit .done once after
a set of changes" is not quite possible.

Arguably, ignoring IM input is also a bad thing. IMs expect all commands
to be respected and applied in order and might even rely on that in
their own internal state. Since only state changes are flushed on .done
events, partially ignoring IM commands will end up with the client IM state
out of sync.

The usecase described at that GNOME gitlab comment (edited text changes
happening in parallel to IM interaction) trades the handling of an
inherently racy corner case with the worst kind of mishandling (ignoring
user input) if IM/client don't perfectly sync up.

On the other hand, the flow control approach is more lenient with IMs and
clients "getting a step ahead", and more importantly does not punish the
user whenever either IM/client happens to do that. Double down on this
(already intuitively correct) description, and specify further what it
implies.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
2022-03-29 07:33:38 +00:00
onox
d10d18f3d4
text-input: Add enum attributes to various arguments
Signed-off-by: onox <denkpadje@gmail.com>
2021-01-05 19:37:16 +01:00
Bhushan Shah
4ed0cafeef text-input: document behavior regarding multiple text-inputs
Currently protocol does not specify what should happen if multiple
text-inputs are created by same client, which is why this is more or
less undefined behavior currently in compositor implementations.

If client has created more than one text-input objects and surface owned
by the client is focused, then compositor must send enter event to all
text-input objects, in case of enable request however only one
text-input must be enabled per client per seat.

Signed-off-by: Bhushan Shah <bshah@kde.org>
2020-11-03 20:16:27 +05:30
Carlos Garnacho
db152d7c6f text-input: Add v3 of the text-input protocol
This new protocol description is an evolution of v2.

- All pre-edit text styling is gone.
- Pre-edit cursor can span characters.
- No events regarding input panel (OSK) state nor covered rectangle.
  Compositors are still free to handle situations where the keyboard
  focus rectangle is covered by the input panel.
- No set_preferred_language request for clients.
- There is no event to send keysyms. Compositors can use wl_keyboard
  interface instead.
- All state is double-buffered, with specified defaults.
- The compositor can be notified about external changes to the state.
- The client can detect outdated requests.

Signed-off-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm>
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
2018-07-30 17:42:39 +02:00
Yong Bakos
d2ba6ad422 text-input: Correct grammar
Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-08-30 17:13:08 +08:00
Yong Bakos
594bb8e093 text-input: Rename text-input to text_input
Interface names are lower_snake_case, and corresponding descriptions
should match, for accuracy and clarity. This renaming only affects
description text, to follow the convention that exists elswhere in
this protocol document and in other protocol docs, when referring to
interface names.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-08-30 17:13:08 +08:00
Yong Bakos
c5802797bd text-input: Fix indentation and paragraph whitespace
Replace the tab indentation of the MIT license with appropriate spaces.
Add one missing line break between two description paragraphs.
Adjust two line breaks to keep descriptions under 80 chars / line.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-08-30 17:13:08 +08:00
Bryce Harrington
2009a70f56 Fix grammar for 'an X*'
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-07-08 11:05:20 -07:00
Jonas Ådahl
a776e94477 Apply the new version suffix convention to the protocols
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2015-11-09 15:04:24 +08:00
Jonas Ådahl
06fc2c1e57 Change all of the zwl_ prefixed protocols to use the zwp_ prefix
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2015-11-09 15:04:24 +08:00
Jonas Ådahl
ab64cfa492 Add README files containing protocol maintainers
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2015-10-29 11:08:12 +08:00
Jonas Ådahl
e5fea4ed0b Migrate the text input protocol
Renamed from "text" to "text-input" and applied the unstable naming
convention.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2015-10-21 16:20:52 +08:00