Commit Graph

4114 Commits

Author SHA1 Message Date
Kristian Høgsberg
757d8aff27 xwayland: Use new Xwayland DDX 2014-04-06 22:32:24 -07:00
Kristian Høgsberg
f03a04afac compositor: Add create_surface_signal
This signal is emitted when a client creates a surface, not for internal
surfaces.
2014-04-06 22:22:04 -07:00
Jason Ekstrand
47928d8715 Add a screen sharing plugin
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>
2014-04-02 21:28:09 -07:00
Hardening
f34cd2c676 compositor-rdp: Add an option to disable client initiated resizes
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>
2014-04-02 21:27:49 -07:00
Jason Ekstrand
701f636293 gl-renderer: Fix read_pixels in the case where we have output borders
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:27:46 -07:00
Jason Ekstrand
923bfe6f1f Add support for running with a primary client
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>
2014-04-02 21:27:30 -07:00
Jason Ekstrand
b7d9f2eb2f compositor-wayland: Properly handle running inside a compositor that does not provide keymaps
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:27:26 -07:00
Jason Ekstrand
cf40a13820 Automatically select the wayland backend if WAYLAND_SOCKET is set
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:27:06 -07:00
Jason Ekstrand
e4ca8b0bdd compositor-wayland: Add a --sprawl option
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>
2014-04-02 21:27:02 -07:00
Jason Ekstrand
53ee0dcca4 compositor-wayland: Add support for running on top of wl_fullscreen_shell
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:26:39 -07:00
Jason Ekstrand
7a17d42fb3 weston-fullscreen: Add cursor drawing support and properly handle WL_FULLSCREEN_SHELL_CAPABILITY_CURSOR_PLANE
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:26:35 -07:00
Jason Ekstrand
2bb72fe6fb weston-fullscreen: Add wl_fullscreen_shell support
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:26:31 -07:00
Jason Ekstrand
a669bd5e00 toytoolkit: Don't crash if wl_data_device_manager is not present
This is primaraly to get weston-fullscreen to run on compositors that lack
copy-paste support.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:26:20 -07:00
Jason Ekstrand
738715d628 toytoolkit: Expose output make and model
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:26:16 -07:00
Jason Ekstrand
ce97a6b184 toytoolkit: Only require xdg_shell if the window is not custom
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:26:11 -07:00
Jason Ekstrand
428c24e25e simple-shm: Add wl_fullscreen_shell support
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>
2014-04-02 21:26:00 -07:00
Jason Ekstrand
946a9489bf Add a wl_fullscreen_shell implementation
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:25:56 -07:00
Jason Ekstrand
9fc7151991 Add possible capabilities CURSOR_PLANE and ARBITRARY_MODE
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>
2014-04-02 21:25:27 -07:00
Jason Ekstrand
a4ab5422e9 Add a signal for when a seat updates its capabilities
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:24:42 -07:00
Jason Ekstrand
27e1167957 Generate/build the fullscreen shell protocol files
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:24:39 -07:00
Jason Ekstrand
ca6f73b636 Add a fullscreen shell protocol
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:24:34 -07:00
Giulio Camuffo
c6ab3d52f5 compositor: let the shells create the screenshooter 2014-04-02 11:39:19 -07:00
Giulio Camuffo
e9022e79c8 compositor: add an exported function to take a screenshot of an output
This allows other screenshooter protocols to use the same code to copy
the screen to a buffer.
2014-04-02 11:27:42 -07:00
Manuel Bachmann
805d2f536a shell: position input panel layer above fullscreen layer
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>
2014-04-02 10:35:26 -07:00
Manuel Bachmann
c1ae2e817e compositor: use Mod-Tab to show/raise minimized surfaces
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>
2014-04-02 10:27:27 -07:00
Manuel Bachmann
50c87dbd95 compositor: implement xdg_surface_set_minimized()
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>
2014-04-02 10:27:13 -07:00
Giulio Camuffo
e058cd13e8 compositor: export weston_buffer_from_resource()
This is needed to allow shell plugins to implement their own
screenshooter.
2014-04-02 09:13:45 -07:00
Giulio Camuffo
0ea14f51e5 xdg-shell: rename the xdg_surface.delete event to close.
'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>
2014-04-01 16:46:41 -07:00
Bryce W. Harrington
a093502891 compositor: Use weston_log rather than perror for error messages
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>
2014-04-01 16:46:41 -07:00
Hardening
fb24eaac03 Make RDP backend supports arbitrary modes
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 (.
2014-04-01 16:46:41 -07:00
Hardening
842a36ae4a Check return value of wl_cursor functions
This patch adds checks for themes and cursors returned by wl_cursor functions.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-04-01 16:46:41 -07:00
Pekka Paalanen
2d9d689427 clients/scaler: add modes to test wl_scaler version 2
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>
2014-04-01 16:46:41 -07:00
Pekka Paalanen
0b4c535d73 protocol,compositor: split wl_viewport setters
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>
2014-04-01 16:46:40 -07:00
Pekka Paalanen
f0cad4844c compositor: replace weston_buffer_viewport::viewport_set
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>
2014-04-01 16:46:40 -07:00
Pekka Paalanen
952b6c8004 compositor: reorganize struct weston_buffer_viewport
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>
2014-04-01 16:46:40 -07:00
Pekka Paalanen
7ed251c119 compositor: use surface_set_size() in one more case
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>
2014-04-01 16:46:40 -07:00
Pekka Paalanen
3c9b8024fa compositor: refactor code into weston_surface_reset_pending_buffer()
No functional changes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-04-01 16:46:40 -07:00
Pekka Paalanen
260ba38fff compositor: buffer can be non-NULL only if newly_attached
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>
2014-04-01 16:46:40 -07:00
Pekka Paalanen
bb2f3f2f91 compositor: refactor more into weston_surface_attach
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>
2014-04-01 16:46:40 -07:00
Quanxian Wang
b2c86363b8 weston: Send done event with version 2 of wl_output
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>
2014-04-01 16:46:40 -07:00
Jasper St. Pierre
fe9671e30e shell: Correct error message when we already have an xdg surface
It was referencing get_shell_surface, which is absolutely wrong.
2014-03-25 10:59:20 -07:00
Jasper St. Pierre
e81a175fa1 clients: Remove unused client-side resize tracking code 2014-03-24 13:29:50 -07:00
Kristian Høgsberg
b033c5e1d0 shell: Only animate window closing for mapped windows
https://bugs.freedesktop.org/show_bug.cgi?id=76415
2014-03-20 14:49:07 -07:00
Kristian Høgsberg
160fe75b32 shell: Animate window closing
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.
2014-03-19 16:51:53 -07:00
Kristian Høgsberg
3a869019eb animation: Fix the fade animation to work in both directions
We'll use this for fading out windows.
2014-03-19 16:46:40 -07:00
Kristian Høgsberg
8404acb36f compsitor-x11: Report more accurate dimension of outputs
We use the X screen DPI to compute the X11 compositor output size,
which gives us a more accurate and useful value in the wl_output
geometry event.
2014-03-19 13:18:54 -07:00
Jonas Ådahl
e0de3c2418 Add libinput based input device backend
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>
2014-03-12 14:55:22 -07:00
Jonas Ådahl
0feb32e2f0 udev-seat: Make udev_input own its own udev object reference
No functional changes; API simplification in preparation for multiple
input backends.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-03-12 14:55:18 -07:00
Jonas Ådahl
58e158658f udev-seat: Make udev_seat_get_named take struct udev_input pointer
No functional changes; API generalization in preparation for multiple
input backends.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-03-12 14:55:12 -07:00
Neil Roberts
77c1a5b7dc Add support for having different GBM formats for different outputs
The gbm-format configuration option can now be specified per-output as
well as in the core config section. If it is not specified it will
default to the format specified in the core section. The
EGL_MESA_configless_context extension is required for this to work. If
this extension is available it will create a context without an
EGLConfig and then it will potentially use a different EGLConfig for
each output.

The gl-renderer interface has been changed so that it takes the EGL
attributes and visual ID in the create_output function as well as in
the create function.
2014-03-12 14:44:02 -07:00