Rather than require that the client implement two methods for every state,
simply have one global request, change_state, and one global event,
request_change_state.
Use a static assert to catch mismatch between implementation and
interface version. Fix window.c to not use XDG_SHELL_VERSION_CURRENT,
which will fail to catch version mismatches. The implementation version
must updated manually when the implementation is updated to use the new
interface.
Responsivenes is a per-client thing so we move the ping/pong functionality
to xdg_shell. Having this per-window was carries over from the EWMH
protocol, where the WM has no other way to do this. In wayland, the
compositor can directly ping the client that owns the surface.
This is used to figure out the size of "invisible" decorations, which we'll
use to better know the visible extents of the surface, which we can use for
constraining, titlebars, and more.
This is equivalent to WM_DELETE_WINDOW request under X11, or equivalent
to pressing the "close" button under CSD. Weston currently doesn't have
a compositor-side way to close the window, so no new code is needed on
its side.
This seems like a better name, and will not conflict if someone later
extends wl_surface with a request scaler_set (yeah, unlikely).
This code was written by Jonny Lamb, I just diffed his branches and made
a patch for Weston.
Cc: Jonny Lamb <jonny.lamb@collabora.co.uk>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Add cropping and scaling to wl_surface.
Add a global factory interface wl_scaler, which creates
wl_scaler_surface objects tied to a given wl_surface. The
wl_scaler_surface object can be used to set a cropping and scaling
transformation to change how a wl_buffer maps to wl_surface contents.
Changes in v2:
Take into account buffer_transform and buffer_scale, and try to explain
more clearly how the coordinate transformations work and what their
order is. Add, that crop and scale state is double-buffered. Explain
missing dst_x, dst_y. Clarify that undefined content still is some
content, but NULL buffer implies no content nor size.
Changes in v3:
Disallow zero values for dst_width and dst_height.
Open issues:
Should this be a separate interface like here, or just a wl_surface
request?
If we keep this as a separate interface, rename wl_surface_scaler to
wl_viewport.
This adds a test that tries to simulate a simple game loop that would
be like this:
while (1) {
draw_something();
eglSwapBuffers();
}
In this case the test is relying on eglSwapBuffers to throttle to a
sensible frame rate.
The test then verifies that only 2 EGL buffers are used. This is done
via a new request and event in the wayland-test protocol.
Currently this causes 3 buffers to be created because the release
event generated by the swap buffers is not processed by Mesa until it
blocks for the frame complete event in the next swap buffers call, but
that is too late.
This can be fixed in Mesa by issuing a sync request after the swap
buffers and blocking on it before deciding whether to allocate a new
buffer.
The tablet-shell is unmaintained and unused. It is currently
dead-weight and a burden when we make changes to weston. Let's
drop it for now, we can pull it out of git if we find a need for it later.
xdg_shell is a protocol aimed to substitute wl_shell in the long term,
but will not be part of the wayland core protocol. It starts as a
non-stable API, aimed to be used as a development place at first, and
once features are defined as required by several desktop shells, we can
finally make it stable.
It provides mainly two new interfaces: xdg_surface and xdg_popup.
The xdg_surface interface implements a desktop-style window, that can be
moved, resized, maximized, etc. It provides a request for creating
child/parent relationship, called xdg_surface.set_transient_for.
The xdg_popup interface implements a desktop-style popup/menu. A
xdg_popup is always transient for another surface, and also has implicit
grab.
This reverts commit 2396aec684.
This exact version of the sub-surface protocol has been copied into
Wayland core. Therefore it must be removed from here to avoid build
conflicts and useless duplication.
No other changes to sub-surface protocol consumers are needed, the
identical API is now offered by libwayland-client and libwayland-server.
The commit adding sub-surfaces to Wayland is:
Author: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
protocol: add sub-surfaces to the core
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
On Raspberry Pi, weston-desktop-shell is so slow to start, that the
compositor has time to run the fade-in before the wallpaper is up. The
user launching Weston sees the screen flipping to black, the fbcon
fading in, and then the desktop popping up.
To fix this, wait for the weston-desktop-shell to draw
everything before starting the initial fade-in. A new request is
added to the private desktop-shell protocol to signal it. If a
desktop-shell client does not support the new request, the fade-in
happens already at bind time.
If weston-desktop-shell crashes, or does not send the 'desktop_ready'
request in 15 seconds, the compositor will fade in anyway. This should
avoid a blocked screen in case weston-desktop-shell malfunction.
shell_fade_startup() does not directly start the fade-in but schedules
an idle callback, so that the compositor can process all pending events
before starting the fade clock. Otherwise (on RPi) we risk skipping part
of the animation. Yes, it is a hack, that should have been done in
window.c and weston-desktop-shell instead.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Mention, that sub-surfaces are not clipped to the parent.
Be more accurate on surface commit vs. apply state.
Mention the initial stacking order.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
wl_subsurface.set_desync should apply the cached wl_surface state.
Otherwise, the sub-surface may be stuck: a commit on the parent surface,
if desynchronized, will not commit the sub-surface because it is
desynchronized, too. A commit on the sub-surface may not happen, if it
is waiting for the frame callback from the previous commit.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Add protocol for sub-surfaces, wl_subcompositor as the global interface,
and wl_subsurface as the per-surface interface extension.
This patch is meant to be reverted, once sub-surfaces are moved into
Wayland core.
Changes in v2:
- Rewrite wl_subcompositor.get_subsurface description, and move mapping
and commit details into wl_subsurface description. Check the wording
in wl_subsurface.set_position description.
- Add wl_subsurface.set_commit_mode request, and document it, with the
commit_mode enum. Add bad_value error code for wl_subsurface.
- Moved the protocol into Weston repository so we can land it upstream
sooner for public exposure. It is to be moved into Wayland core later.
- Add destroy requests to both wl_subcompositor and wl_subsurface, and
document them. Experience has showed, that interfaces should always
have a destructor unless there is a good and future-proof reason to not
have it.
Changes in v3:
- Specify, that wl_subsurface will become inert, if the corresponding
wl_surface is destroyed, instead of requiring a certain destruction
order.
- Replaced wl_subsurface.set_commit_mode with wl_subsurface.set_sync and
wl_subsurface.set_desync. Parent-cached commit mode is now called
synchronized, and independent mode is desynchronized. Removed
commit_mode enum, and bad_value error.
- Added support for nested sub-surfaces.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Also rename input_method_context to wl_input_method_context,
input_panel to wl_input_panel and input_panel_surface to
wl_input_panel_surface.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Add input_panel_surface::set_panel to specify input panel surfaces which
are overlaying the application and are following the input cursor.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Use "default" preedit style as default. "None" is used when the
composing text should look like non-composing text.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
0xc in this case was a combination of "autocapitalization" (0x4) and
"lowercase" (0x8) instead of "hidden_text" (0x40) and "sensitive_data"
(0x80).
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>
Move the input_panel interface from desktop-shell to input-method (since
it is not really tied to desktop-shell).
Add an input_panel_surface interface like wl_shell_surface to make it
easier to extend it. Also add a parameter to the set_toplevel request to
be able to specify where to show an input panel surface on the screen.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Add a request to be called by the client when the word currently being
composed is tapped by the user. Input methods often use this information
to offer more word suggestions to the user.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Support content types in text protocol. Content is defined by a hint
bitmask and a purpose field.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Also add a separate preedit-cursor event and add a commit argument to
preedit-string to allow to support commit on reset. Fix editor and
keyboard example to adapt to the protocol changes.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
The weston test extension, called weston-test.so, can be loaded
from the "modules" configuration option on the command line
or in the .ini file.
Clients can bind to the "wl_test" interface to interact with
the weston test extension.
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Allow an input method to forward (unfiltered) key and modifier events
from the hardware keyboard to the client.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>