Commit Graph

3927 Commits

Author SHA1 Message Date
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
Neil Roberts
b7f8533e2b 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.
2014-03-12 14:44:00 -07:00
Kristian Høgsberg
3c2e66bb6c 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.
2014-03-10 13:41:35 -07:00
Jason Ekstrand
d89a0946a7 x11-backend: Add a --scale option 2014-03-10 13:29:40 -07:00
Jason Ekstrand
50fba97ec6 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>
2014-03-10 13:29:40 -07:00
Kristian Høgsberg
97b52203aa xdg-shell: Improve documentation for use_unstable_version request
Clarify that this is for catching protocol mismatch while the protocol
is under development.
2014-02-19 10:24:46 -08:00
Kristian Høgsberg
c7680b09dd xdg-shell: Bump unstable version to 3 2014-02-19 10:14:46 -08:00
Kristian Høgsberg
283bf373a1 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.
2014-02-19 09:50:40 -08:00
Jasper St. Pierre
8c6aa45f97 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.
2014-02-19 09:50:40 -08:00
Jasper St. Pierre
ed7cae3425 weston.ini.in: Update path to weston-flower
Ever since the autotools flattening, the launcher for weston-flower
contained an incorrect path...
2014-02-18 20:39:51 -08:00
Jasper St. Pierre
b223a72147 xdg-shell: Rename focused_set / focused_unset to activated / deactivated
To try and make the distinction between this event and keyboard focus.
2014-02-18 16:39:01 -08:00
Jasper St. Pierre
a0d8a30931 clients: Add delete handler for simple-shm / simple-egl
It seems this was forgotten in the port.
2014-02-18 16:38:53 -08:00
Jasper St. Pierre
5a183329ca clients: Add support for the minimize button 2014-02-18 19:20:18 -05:00
Jasper St. Pierre
63a9c336f3 Reorder the xdg_shell implementations to fit the spec'd order 2014-02-18 19:20:17 -05:00
Jasper St. Pierre
63a1410348 window: Remove window_location enum
It's unused except for one easily-replaceable place.
2014-02-18 14:08:10 -08:00
Jasper St. Pierre
981aad5b7e xdg-shell: Remove "edges" from description
The parameter was dropped...
2014-02-18 14:08:05 -08:00
Emilio Pozuelo Monfort
a75920190e exposay: avoid needlessly activating the active view
Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2014-02-18 14:07:08 -08:00
Emilio Pozuelo Monfort
e818d59e88 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>
2014-02-18 14:05:49 -08:00
Emilio Pozuelo Monfort
f942b73a1c 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>
2014-02-18 14:04:39 -08:00
Emilio Pozuelo Monfort
3b6e68e2c1 exposay: arrange views per-output
https://bugs.freedesktop.org/show_bug.cgi?id=73173
2014-02-18 14:04:24 -08:00
Nobuhiko Tanibata
8841917e13 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>
2014-02-18 14:00:19 -08:00
Emilio Pozuelo Monfort
dae8a4b9c5 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>
2014-02-18 13:50:29 -08:00
Emilio Pozuelo Monfort
943cb12075 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>
2014-02-18 13:50:24 -08:00
Emilio Pozuelo Monfort
08dbd31c4b 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>
2014-02-18 13:49:37 -08:00
Emilio Pozuelo Monfort
2a67902c8f 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>
2014-02-18 13:49:21 -08:00
Emilio Pozuelo Monfort
2c87d9429e 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>
2014-02-18 13:48:58 -08:00
Emilio Pozuelo Monfort
dd9f6bc69b 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>
2014-02-18 13:48:49 -08:00
Kristian Høgsberg
db1fccb3d8 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
2014-02-18 13:47:41 -08:00
Kristian Høgsberg
dd62abafa1 shell: Use the per-client responsiveness tracking for wl_shell as well 2014-02-12 21:29:11 -08:00
Kristian Høgsberg
e11ef64534 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.
2014-02-11 16:35:22 -08:00
Kristian Høgsberg
fe84a97f17 build: List xdg protocol files as nodist SOURCEs 2014-02-11 16:22:10 -08:00
Kristian Høgsberg
4c1bfc9c46 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.
2014-02-11 16:22:10 -08:00
Kristian Høgsberg
239902b323 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.
2014-02-11 16:22:10 -08:00
Kristian Høgsberg
2bff94e057 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.
2014-02-11 16:22:10 -08:00
Mariusz Ceier
cbb9158162 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>
2014-02-09 21:38:03 -08:00
Kristian Høgsberg
dfaf65ba16 clients: Port simple-shm and simple-egl to xdg-shell 2014-02-07 17:01:57 -08:00
Jasper St. Pierre
9679cf9ba2 Update .gitignore 2014-02-07 14:53:31 -08:00
Jasper St. Pierre
7407345446 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.
2014-02-06 13:05:03 -08:00