Compute the nearest glyph edge instead of taking the one to the
left of the cursor.
Also fixes a segfault when trying to compute the position for an empty
buffer.
Since commit 6a615d2621 [1], the opaque
region would be set only when running fullscreen. Having it set
properly for the windowed case is helpful to test the overlay path in
compositor-drm.
What this patch does is:
- reverts the above commit;
- remove the "if fullscreen make the window opaque" conditional, that
should have been removed when -o was introduced and was actually the
cause for the bug solved in [1];
- sets the opaque region when running fullscreen, regardless of the -o
switch.
[1] commit 6a615d2621
Author: Scott Moreau <oreaus@gmail.com>
Date: Thu Aug 30 14:44:16 2012 -0600
simple-egl: Only set alpha_size=0 when -o is passed.
v2: - Clarify in the commit message that this does not regress the bug
solved in [1].
- Use the correct sha1 for the reverted commit.
Add a reset request to the text_model interface and a reset event to the
input_method_context interface. Use it to reset the pre-edit buffers in
the example keyboard when the cursor is moved in the example editor
client.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Add key event to the text_model interface and a key request to the
input_method_context interface. Implement it in the example editor
client and the example keyboard.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Add delete_surrounding_text event in the text_model interface and the
request in the input_method_context interface. Implement it in the
example editor client and in the example keyboard so that the backspace
key works with it.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Add support of preedit-string to the example editor client. Also add a
preedit_string request to the input_method_context interface and use
that in the example weston keyboard to first create a pre-edit string
when entering keys and commit it on space.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Add support for a proper qwerty virtual keyboard layout with lowercase
and uppercase state, space and enter button.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
It makes sense to split the interfaces in a text and a input-method
protocol for now (only the text protocol needs to be used in toolkits).
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Add cursor and anchor positions as arguments to the set_surrounding_text
request. The cursor and anchor positions are relative to the surrounded
text, so it does not make sense to have that separate. Remove the
separate set_cursor_index and set_selected_text requests. Also update
the corresponding event in input-method-context and add support for it
in the weston example keyboard.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Add an input_method_context interface which is the representation of a
text_model on input_method side.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Remove the wl_surface argument from create_text_model request. The
wl_surface is specified as an argument in the activate request instead.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
The existing algorithm had some corner cases (pun!), where it failed to
produce correct vertices in the right order. This appeared only when the
surface was transformed (rotated). It also produced degenerate polygons
(3 or more vertices with zero polygon area) for non-transformed cases
where the clipping and surface rectangles were adjacent but not
overlapping.
Introduce a new algorithm for finding the boundary vertices of the
intersection of a coordinate axis aligned rectangle and an arbitrary
polygon (here a quadrilateral). The code is based on the
Sutherland-Hodgman algorithm, where a polygon is clipped by infinite
lines one at a time.
This new algorithm should always produce the correct vertices in the
clockwise winding order, and discard duplicate vertices and degenerate
polygons. It retains the fast paths of the existing algorithm for the
no-hit and non-transformed cases.
Benchmarking with earlier versions showed that the new algorithm is
a little slower (56 vs. 68 us/call) than the existing algorithm, for
the transformed case. The 'cliptest f' command before and after this
commit can be used to compare the speed of the transformed case only.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Acked-by: Rob Clark <rob.clark@linaro.org>
Cliptest is for controlled testing of the calculate_edges() function in
compositor.c. The function is copied verbatim into cliptest.c.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Two buttons are added to the right-click menu of the window frame for
moving a surface either up or down.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
After explaining the problem on irc, Pekka dictated this solution which works.
The problem is that simple-egl can hang when toggling fullscreen because of a
race where (quoting Pekka) "if it dispatches the frame callback simple-egl
itself requested before the Mesa's own frame callback came, simple-egl will go
to its redraw routing and call eglSwapBuffers so you end up effectively calling
eglSwapBuffers from within eglSwapBuffers, and deadlock". This patch avoids
redrawing (which calls eglSwapBuffers) when there is a pending frame callback.
When starting simple-egl with -f for fullscreen and toggling to 'windowed' mode with F11,
the surface is opaque instead of semi-trnasparent as it is when starting without -f. We
only want to create the surface with alpha_size=0 when the user explicitly passes -o
because otherwise it will never have the ability to use alpha.
The correspondence between cursor functions and names of cursors has
never been standardized. As a consequence, each cursor function can be
represented as a cursor with one of several names. Be more robust when
loading cursor by trying all known names that correspond to a cursor.
This should fix https://bugs.freedesktop.org/show_bug.cgi?id=50487
and https://bugs.freedesktop.org/show_bug.cgi?id=52609 a bit more
thoroughly.
This is a workaround for screenshots with transformed outputs. It reorders
the output positions so the correct buffer size is determined for the final
image. This assumes the outputs are in succession on the x axis. The outputs
are rendered in their transformed state.
E.g. this can happen when you grab the lower right corner of a window
and move over the top of the window when resizing. In this case, the
changed width is still important and should be acted upon.
https://bugs.freedesktop.org/show_bug.cgi?id=53560