profile/ivi/weston-ivi-shell.git
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.

10 years agoxdg-shell: Remove "edges" from description
Jasper St. Pierre [Mon, 10 Feb 2014 18:21:45 +0000 (13:21 -0500)]
xdg-shell: Remove "edges" from description

The parameter was dropped...

10 years agoexposay: avoid needlessly activating the active view
Emilio Pozuelo Monfort [Mon, 10 Feb 2014 15:52:33 +0000 (16:52 +0100)]
exposay: avoid needlessly activating the active view

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
10 years agotoytoolkit: avoid unnecessary redraws when focus changes
Emilio Pozuelo Monfort [Mon, 10 Feb 2014 15:52:32 +0000 (16:52 +0100)]
toytoolkit: avoid unnecessary redraws when focus changes

Clients that need to be redrawn when the focus changes do that by
listening to focus_changed and scheduling a redraw.

This was causing unnecessary redraws in the clients, as could be
easily seen by changing focus on weston-flower.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
10 years agoexposay: don't crash if a view goes away
Emilio Pozuelo Monfort [Mon, 10 Feb 2014 13:23:04 +0000 (14:23 +0100)]
exposay: don't crash if a view goes away

When a view was destroyed while we were on exposay, we didn't
remove it from the list of views, and so when leaving exposay
we were trying to animate (and sometimes activate) a
non-existent view, causing a crash.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
10 years agoexposay: arrange views per-output
Emilio Pozuelo Monfort [Mon, 10 Feb 2014 12:22:32 +0000 (13:22 +0100)]
exposay: arrange views per-output

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

10 years agoImprovement of weston.ini.man. Add key:shell and remove tablet-shell
Nobuhiko Tanibata [Mon, 10 Feb 2014 03:15:11 +0000 (12:15 +0900)]
Improvement of weston.ini.man. Add key:shell and remove tablet-shell

Add description of key:shell to CORE SECTION and move a example of desktop-shell from key:modules to key:shell.
Add cms-colord.so to key:modules of CORE SECTION.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
10 years agotests: Properly report skipped tests
Emilio Pozuelo Monfort [Fri, 7 Feb 2014 08:34:48 +0000 (09:34 +0100)]
tests: Properly report skipped tests

We were calling exit(0) when tests were skipped, which counted
them as passed instead of skipped. Fix this by properly exiting
with 77 (which is what automake expects for skipped tests) from
the tests themselves, then returning 77 again from weston-test-runner
if all the tests were skipped. Finally the weston-test.so module
catches weston-test-runner's exit code and uses it as an exit code,
which is what automake will see and use.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
10 years agotests: use the headless backend to run the test suite
Emilio Pozuelo Monfort [Fri, 7 Feb 2014 08:34:47 +0000 (09:34 +0100)]
tests: use the headless backend to run the test suite

Other backends can be used by passing BACKEND=some-backend.so, e.g.

    $ make check BACKEND=x11-backend.so

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
10 years agotests: Skip buffer-count if EGL initialization fails
Emilio Pozuelo Monfort [Fri, 7 Feb 2014 08:34:46 +0000 (09:34 +0100)]
tests: Skip buffer-count if EGL initialization fails

That is the case when using the headless backend. In the future
we may be able to use the mesa null egl platform but for now let's
just skip it.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
10 years agonoop-renderer: Read the shm buffer contents on attach
Emilio Pozuelo Monfort [Fri, 7 Feb 2014 08:34:45 +0000 (09:34 +0100)]
noop-renderer: Read the shm buffer contents on attach

The noop-renderer doesn't read buffer contents, which means bad
buffers go undetected. Thus, read the buffer contents just for
the purpose of triggering SIGBUS (and having the client killed).

Fixes the bad-buffer test when run against the headless backend.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
10 years agonoop-renderer: Set the buffer size on attach requests
Emilio Pozuelo Monfort [Fri, 7 Feb 2014 08:34:44 +0000 (09:34 +0100)]
noop-renderer: Set the buffer size on attach requests

This lets the compositor know the size of the surface as calculated
in weston_surface_set_size_from_buffer(), and fixes a couple of
tests when using the headless backend.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
10 years agocompositor-headless: create input devices
Emilio Pozuelo Monfort [Fri, 7 Feb 2014 08:34:43 +0000 (09:34 +0100)]
compositor-headless: create input devices

Fixes a segfault when using compositor-headless for the test suite
as many tests assume there are input devices and try to use them
through the wl_test interface.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
10 years agoinput: Send leave and enter pair when the surface moves under the cursor
Kristian Høgsberg [Thu, 6 Feb 2014 01:14:42 +0000 (17:14 -0800)]
input: Send leave and enter pair when the surface moves under the cursor

