platform/upstream/weston.git
10 years agocompositor-drm: Fix crash when setting up seat constrained by an output
Ander Conselvan de Oliveira [Thu, 17 Apr 2014 10:08:45 +0000 (13:08 +0300)]
compositor-drm: Fix crash when setting up seat constrained by an output

Commit 58e15865 changed the parameters for udev_get_seat_by_name() to
receive a struct udev_input. However, when this gets called from
create_output_from_connector() during initialization, the input struct
is not yet initialized, leading to a crash. Previously, that function
would take only a pointer to the compositor.

This patch fixes the crash by initializing input before creating any
outputs.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77503

10 years agokeyboard: add the missing symbols layout, fix arabic layout
Manuel Bachmann [Tue, 15 Apr 2014 10:38:31 +0000 (12:38 +0200)]
keyboard: add the missing symbols layout, fix arabic layout

The "symbols" modifier key of weston-keyboard is no longer
inactive, but will provide an additionnal layout with
numerals and special characters.

Fix the Arabic keyboard, which was rendering out of the
bounds, and now use the Arabic IBM PC keyboard as a
reference for its standard and new symbols layouts.

https://bugs.freedesktop.org/show_bug.cgi?id=71757

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
10 years agoshell: Destroy a previous input panel animation when showing it again
Ander Conselvan de Oliveira [Mon, 14 Apr 2014 12:48:07 +0000 (15:48 +0300)]
shell: Destroy a previous input panel animation when showing it again

It is possible that an input panel will be shown quickly, hidden and
shown again, before the animation for the first appeareance finished.
In that case, another animation would be created and the effect of the
two combined could cause the panel to not appear in the screen.

This patch fixes this by keeping a reference to the previous animation
and deleting it when a new one is created.

10 years agoanimation: Fix input panel slide animation
Ander Conselvan de Oliveira [Mon, 14 Apr 2014 12:48:06 +0000 (15:48 +0300)]
animation: Fix input panel slide animation

The position for the slide animation was calculated assuming the value
of the spring was always between 0.0 and 1.0. Commit 3a869019 broke
that assumption, and the result was that the panel would be positioned
at an invisible part of screen. Since there would be no output repaints
scheduled, the result of the animation would only be seen if something
else triggered a repaint (such as a mouse cursor movement).

This patch changes the values for the slide animation's spring to range
between 0.0 and 1.0, thus fixing the position of the panel and the lack
of scheduled repaints problem.

https://bugs.freedesktop.org/show_bug.cgi?id=77347

10 years agoanimation: Split spring setup out of weston_view_animation_run()
Ander Conselvan de Oliveira [Mon, 14 Apr 2014 12:48:05 +0000 (15:48 +0300)]
animation: Split spring setup out of weston_view_animation_run()

All the animations override at least one parameter of the spring that
is set during the creation of the animation. Some need to do the whole
setup again.

This patch changes the initialization of a view animation to a three
step process. First, the animation is created. Then the caller sets up
the spring and calls weston_view_animation_run() to apply the effect of
the animation for the first animation frame.

10 years agotests: fix bad-buffer-test
Marek Chalupa [Fri, 11 Apr 2014 09:48:55 +0000 (11:48 +0200)]
tests: fix bad-buffer-test

bad-buffer-test is FAIL_TEST and every assert() (or even SIGSEGV signal)
make it pass. It shouldn't be so for example when assert() is invoked
when a client couldn't connect to display.

Make sure that only relevant asserts make the test pass
and the other make it fail (by returning 0)

10 years agodesktop-shell: Get rid of get_shell_client
Jason Ekstrand [Thu, 17 Apr 2014 02:12:10 +0000 (21:12 -0500)]
desktop-shell: Get rid of get_shell_client

We now carry the shell_client around with each shell_surface.  This is much
more reliable than tacitly assuming that there is only one wl_shell or
xdg_shell instance bound to a particular wl_client.  In particular, weston
would crash when a client bound to both wl_shell and xdg_shell even if it
only ever used one of them.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agocompositor-drm: Pass the right stride to the vaapi recorder
Ander Conselvan de Oliveira [Wed, 16 Apr 2014 09:05:12 +0000 (12:05 +0300)]
compositor-drm: Pass the right stride to the vaapi recorder

