Let's make the source and destination size rules consistent: neither can
have zero, {-1, -1} disables it, and other negatives are not allowed.
The sanity of allowing zero sized source rectangle as debatable. Now the
minimum becomes 1/256x1/256, and with output_scale the actual samples
may be even smaller. That should be enough.
On not allowed values, raise a protocol error. This should help catch
bugs in clients that accidentally send garbage values.
The old wl_viewport.set request remains the same, and can still produce
zero sized source rectangle.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
When adding a subsurface (to display a tooltip) in toytoolkit,
we now get the parent window surface type (SHM or EGL) and
define the new surface type as the same.
This fixes crashes with tooltips in cases like having
Cairo-EGL available but running the X11 compositor.
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This adds a plugin called screen-share.so. If the screen-share.so module
is imported, it will add the CTRL+ALT+s keybinding to start a screen
sharing session. If you press CTRL+ALT+S, weston will spawn another copy
of weston, this time with the RDP backend, and mirrors the current screen
to it and adds any seats from RDP as aditional seats. The current screen
is defined as the one with the mouse pointer. Currently the CTRL+ALT+s
keybinding is hardcoded as the only way to activate screen sharing. If, at
some point, shells want more control over the screen sharing process, the
API's should be easy to update and export to make this possible.
For security, the command and path to weston is currently hard-coded. It
would not take much aditional code to make this configurable or to allow a
shell to launch other screen-sharing programs. However, handling those
security issues is outside the scope of this patch so it is hard-coded for
now.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
This patch adds an option to the RDP compositor to disable
desktop resizes initiated by RDP peer. The current behaviour
is that if an incoming RDP peer suggests a resolution that is
not the current one, a mode_switch() is done and the desktop is
resized to that new resolution. This new flag allows to disable
that behaviour. If the flag is set, the new behaviour is that the
RDP peer will be instructed to resize to the size of the desktop.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
On startup weston now detects the WAYLAND_SERVER_SOCKET environment
variable. If found, weston does not create the display like normal, but
instead directly adds a client corresponding to the given fd. This,
combined with the fullscreen shell, allows a process to spawn weston and
use it as a backend.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
This forces weston to create one output for every parent output. This is
enabled by default if it detects a wl_fullscreen_shell. The --sprawl
option is primarily to enable this on wl_shell.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
This makes simple-shm act like a very simple fullscreen shell client. This
is the kind of interaction one would expect out of a boot splash screen or
similar.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
The CURSOR_PLANE capability indicates that the backend has a concept of a
cursor plane and can handle a cursor without compositing. This is currently
only advertised by the DRM backend.
The ARBITRARY_MODE flag specifies that the backend is capable of switching to
virtually any resolution. This is currently only advertised in the RDP
backend. While it's a bit buggy right now, it should be capable of this.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
When a client calls the input panel (weston-keyboard e.g.)
and then goes fullscreen, the panel will not be hidden
anymore.
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Temporarily show minimized surfaces when switching between
surfaces with the keyboard. If the final selected one was
minimized, it will be restored.
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
We now handle the client-side xdg_surface_set_minimized()
call, and eventually hide the target surface by moving it
to a dedicated layer.
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
'close' is more consistent with the purpose of the event than
'delete', and it is also c++ friendly, since 'delete' is a keyword.
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
weston_log() seems to be the standard elsewhere in the codebase for
errors. These are the only two instances where perror() is used
instead, and their error messages aren't that informative anyway.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
This patch removes the extra modes parameter for the RDP compositor. And
make it support any mode that is requested (be aware that RDP client may not
support all possible modes, especially odd resolution).
This new version fixes remarks done by Jason Ekstrand. It also fixes
some missing spaces between if and (.
This allows to test the effect of setting only source rectangle or
destination size, in addition to setting both.
In weston-scaler -h output, add descriptions on what the result in each
mode should look like.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Bump wl_scaler and wl_viewport versions to 2. Add new requests
wl_viewport.set_source and .set_destination, which are meant to replace
wl_viewport.set request.
Now a client can set and unset just one of source rectangle and
destination size. Define the semantics when one of these is unset.
Implement these semantics changes in compositor and pixman renderer.
GL-renderer does not need changes.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Remove the explicit boolean variable, and use illegal width to denote
"not set".
Split the boolean into two, so we can later start having buffer.src_*
and surface.* set or not set independently. This may become useful when
the wl_viewport interface is changed to allow modifying them separately.
At the moment, both buffer.src_width and surface.width conditions are
always in sync.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Queueing in the Presentation extension requires splitting the viewport
state into buffer state and surface state. To conveniently allow
assigning only one, the other, or both, reorganize the
weston_buffer_viewport structure.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Fix one left-over case that directly assigned
weston_surface::width,height, and so missed view dirtying.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
There is no need for weston_subsurface_commit_to_cache() to leave the
pending.buffer set. Reset it to NULL.
This makes pending.buffer always NULL if pending.newly_attached == 0.
IOW, pending.buffer cannot be non-NULL unless
pending.newly_attached == 1.
Therefore no need to check pending.buffer nor cached.buffer_ref.buffer
for the weston_surface_attach() calls.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Merge more code into a common function. No functional changes.
At every site where weston_surface_set_size_from_buffer() was called,
weston_surface_attach() was called first. Move all calls of
set_size_from_buffer into weston_surface_attach.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
With protocol of wl_output version 2, after the output change,
it should send done event to all clients bound to it.
Signed-off-by: Quanxian Wang <quanxian.wang@intel.com>
This provides an example of keeping a weston_surface alive after the client
destroys it. We install a destroy listener for the resource, so that we'll
be notifified when the client destroys it. Then we increase the weston_surface
refcount so that we keep the surface and initiate an animation. When
the animation finishes we can finally destroy the surface.
While disable by default, passing --enable-libinput-backend to
./configure switches the input backend in weston's drm, fbdev and rpi
compositing backends to use libinput instead of udev-seat.c, evdev.c and
friends.
When enabled, weston now also depends on libinput >= 0.1.0.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>