The client needs to know that the pointer is at a different position in
its surface.  We can't send motion as that corresponds to the pointer
actually moving.  Leaving the surface and entering at the new position
is a better semantic match and doesn't correspond to pointer motion
or user input.

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

10 years agoshell: Use the per-client responsiveness tracking for wl_shell as well
Kristian Høgsberg [Wed, 12 Feb 2014 17:56:19 +0000 (09:56 -0800)]
shell: Use the per-client responsiveness tracking for wl_shell as well

10 years agocompositor: Drop core ping_handler callout
Kristian Høgsberg [Wed, 12 Feb 2014 00:35:22 +0000 (16:35 -0800)]
compositor: Drop core ping_handler callout

This was always a little iffy.  At least it could have been a signal,
but we now have focus signal, so lets just use that.  We lose
the ability to detect unresponsive clients at key event time, but we
could add that back by adding a key_signal.

10 years agobuild: List xdg protocol files as nodist SOURCEs
Kristian Høgsberg [Tue, 11 Feb 2014 22:23:19 +0000 (14:23 -0800)]
build: List xdg protocol files as nodist SOURCEs

10 years agobuild: Link to libshared.la instead of adding to SOURCES
Kristian Høgsberg [Tue, 11 Feb 2014 22:21:39 +0000 (14:21 -0800)]
build: Link to libshared.la instead of adding to SOURCES

libshared.la is just os-compat, the option and config parser, so let's
link to that instead of adding the os-compat files to all these targets.

10 years agoclient: Fix shell unstable version check
Kristian Høgsberg [Tue, 11 Feb 2014 21:50:08 +0000 (13:50 -0800)]
client: Fix shell unstable version check

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.

10 years agoxdg-shell: Move "ping" and "pong" to xdg_shell, not xdg_surface
Kristian Høgsberg [Tue, 11 Feb 2014 20:22:51 +0000 (12:22 -0800)]
xdg-shell: Move "ping" and "pong" to xdg_shell, not xdg_surface

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.

10 years agoDon't crash when eglCreateContext fails
Mariusz Ceier [Sat, 8 Feb 2014 19:11:24 +0000 (20:11 +0100)]
Don't crash when eglCreateContext fails

eglCreateContext fails with every EGLConfig that
nvidia blob 334.16 provides causing NULL pointer
dereference in gl_renderer_destroy when destroying
fragment and fan bindings.

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

Signed-off-by: Mariusz Ceier <mceier+wayland@gmail.com>
10 years agoclients: Port simple-shm and simple-egl to xdg-shell
Kristian Høgsberg [Sat, 8 Feb 2014 01:01:57 +0000 (17:01 -0800)]
clients: Port simple-shm and simple-egl to xdg-shell

10 years agoUpdate .gitignore
Jasper St. Pierre [Thu, 6 Feb 2014 20:43:19 +0000 (15:43 -0500)]
Update .gitignore

10 years agoxdg-shell: Add set_margin request
Jasper St. Pierre [Sat, 1 Feb 2014 23:36:41 +0000 (18:36 -0500)]
xdg-shell: Add set_margin request

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.

10 years agoxdg-shell: Add a "delete" event
Jasper St. Pierre [Sat, 1 Feb 2014 23:17:34 +0000 (18:17 -0500)]
xdg-shell: Add a "delete" event

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.

10 years agobuild: Add missing AM_CFLAGS to client target CFLAGS
Kristian Høgsberg [Thu, 6 Feb 2014 06:00:59 +0000 (22:00 -0800)]
build: Add missing AM_CFLAGS to client target CFLAGS

10 years agoxdg-shell: Drop edges arg from xdg_surface configure event
Kristian Høgsberg [Thu, 6 Feb 2014 05:36:04 +0000 (21:36 -0800)]
xdg-shell: Drop edges arg from xdg_surface configure event

10 years agonested-client: Fix build error
Jason Ekstrand [Thu, 6 Feb 2014 03:38:27 +0000 (21:38 -0600)]
nested-client: Fix build error

10 years agocompositor: Move view repositioning logic into shell
Ander Conselvan de Oliveira [Wed, 29 Jan 2014 16:47:54 +0000 (18:47 +0200)]
compositor: Move view repositioning logic into shell

Remove the listener for output destroy from weston_view and instead
iterate views owned by the shell in its own output destroy listener.

This simplifies the code a bit since keeping the view listening for the
destroy on the right output was a bit complicated. This also removes the
function pointer output_destroyed from weston_view. The only user for it
was desktop shell, but now this is all handled in shell.c.