It takes the stride in bytes, not pixels. The bug was hidden when using
va intel-driver 1.2.1 because it would ignore the stride from user and
set the surface state in a wrong way.

https://bugs.freedesktop.org/show_bug.cgi?id=77495

10 years agoshell: Fix view repositioning logic for output move and destroy
Ander Conselvan de Oliveira [Fri, 11 Apr 2014 10:57:15 +0000 (13:57 +0300)]
shell: Fix view repositioning logic for output move and destroy

Previously, the repositioning logic would iterate the compositor's list
of layers and move the views on those layers. However, that failed in
two different ways: it didn't cover hidden workspaces and crashed when
the display was locked.

This patch changes the logic to explicit iterate over all the layers
owned by the shell. The iteration is done through a helper function,
shell_for_each_layer().

https://bugs.freedesktop.org/show_bug.cgi?id=76859
https://bugs.freedesktop.org/show_bug.cgi?id=77290

10 years agogl-renderer: Fix a typo in the output_set_border description
Jason Ekstrand [Fri, 11 Apr 2014 08:42:59 +0000 (03:42 -0500)]
gl-renderer: Fix a typo in the output_set_border description

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agoxwayland/launcher: Use %m instead of manual strerror(errno)
Jasper St. Pierre [Tue, 1 Apr 2014 23:55:26 +0000 (19:55 -0400)]
xwayland/launcher: Use %m instead of manual strerror(errno)

10 years agoprotocol: Correct typo 'suppot'
Bryce W. Harrington [Tue, 8 Apr 2014 21:04:57 +0000 (21:04 +0000)]
protocol: Correct typo 'suppot'

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
10 years agoshell: Keep shsurf->fullscreen_output set after unset_fullscreen()
Ander Conselvan de Oliveira [Thu, 10 Apr 2014 13:36:57 +0000 (16:36 +0300)]
shell: Keep shsurf->fullscreen_output set after unset_fullscreen()

When a fullscreen surface gets the maximized state, the function
reset_surface_type() is called and that causes unset_fullscreen() to be
called. That function would set the value of shsurf->fullscreen_output
to NULL. However, since the surface still has the fullscreen state, it
will be configured as a fullscreen surface again, and an attempt to
access that field would cause the compositor to crash.

Fix the crash by keeping the value of fullscreen_output around after
unset_fullscreen(). This is safe since the value is only used when a
surface has the fullscreen state and is replaced on a new request to
make the surface fullscreen.

https://bugs.freedesktop.org/show_bug.cgi?id=76867

10 years agoshell: Damage below child surfaces on move to different workspace
Ander Conselvan de Oliveira [Thu, 10 Apr 2014 12:35:58 +0000 (15:35 +0300)]
shell: Damage below child surfaces on move to different workspace

When moving from a surface from visible workspace to an invisible one
via a popup menu, the area below the menu wouldn't be repainted.

https://bugs.freedesktop.org/show_bug.cgi?id=76973

10 years agoshell: Disarm the screensaver timeout timer on terminate_screensaver()
Ander Conselvan de Oliveira [Thu, 10 Apr 2014 11:49:35 +0000 (14:49 +0300)]
shell: Disarm the screensaver timeout timer on terminate_screensaver()

The timer was left running after the screensaver was terminated. When
it triggered, a fade out that would in turn cause the screen to be
locked was started. Since that could happen without the compositor
emitting the idle signal, there would be no wake signal to make the
shell show the lock screen, so the system was left unresponsive
until the idle signal actually triggered.

https://bugs.freedesktop.org/show_bug.cgi?id=70923

10 years agoReset the keyboard focus on all seats when the compositor is locked
Neil Roberts [Wed, 9 Apr 2014 15:33:32 +0000 (16:33 +0100)]
Reset the keyboard focus on all seats when the compositor is locked

