[PATCH wayland-protocols] text: Create second version of text input protocol

Jan Arne Petersen janarne at gmail.com
Thu Jan 28 02:26:04 PST 2016


On 28/01/16 10:46, Giulio Camuffo wrote:
>> +    <request name="set_surrounding_text">
>> +      <description summary="sets the surrounding text">
>> +       Sets the plain surrounding text around the input position. Text is
>> +       UTF-8 encoded. Cursor is the byte offset within the
>> +       surrounding text. Anchor is the byte offset of the
>> +       selection anchor within the surrounding text. If there is no selected
>> +       text anchor is the same as cursor.
>> +      </description>
>> +      <arg name="text" type="string"/>
> The string type has a maximum allowed size, i wonder if that is a
> problem. See https://bugreports.qt.io/browse/QTBUG-43789
> If it's ok i think the documentation should be explicit about it,
> otherwise maybe we could pass a fd instead of a string, that the
> compositor would read from to get the surrounding text.

Yes, we should document, that one should not send too big texts with
this request. In my opinion 4076 Byte (around the cursor) should be
usually enough (also for performance reasons we do not want to send so
much text around). The limit needs to be enforced by the toolkit to
prevent bugs like the above though.

If there is rally a need for bigger surrounding texts, we can still add
another request with a fd to a later protocol version.

Jan Arne

Jan Arne Petersen | jan.petersen at kdab.com | Senior Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts

More information about the wayland-devel mailing list