10 years agocompositor: Remove weston_output::move_signal
Ander Conselvan de Oliveira [Wed, 29 Jan 2014 16:47:52 +0000 (18:47 +0200)]
compositor: Remove weston_output::move_signal

Since that signal is per output, it is necessary to track in which
output a view is in so that the signal is handled properly.

Instead, add a compositor wide output moved signal, that is handled by
the shell. The shell iterates over the layers it owns to move views
appropriately.

10 years agodim-layer: fix dimming for unfocused surfaces
Emilio Pozuelo Monfort [Thu, 30 Jan 2014 12:49:39 +0000 (13:49 +0100)]
dim-layer: fix dimming for unfocused surfaces

Unfocusing a surface should dim it when dim-layer is enabled,
but this got broken in commit 83ffd9.

10 years agocompositor-rpi: Fix input initialization
Emilio Pozuelo Monfort [Mon, 3 Feb 2014 15:57:27 +0000 (16:57 +0100)]
compositor-rpi: Fix input initialization

The input initialization code assumes the outputs have already
been initialized; thus create the outputs first. This fixes a
segfault upon startup. It is also what the drm and fbdev backends
do.

10 years agoREADME: Fix typo; add link to testing docs
Bryce W. Harrington [Mon, 3 Feb 2014 21:37:06 +0000 (21:37 +0000)]
README: Fix typo; add link to testing docs

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
10 years agogl-renderer: Use eglSwapBuffersWithDamageEXT when available
Jason Ekstrand [Wed, 5 Feb 2014 03:36:39 +0000 (21:36 -0600)]
gl-renderer: Use eglSwapBuffersWithDamageEXT when available

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agogl-renderer: Track border damage and only repaint borders on an as-needed basis
Jason Ekstrand [Wed, 5 Feb 2014 03:36:38 +0000 (21:36 -0600)]
gl-renderer: Track border damage and only repaint borders on an as-needed basis

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agowindow: Delay scheduled redraws if we start maximize or fullscreen protocol
Kristian Høgsberg [Thu, 6 Feb 2014 00:53:43 +0000 (16:53 -0800)]
window: Delay scheduled redraws if we start maximize or fullscreen protocol

When we set the fullscreen flag, we have to wait for the corresponding
configure event and then attach a buffer of that size to indicate
that we've successfully gone fullscreen/maximized.

Without this patch, we can schedule a redraw and go through with it after
setting maximize/fullscreen and end up attaching a buffer of the wrong size.
In practice, what happens is that pressing the maximize button triggers
setting maximized, but also triggers a redraw to paint the maxmize button.
Without this change, repainting the button triggers a repaint that attaches
the same size buffer immediately.

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

10 years agoterminal: Only reset title if we put the window size there
Kristian Høgsberg [Wed, 5 Feb 2014 22:44:04 +0000 (14:44 -0800)]
terminal: Only reset title if we put the window size there

When resizing the terminal, it shows the grid size in the titlebar.
We reset the title next time we get an enter event.  This patch makes
sure we only reset the title the first time we enter after a resize.

10 years agoinput: Run touch binding before calling touch grab
Kristian Høgsberg [Wed, 5 Feb 2014 22:25:18 +0000 (14:25 -0800)]
input: Run touch binding before calling touch grab

We don't want to send events if the binding is going to handle the touch
event.  Also, this restricts touch bindings to only trigger on touch down.
For gesture bindings we want something similar to the motion signal we
have for the pointer.

10 years agowindow: Ask xkbcommon whether or not to repeat a key
Kristian Høgsberg [Wed, 5 Feb 2014 21:43:44 +0000 (13:43 -0800)]
window: Ask xkbcommon whether or not to repeat a key

10 years agoinput: Transform to surface coordinates outside resource for loop
Kristian Høgsberg [Wed, 5 Feb 2014 06:12:29 +0000 (22:12 -0800)]
input: Transform to surface coordinates outside resource for loop

When we send the pointer motion event, the transform from compositor to
surface coordinates doesn't depend on the resource.  Transform the
coordinates up front instead of everytime we send to a resource.

10 years agoshell: Remove elaborate if-statement with empty body
Kristian Høgsberg [Wed, 5 Feb 2014 06:44:57 +0000 (22:44 -0800)]
shell: Remove elaborate if-statement with empty body

10 years agoshell: Handle wl_shell surfaces created by xwayland correctly
Kristian Høgsberg [Mon, 3 Feb 2014 23:50:38 +0000 (15:50 -0800)]
shell: Handle wl_shell surfaces created by xwayland correctly