Before commit 2f5faff7f9142 when the compositor is locked it would
reset the keyboard focus on all of the seats as part of pushing the
focus_state. This was removed because it now always keeps track of the
focus_state in the workspace instead of waiting until the state is
pushed. However this had the side effect that the active surface would
retain focus when the compositor is locked. This patch just makes it
explicitly set the keyboard focus to NULL on all of the seats when
locking. This will be restored based on the workspace's state when
unlocking.

https://bugs.freedesktop.org/show_bug.cgi?id=73905

10 years agoReset focus on unknown seats when restoring focus state
Neil Roberts [Wed, 9 Apr 2014 15:33:31 +0000 (16:33 +0100)]
Reset focus on unknown seats when restoring focus state

The focus_state list on a workspace only contains entries for seats
which have a keyboard focus on that workspace. For workspaces that
have no surfaces the list will be empty. That means that when a
workspace with no surfaces is switched to it would previously leave
the keyboard focus unaffected and you could still type in the surface
on the old workspace.

This patch makes it instead reset the keyboard focus to NULL for seats
without a focus_state. It does this by temporarily stealing the
compositor's list of seats while it iterates the focus_states. After
all of the focus states have been processed any seats remaining in
this temporary list have their focus reset.

https://bugs.freedesktop.org/show_bug.cgi?id=73905

10 years agoshell: Allow unresponsive surfaces to be moved again
Ander Conselvan de Oliveira [Wed, 9 Apr 2014 14:39:39 +0000 (17:39 +0300)]
shell: Allow unresponsive surfaces to be moved again

Commit c85f1d45 caused the move of an unresponsive surface to be no
longer possible, since the grabbed flag would prevent the move grab
to start while the busy grab was still active.

10 years agoterminal: Don't try to render RLE used as a placeholder
Daiki Ueno [Tue, 8 Apr 2014 09:46:18 +0000 (18:46 +0900)]
terminal: Don't try to render RLE used as a placeholder

weston-terminal uses RLE (U+202B) as a placeholder of the right half
of a double width character.  However, not all fonts include this
glyph and cairo renders it as .notdef (glyph index 0) in that case.

10 years agoconfigure.ac: Bump version to 1.4.91 1.4.91
Kristian Høgsberg [Mon, 7 Apr 2014 23:14:54 +0000 (16:14 -0700)]
configure.ac: Bump version to 1.4.91

10 years agodesktop-shell: Activate surface on right click too
Kristian Høgsberg [Mon, 7 Apr 2014 18:52:17 +0000 (11:52 -0700)]
desktop-shell: Activate surface on right click too

This raises the surface to the top on right click as well, which fixes
pop stacking.

https://bugs.freedesktop.org/show_bug.cgi?id=74831

10 years agowindow.c: Create xdg_surface up front
Kristian Høgsberg [Mon, 7 Apr 2014 18:28:05 +0000 (11:28 -0700)]
window.c: Create xdg_surface up front

Fixes initial fullscreen for calibrator.

https://bugs.freedesktop.org/show_bug.cgi?id=76970

10 years agoMake sure config.h is included before any system headers
Andrew Wedgbury [Mon, 7 Apr 2014 11:40:35 +0000 (12:40 +0100)]
Make sure config.h is included before any system headers

There was an issue recently in screen-share.c where config.h was not
being included, resulting in the wrong definition for off_t being used on
32 bit systems. I checked and I don't think this problem is happening
elsewhere, but to help avoid this sort of problem in the future, I went
through and made sure that config.h is included first whenever system
headers are included.

The config.h header should be included before any system headers, failing
to do this can result in the wrong type sizes being defined on certain
systems, e.g. off_t from sys/types.h

Signed-off-by: Andrew Wedgbury <andrew.wedgbury@realvnc.com>
10 years agoxwayland: Clean up unpaired surfaces
Kristian Høgsberg [Mon, 7 Apr 2014 17:16:19 +0000 (10:16 -0700)]
xwayland: Clean up unpaired surfaces

10 years agoDon't include xserver-server-protocol.h
Mariusz Ceier [Mon, 7 Apr 2014 16:02:13 +0000 (18:02 +0200)]
Don't include xserver-server-protocol.h

