The simple clients all just call wl_display_dispatch() in a while loop
without checking the return value. Now, if the server dies or other
error occurs, we get a -1 return value instead and need to break the loop.
Do not build the tablet-shell client if --disable-tablet-shell is given.
Change --enable-tablet-shell to --disable-tablet-shell in ./configure
--help output, since it is enabled by default. Add a description.
Use proper quoting in the conditional.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
since it doesn't use any of them. Fixes a build failure on systems,
where (E)GL headers are in non-standard path.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Separate simple EGL clients from other simple clients. This allows to
build either simple-shm or simple-egl, whichever you want. We avoid
linking libEGL and GLESv2 into simple-shm, and we can build simple-shm
even if nothing provides EGL, GLESv2, or wayland-egl APIs.
Change the options in configure --help from --enable to --disable, since
these are enabled by default, and you would normally only ever give the
--disable flavor. Add descriptions.
Remove the #define BUILD_SIMPLE_CLIENTS since it is not used.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
configure.ac: The toytoolkit clients used to get libEGL linked to them
even if there was no cairo-egl. This is useless, and actually harmful on
platforms, where libEGL absolutely requires one of the GL ES libraries
to be linked in, too.
Look for EGL-related packages only for cairo-egl with toytoolkit.
window.c: protect all GL header includes with HAVE_CAIRO_EGL, since that
is the only case we can support EGL, GL, or GLESv2 at all. In the case
we do not have cairo-egl, add enough definitions to let us build the
stubs for EGL-related functions.
Remove some #ifdefs that were inside of the same #ifdef already.
These changes allow to build sorfware rendering toytoolkit clients
without any bits of EGL libs or headers.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Support for zooming by using ctrl + the vertical axis (scrolling upwards
zooms in) and panning by both the horizontal and vertical axis as well
as click and drag was added to demonstrate how axis should work.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
If the keyboard modifier event was received after the key event the
modifier state would end up incorrect.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Callbacks registered via display_set_output_configure_handler() are
promised to be called when we know the current mode for the output. If
the following order of events happens:
1. toytoolkit binds to a wl_output global
2. application registers an output configure handler
3. the wl_output.mode events are received
Then in step 2 we would call the callback with uninitialised output
informations, giving it a 0x0 size.
To avoid such race, do not call the callback from
display_set_output_configure_handler() if the output has 0x0 size.
The wl_output.mode event will be received later, and that will trigger
the right call to the callback.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Apply wl_surface.frame request only on the next wl_surface.commit
according to the new protocol.
This makes it explicit, which repaint actually triggered the frame
callback, since commit schedules a repaint. Otherwise, something causing
a repaint before a commit could trigger the frame callback too early.
Ensure all demo clients send commit after wl_surface.frame. Note, that
GL apps rely on eglSwapBuffers() sending commit. In toytoolkit, it is
assumed that window_flush() always does a commit.
compositor-wayland assumes renderer->repaint_output does a commit.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Make input region double-buffered as specified in the new protocol.
While doing it, get rid of the undef region code, and instead use a
maximum sized real pixman region. This avoids special-casing regions
that might sometimes be undef.
As the input region is now usable by default instead of undef,
weston_surface_update_transform() does not need to reset the input
region anymore.
weston_surface_attach() no longer resets the input region on surface
size change. Therefore, also weston_seat_update_drag_surface() does not
need to reset it.
Update toytoolkit to set input region before calling wl_surface_commit()
or swapBuffers (which does commit).
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Make wl_surface.set_opaque_region double-buffered as required by the new
protocol. Also, do not reset the opaque region on surface size changes
anymore. Only explicit requests from the client will change the region
now.
In clients, make sure commit happens after setting the opaque region.
Mesa does not need a fix, as it never touches the opaque region.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This change depends on the Wayland commit
"protocol: double-buffered state for wl_surface".
Implement double-buffering of damage in the compositor as required by
the new protocol.
Ensure all Weston demo clients call wl_surface_commit() after
wl_surface_damage().
Mesa does not need a fix for this, as the patch adding
wl_surface_commit() call to Mesa already takes care of damage, too;
Mesa commit: "wayland: use wl_surface_commit()"
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Use wl_surface_commit() to commit the buffer attach, as Weston now
requires.
NOTE: GL-applications are broken until you upgrade to a version of Mesa
which does wl_surface_commit() on eglSwapBuffers(). If you have
Cairo-gl, this means all toytoolkit apps, too.
simple-shm and simple-touch OTOH will work now.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Add THEME_FRAME_MAXIMIZED flag so the theming system can know not to draw
shadows for maximized windows. This allows maximized surfaces' content to be
sized and placed in a more expectable fashion.
If the for loop does not match on a button it will fall through and try and
dereference into the array using the terminating value of the loop. This
terminating value of the loop is the dimension of the array and thus beyond
its bounds.
Cc: Jan Arne Petersen <jpetersen@openismus.com>
Signed-off-by: Rob Bradford <rob@linux.intel.com>
The workspace state parameters were initialized after the first
roundtrip. If a workspace manager state event was received during this
roundtrip the state parameters were cleared leaving an incorrect state.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
desktop-shell never returned from display_run() since it
was essentially killed when weston exited. To fix this,
it is necessary to watch for EPOLLHUP in window.c so that
toytoolkit clients will return from display_run() when
weston quits. This allows for clients to clean up
as needed.
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
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>