When xwayland creates a shell surface we don't have a resource.  The
recently added shell_surface_is_wl_shell/xdg_surface() tests don't
handle that very well.

For now, we assume that a surface without a resource is created from
xwayland and is a wl_shell surface.  We'll want to modify that to be a
xdg surface eventually, but for now this stops weston from crashing.

10 years agobuild: Pass pkg-config CFLAGS as target_CFLAGS, not CPPFLAGS
Kristian Høgsberg [Mon, 3 Feb 2014 19:05:41 +0000 (11:05 -0800)]
build: Pass pkg-config CFLAGS as target_CFLAGS, not CPPFLAGS

10 years agobuild: Add a rule for creating git-version.h when we don't have a git repo
Kristian Høgsberg [Mon, 3 Feb 2014 18:55:51 +0000 (10:55 -0800)]
build: Add a rule for creating git-version.h when we don't have a git repo

For dist tarballs we ship git-version.h but if you do a git archive or
similar to check out a source tree, there's no git-version.h and no
way to make one.

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

10 years agobuild: fix weston-info CFLAGS
Pekka Paalanen [Mon, 3 Feb 2014 11:12:34 +0000 (13:12 +0200)]
build: fix weston-info CFLAGS

  CC       clients/weston-info.o
clients/weston-info.c:31:28: fatal error: wayland-client.h: No such file or directory
compilation terminated.
make[1]: *** [clients/weston-info.o] Error 1

Only triggerable if libwayland is only in a custom prefix.

Fix by adding CLIENT_CFLAGS.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
10 years agobuild: pass client flags to test programs
Pekka Paalanen [Mon, 3 Feb 2014 11:12:33 +0000 (13:12 +0200)]
build: pass client flags to test programs

Fix build failures of the kind:

  CC       tests/bad-buffer-test.o
In file included from tests/weston-test-client-helper.h:28:0,
                 from tests/bad-buffer-test.c:28:
./protocol/wayland-test-client-protocol.h:35:28: fatal error: wayland-client.h: No such file or directory
compilation terminated.
make[1]: *** [tests/bad-buffer-test.o] Error 1

These are only triggerable if libwayland has not been installed
system-wide, but only in a custom prefix.

Since the Makefile already uses AM_CPPFLAGS, simply add
TEST_CLIENT_CFLAGS to test programs instead of dropping AM_CPPFLAGS.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
10 years ago.gitignore: Add .dirstamp
Kristian Høgsberg [Sun, 2 Feb 2014 06:16:43 +0000 (22:16 -0800)]
.gitignore: Add .dirstamp

10 years agobuild: Set a default aux dir
Guillem Jover [Sat, 1 Feb 2014 17:48:43 +0000 (18:48 +0100)]
build: Set a default aux dir

This moves all the auxiliary build scripts into a build-aux directory,
and fixes an issue with configure being unable to find scripts because
it tries to change to an empty directory to get the absolute path,
which results in getting the path to the user's home directory instead.

,--
checking whether build environment is sane... yes
/bin/bash: /home/user/missing: No such file or directory
configure: WARNING: 'missing' script is too old or missing
`---

Signed-off-by: Guillem Jover <guillem@hadrons.org>
10 years agobuild: Don't dist generated sources
Kristian Høgsberg [Sun, 2 Feb 2014 05:52:17 +0000 (21:52 -0800)]
build: Don't dist generated sources

10 years agoMakefile.am: Fix protocol source files usage
Quentin Glidic [Sat, 1 Feb 2014 20:39:12 +0000 (21:39 +0100)]
Makefile.am: Fix protocol source files usage

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
10 years agoxwayland: Fix typo in open flags for Xorg log file
Kristian Høgsberg [Sun, 2 Feb 2014 04:44:54 +0000 (20:44 -0800)]
xwayland: Fix typo in open flags for Xorg log file

10 years agobuild: Add -Wsign-compare to GCC flags
Kristian Høgsberg [Sat, 1 Feb 2014 19:02:41 +0000 (11:02 -0800)]
build: Add -Wsign-compare to GCC flags

10 years agoRevert "stacking: Remove transient window support"
Jasper St. Pierre [Mon, 9 Dec 2013 20:20:16 +0000 (15:20 -0500)]
Revert "stacking: Remove transient window support"

This reverts commit 4c1a11074af2c2221d50b0c35d2d0d883647bc15.

Use the new window_set_transient_for / window_get_transient_for
and xdg-shell support for this...

10 years agowindow: Add wrappers for xdg_surface_set_transient_for
Jasper St. Pierre [Mon, 9 Dec 2013 20:26:25 +0000 (15:26 -0500)]
window: Add wrappers for xdg_surface_set_transient_for