It was removed in 757d8aff2757387bcd594e2ee2a27055b366eac3,
along with xserver protocol.

Signed-off-by: Mariusz Ceier <mceier+wayland@gmail.com>
10 years agoFix on-the-fly transparency changes in pixman-renderer
Manuel Bachmann [Mon, 7 Apr 2014 09:58:45 +0000 (11:58 +0200)]
Fix on-the-fly transparency changes in pixman-renderer

This fixes :
- leaking the mask used to simulate transparency ;
- code style (definitions moved up, use of brackets) ;
- applying an opaque region when transparency is
 wanted (shound not happen).

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
10 years agogl-renderer: Keep track of the GL format used for SHM buffers
Neil Roberts [Mon, 7 Apr 2014 14:01:01 +0000 (15:01 +0100)]
gl-renderer: Keep track of the GL format used for SHM buffers

If the client attaches a new SHM buffer with a different format from a
previous one then we ought to trigger a full upload so that GL can
allocate a new texture. Otherwise Weston would technically be doing
invalid operations because it would call glTexSubImage2D with a
different format from the one specified in glTexImage2D. Presumably it
would also mean GL would have to convert the buffer as it copies the
sub-region in which isn't ideal.

This patch makes it decide the GL format when the buffer is attached
instead of when processing the damage and it will set
needs_full_upload if it is different from what it used before.

10 years agonested: Disable cairo on the subsurfaces
Neil Roberts [Mon, 24 Feb 2014 19:07:08 +0000 (19:07 +0000)]
nested: Disable cairo on the subsurfaces

The subsurface widgets on the nested example aren't using Cairo to
render so we should turn it off to prevent the toy toolkit from
creating a redundant extra surface for it. This is particularly
important since Mesa commit 6c9d6898fdfd7e2 because the surface that
the toolkit tries to create is zero-sized and that patch prevents that
from working. This was causing weston-nested to crash.

10 years agoSupport on-the-fly transparency changes in pixman renderer
Manuel Bachmann [Sat, 5 Apr 2014 03:31:37 +0000 (05:31 +0200)]
Support on-the-fly transparency changes in pixman renderer

When the alpha channel of a surface is changed and the surface
refreshed, pixman renderer will now apply a mask corresponding
to the alpha channel value.

This allows visual effects like shell fade in, shell fade out,
window switching, to work when using pixman renderer.

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
10 years agoshell: Fix segfault from trying to access a destroyed popup shell surface
Bryan Cain [Fri, 4 Apr 2014 22:41:24 +0000 (17:41 -0500)]
shell: Fix segfault from trying to access a destroyed popup shell surface

The shell_destroy_shell_surface function only set the backing resource to
NULL, leaving an unusable surface in the popup_grab list until the surface's
fading animation finished and it could be freed. This caused a segfault if
the shell tried to forcibly break the grab during that time interval due to
the compositor losing the keyboard focus.

https://bugs.freedesktop.org/show_bug.cgi?id=77072

10 years agocompositor-rdp: Remove unneeded client->Close call
Jason Ekstrand [Fri, 4 Apr 2014 17:22:41 +0000 (12:22 -0500)]
compositor-rdp: Remove unneeded client->Close call

The client->Close call is unneeded as that is already implied by returning
FALSE.

10 years agoAlways use glTexImage2D instead of glTexSubImage2D for first upload
Neil Roberts [Fri, 4 Apr 2014 15:24:54 +0000 (16:24 +0100)]
Always use glTexImage2D instead of glTexSubImage2D for first upload

Previously when uploading SHM data we would initialise the texture
with glTexImage2D and NULL data when the buffer is attached. Then if
the GL_EXT_unpack_subimage extension is available we would always use
glTexSubImage2D to upload the data. The problem with that is that the
first glTexImage2D was always setting the internal format to
GL_BGRA_EXT and then if a 16-bit texture is used we would later call
glTexSubImage2D with a data format of GL_RGBA. Under GLES2 the
internal format must always match the data format so this is
technically invalid.

