We're leaking the fd when sending cut'n'paste. Failure to close can also
makes the other end unhappy because it doesn't know the paste is finished.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Direct fail_on_null calls now produce output like:
[weston-info] clients/weston-info.c:714: out of memory
xmalloc, et al produce output on failure like:
[weston-info] out of memory (-1)
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
To help reduce code duplication and also 'kitchen-sink' includes
the ARRAY_LENGTH macro was moved to a stand-alone file and
referenced from the sources consuming it. Other macros will be
added in subsequent passes.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Fixes warning:
clients/editor.c: In function ‘data_source_send’:
clients/editor.c:573:7: warning: ignoring return value of ‘write’,
declared with attribute warn_unused_result [-Wunused-result]
write(fd, editor->selected_text, strlen(editor->selected_text) + 1);
^
weston-editor is the only stock client spawning the virtual
keyboard ; which means it may be the only client able to
obtain some special characters (depending on the user's
keyboard layout).
If we implement Cut, Copy and Paste, the user has now a way
to copy such characters to other useful clients (such as
weston-terminal). Plus, it demonstrates text data exchange
between two clients of different nature.
Functionality is implemented in a right-click menu and the
Ctrl+Shift+X/C/V bindings, just as in weston-terminal.
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Tested-by: Bryce Harrington <bryce@osg.samsung.com>
With multi-seat, multiple entries can occur on the text inputs in the
editor. Also, the panel shouldn't be hidden by the editor if either
text entry is still active.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Just changes some places where a malloc failure is unhandled
to our xmalloc function that exit()s a little more gracefully.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
In many clients of weston, Display was not being destroyed so added it.
Also destroy windows, widgets which were not being destroyed.
Signed-off-by: vivek <vivek.ellur@samsung.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
The calculation off the vertical offset between the widget coordinates
and where the text was rendered was wrong. It was using the constant for
horizontal offset for that too.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=78411
The editor will now insert new lines and tabulations when
pressing the corresponding keys on the virtual keyboard.
The Up and Down arrows can be used to navigate through
lines.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77496
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
If the shift modifier is active then we don't make the cursor and the
anchor the same and as a result we develop a selection in the direction
that the arrow key gets pressed in.
https://bugs.freedesktop.org/show_bug.cgi?id=66802
Ignore the whole commit-string or preedit_string transaction when the
delete_surrounding event was invalid.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Delete text marked with wl_text_input::delete_surrounding_text on
preedit_string event. When text is explicitly marked with
delete_surrounding_text do not delete selected text.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
There were some reset calls missing, which resulted in wrong preedit
state on input method side.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Add an extra cursor_position, which also allows to change the anchor
(for slections). Change the index type to int to allow setting it before
the beginning of a commited string.
The cursor should not be moved as a direct repsonse to this event but
atomically on the next commit_string event.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Allows to show/hide the input panel (virtual keyboard) more independent
of focus (some applications might to require additionaly click on a
focused entry to show the input panel).
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Allows for atomic state changes. Updated surrounding text, content type
and micro focus is taken into account all at once at commit.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>