This patch makes it so that it always calls glTexImage2D when flushing
the damage for the first time. That way it will use the right internal
format and we don't need to call glTexImage2D with NULL data.

https://bugs.freedesktop.org/show_bug.cgi?id=75251

10 years agocompositor: wl_viewport destination 1x1 min
Pekka Paalanen [Fri, 4 Apr 2014 11:22:13 +0000 (14:22 +0300)]
compositor: wl_viewport destination 1x1 min

Ensure, that the resulting surface size is at least 1x1, even when
destination size is not set and source size is zero. Previously this
lead to zero surface size.

This can still happen due to wl_viewport.set(#, #, 0, 0, #, #) followed
by wl_viewport.set_destination(-1, -1).

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
10 years agoprotocol: unify wl_viewport src and dst size rules
Pekka Paalanen [Fri, 4 Apr 2014 11:22:12 +0000 (14:22 +0300)]
protocol: unify wl_viewport src and dst size rules

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>
10 years agotoytoolkit: match parent surface type when adding a subsurface
Manuel Bachmann [Fri, 4 Apr 2014 08:04:18 +0000 (10:04 +0200)]
toytoolkit: match parent surface type when adding a subsurface

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>
10 years agoscreen-share: re-enable planes when finished
Jason Ekstrand [Thu, 3 Apr 2014 16:51:42 +0000 (11:51 -0500)]
screen-share: re-enable planes when finished

10 years agoxwayland: Use new Xwayland DDX
Kristian Høgsberg [Tue, 18 Mar 2014 05:33:29 +0000 (22:33 -0700)]
xwayland: Use new Xwayland DDX

10 years agocompositor: Add create_surface_signal
Kristian Høgsberg [Mon, 7 Apr 2014 05:04:50 +0000 (22:04 -0700)]
compositor: Add create_surface_signal

This signal is emitted when a client creates a surface, not for internal
surfaces.

10 years agoAdd a screen sharing plugin
Jason Ekstrand [Thu, 3 Apr 2014 00:54:01 +0000 (19:54 -0500)]
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>
10 years agocompositor-rdp: Add an option to disable client initiated resizes
Hardening [Thu, 3 Apr 2014 00:54:00 +0000 (19:54 -0500)]
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>
10 years agogl-renderer: Fix read_pixels in the case where we have output borders
Jason Ekstrand [Thu, 3 Apr 2014 00:53:59 +0000 (19:53 -0500)]
gl-renderer: Fix read_pixels in the case where we have output borders

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agoAdd support for running with a primary client
Jason Ekstrand [Thu, 3 Apr 2014 00:53:58 +0000 (19:53 -0500)]
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>
10 years agocompositor-wayland: Properly handle running inside a compositor that does not provide...
Jason Ekstrand [Thu, 3 Apr 2014 00:53:57 +0000 (19:53 -0500)]
compositor-wayland: Properly handle running inside a compositor that does not provide keymaps

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agoAutomatically select the wayland backend if WAYLAND_SOCKET is set
Jason Ekstrand [Thu, 3 Apr 2014 00:53:56 +0000 (19:53 -0500)]
Automatically select the wayland backend if WAYLAND_SOCKET is set

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agocompositor-wayland: Add a --sprawl option
Jason Ekstrand [Thu, 3 Apr 2014 00:53:55 +0000 (19:53 -0500)]
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>
10 years agocompositor-wayland: Add support for running on top of wl_fullscreen_shell
Jason Ekstrand [Thu, 3 Apr 2014 00:53:54 +0000 (19:53 -0500)]
compositor-wayland: Add support for running on top of wl_fullscreen_shell

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agoweston-fullscreen: Add cursor drawing support and properly handle WL_FULLSCREEN_SHELL...
Jason Ekstrand [Thu, 3 Apr 2014 00:53:53 +0000 (19:53 -0500)]
weston-fullscreen: Add cursor drawing support and properly handle WL_FULLSCREEN_SHELL_CAPABILITY_CURSOR_PLANE

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agoweston-fullscreen: Add wl_fullscreen_shell support
Jason Ekstrand [Thu, 3 Apr 2014 00:53:52 +0000 (19:53 -0500)]
weston-fullscreen: Add wl_fullscreen_shell support

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agotoytoolkit: Don't crash if wl_data_device_manager is not present
Jason Ekstrand [Thu, 3 Apr 2014 00:53:51 +0000 (19:53 -0500)]
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>
10 years agotoytoolkit: Expose output make and model
Jason Ekstrand [Thu, 3 Apr 2014 00:53:50 +0000 (19:53 -0500)]
toytoolkit: Expose output make and model

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agotoytoolkit: Only require xdg_shell if the window is not custom
Jason Ekstrand [Thu, 3 Apr 2014 00:53:49 +0000 (19:53 -0500)]
toytoolkit: Only require xdg_shell if the window is not custom

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agosimple-shm: Add wl_fullscreen_shell support
Jason Ekstrand [Thu, 3 Apr 2014 00:53:48 +0000 (19:53 -0500)]
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>
10 years agoAdd a wl_fullscreen_shell implementation
Jason Ekstrand [Thu, 3 Apr 2014 00:53:47 +0000 (19:53 -0500)]
Add a wl_fullscreen_shell implementation

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agoAdd possible capabilities CURSOR_PLANE and ARBITRARY_MODE
Jason Ekstrand [Thu, 3 Apr 2014 00:53:46 +0000 (19:53 -0500)]
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>
10 years agoAdd a signal for when a seat updates its capabilities
Jason Ekstrand [Thu, 3 Apr 2014 00:53:45 +0000 (19:53 -0500)]
Add a signal for when a seat updates its capabilities

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agoGenerate/build the fullscreen shell protocol files
Jason Ekstrand [Thu, 3 Apr 2014 00:53:44 +0000 (19:53 -0500)]
Generate/build the fullscreen shell protocol files

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agoAdd a fullscreen shell protocol
Jason Ekstrand [Thu, 3 Apr 2014 00:53:43 +0000 (19:53 -0500)]
Add a fullscreen shell protocol

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agocompositor: let the shells create the screenshooter
Giulio Camuffo [Wed, 11 Dec 2013 22:45:12 +0000 (23:45 +0100)]
compositor: let the shells create the screenshooter

10 years agocompositor: add an exported function to take a screenshot of an output
Giulio Camuffo [Wed, 11 Dec 2013 22:45:11 +0000 (23:45 +0100)]
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.

10 years agoshell: position input panel layer above fullscreen layer
Manuel Bachmann [Wed, 5 Mar 2014 11:21:34 +0000 (12:21 +0100)]
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>
10 years agocompositor: use Mod-Tab to show/raise minimized surfaces
Manuel Bachmann [Wed, 26 Feb 2014 14:53:11 +0000 (15:53 +0100)]
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>
10 years agocompositor: implement xdg_surface_set_minimized()
Manuel Bachmann [Wed, 26 Feb 2014 14:52:13 +0000 (15:52 +0100)]
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>
10 years agocompositor: export weston_buffer_from_resource()
Giulio Camuffo [Thu, 12 Dec 2013 13:14:29 +0000 (14:14 +0100)]
compositor: export weston_buffer_from_resource()

This is needed to allow shell plugins to implement their own
screenshooter.

10 years agoxdg-shell: rename the xdg_surface.delete event to close.
Giulio Camuffo [Mon, 24 Mar 2014 12:13:22 +0000 (14:13 +0200)]
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>
10 years agocompositor: Use weston_log rather than perror for error messages
Bryce W. Harrington [Fri, 21 Mar 2014 05:54:02 +0000 (05:54 +0000)]
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>
10 years agoMake RDP backend supports arbitrary modes
Hardening [Thu, 20 Mar 2014 21:34:30 +0000 (22:34 +0100)]
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 (.

10 years agoCheck return value of wl_cursor functions
Hardening [Tue, 18 Mar 2014 13:12:50 +0000 (14:12 +0100)]
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>
10 years agoclients/scaler: add modes to test wl_scaler version 2
Pekka Paalanen [Fri, 14 Mar 2014 12:38:18 +0000 (14:38 +0200)]
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>
10 years agoprotocol,compositor: split wl_viewport setters
Pekka Paalanen [Fri, 14 Mar 2014 12:38:17 +0000 (14:38 +0200)]
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>
10 years agocompositor: replace weston_buffer_viewport::viewport_set
Pekka Paalanen [Fri, 14 Mar 2014 12:38:16 +0000 (14:38 +0200)]
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>
10 years agocompositor: reorganize struct weston_buffer_viewport
Pekka Paalanen [Fri, 14 Mar 2014 12:38:15 +0000 (14:38 +0200)]
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>
10 years agocompositor: use surface_set_size() in one more case
Pekka Paalanen [Fri, 14 Mar 2014 12:38:14 +0000 (14:38 +0200)]
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>
10 years agocompositor: refactor code into weston_surface_reset_pending_buffer()
Pekka Paalanen [Fri, 14 Mar 2014 12:38:13 +0000 (14:38 +0200)]
compositor: refactor code into weston_surface_reset_pending_buffer()

No functional changes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
10 years agocompositor: buffer can be non-NULL only if newly_attached
Pekka Paalanen [Fri, 14 Mar 2014 12:38:12 +0000 (14:38 +0200)]
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>
10 years agocompositor: refactor more into weston_surface_attach
Pekka Paalanen [Fri, 14 Mar 2014 12:38:11 +0000 (14:38 +0200)]
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>
10 years agoweston: Send done event with version 2 of wl_output
Quanxian Wang [Fri, 14 Mar 2014 01:16:25 +0000 (09:16 +0800)]
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>
10 years agoshell: Correct error message when we already have an xdg surface
Jasper St. Pierre [Tue, 25 Mar 2014 17:31:44 +0000 (13:31 -0400)]
shell: Correct error message when we already have an xdg surface

It was referencing get_shell_surface, which is absolutely wrong.

10 years agoclients: Remove unused client-side resize tracking code
Jasper St. Pierre [Mon, 10 Mar 2014 15:35:48 +0000 (11:35 -0400)]
clients: Remove unused client-side resize tracking code

10 years agoshell: Only animate window closing for mapped windows
Kristian Høgsberg [Thu, 20 Mar 2014 21:49:07 +0000 (14:49 -0700)]
shell: Only animate window closing for mapped windows

https://bugs.freedesktop.org/show_bug.cgi?id=76415

10 years agoshell: Animate window closing
Kristian Høgsberg [Tue, 11 Mar 2014 17:19:10 +0000 (10:19 -0700)]
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.

10 years agoanimation: Fix the fade animation to work in both directions
Kristian Høgsberg [Wed, 19 Mar 2014 23:45:23 +0000 (16:45 -0700)]
animation: Fix the fade animation to work in both directions

We'll use this for fading out windows.

10 years agocompsitor-x11: Report more accurate dimension of outputs
Kristian Høgsberg [Tue, 18 Mar 2014 19:15:42 +0000 (12:15 -0700)]
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.

10 years agoAdd libinput based input device backend
Jonas Ådahl [Wed, 12 Mar 2014 21:08:42 +0000 (22:08 +0100)]
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>
10 years agoudev-seat: Make udev_input own its own udev object reference
Jonas Ådahl [Wed, 12 Mar 2014 21:08:41 +0000 (22:08 +0100)]
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>
10 years agoudev-seat: Make udev_seat_get_named take struct udev_input pointer
Jonas Ådahl [Wed, 12 Mar 2014 21:08:40 +0000 (22:08 +0100)]
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>
10 years agoAdd support for having different GBM formats for different outputs
Neil Roberts [Fri, 7 Mar 2014 18:05:50 +0000 (18:05 +0000)]
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.

10 years agoSplit gl_renderer_setup into two functions
Neil Roberts [Fri, 7 Mar 2014 18:05:49 +0000 (18:05 +0000)]
Split gl_renderer_setup into two functions

Part of the gl_renderer_setup function only deals with checking EGL
extensions and doesn't need to have a current context. This patch
moves these checks so that they are done during gl_renderer_create
instead of waiting until we have an output. We will need this in a
later patch because some of the EGL extensions will affect how we
create the EGLSurface.

10 years agox11-backend: Override scale from weston.ini if --scale is passed
Kristian Høgsberg [Mon, 10 Mar 2014 20:41:35 +0000 (13:41 -0700)]
x11-backend: Override scale from weston.ini if --scale is passed

This matches our behavior for width and height, and is useful for launching
weston with a different scale factor without editing the .ini file.

10 years agox11-backend: Add a --scale option
Jason Ekstrand [Fri, 7 Mar 2014 21:29:14 +0000 (15:29 -0600)]
x11-backend: Add a --scale option

10 years agoFix the pixman renderer with respect to output transforms
Jason Ekstrand [Wed, 26 Feb 2014 03:54:59 +0000 (21:54 -0600)]
Fix the pixman renderer with respect to output transforms

Commit fa1b3055 introducted a regression in the pixman renderer.  In
particular, it would not draw properly with any output transform other
than normal, 180, 180-flipped, or 270-flipped.  This patch fixes this
regression.  The weston-scalar program appears to work normally at all
rotations with this patch.  Therefore, this patch should fix the regression
while maintaining the added functionality from fa1b3055.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agoxdg-shell: Improve documentation for use_unstable_version request
Kristian Høgsberg [Wed, 19 Feb 2014 18:24:46 +0000 (10:24 -0800)]
xdg-shell: Improve documentation for use_unstable_version request

Clarify that this is for catching protocol mismatch while the protocol
is under development.

10 years agoxdg-shell: Bump unstable version to 3
Kristian Høgsberg [Wed, 19 Feb 2014 18:14:46 +0000 (10:14 -0800)]
xdg-shell: Bump unstable version to 3

10 years agoshell: Consolidate state changes into xdg_surface_change_state
Kristian Høgsberg [Wed, 19 Feb 2014 07:28:09 +0000 (23:28 -0800)]
shell: Consolidate state changes into xdg_surface_change_state

This makes xdg_surface_change state the canonical place for changing
surface state and moves much of the duplicated code into one place.

10 years agoxdg-shell: Replace the set_* atrocity with a new approach
Jasper St. Pierre [Sat, 8 Feb 2014 23:29:49 +0000 (18:29 -0500)]
xdg-shell: Replace the set_* atrocity with a new approach

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.

10 years agoweston.ini.in: Update path to weston-flower
Jasper St. Pierre [Wed, 19 Feb 2014 00:48:12 +0000 (19:48 -0500)]
weston.ini.in: Update path to weston-flower

Ever since the autotools flattening, the launcher for weston-flower
contained an incorrect path...

10 years agoxdg-shell: Rename focused_set / focused_unset to activated / deactivated
Jasper St. Pierre [Sat, 8 Feb 2014 23:11:53 +0000 (18:11 -0500)]
xdg-shell: Rename focused_set / focused_unset to activated / deactivated

To try and make the distinction between this event and keyboard focus.

10 years agoclients: Add delete handler for simple-shm / simple-egl
Jasper St. Pierre [Sat, 8 Feb 2014 23:31:10 +0000 (18:31 -0500)]
clients: Add delete handler for simple-shm / simple-egl

It seems this was forgotten in the port.

10 years agoclients: Add support for the minimize button
Jasper St. Pierre [Wed, 19 Feb 2014 00:18:42 +0000 (19:18 -0500)]
clients: Add support for the minimize button

10 years agoReorder the xdg_shell implementations to fit the spec'd order
Jasper St. Pierre [Sat, 1 Feb 2014 23:35:15 +0000 (18:35 -0500)]
Reorder the xdg_shell implementations to fit the spec'd order

10 years agowindow: Remove window_location enum
Jasper St. Pierre [Mon, 10 Feb 2014 18:22:34 +0000 (13:22 -0500)]
window: Remove window_location enum

It's unused except for one easily-replaceable place.