Commit Graph

3765 Commits

Author SHA1 Message Date
Emilio Pozuelo Monfort
bb835b419e man: document new focus-animation config entry 2013-11-21 21:35:28 -08:00
Emilio Pozuelo Monfort
46ce798d28 shell: add a client config entry 2013-11-21 21:35:17 -08:00
David Herrmann
fcb6bf43a4 logind: change to -1+errno
Set errno and return -1 in public API calls like all other weston code
does. Most systemd+dbus calls return negative error-codes instead of -1
and setting errno. Thus, we need to explicitly set errno before returning.

Also note that we must set errno _after_ the cleanup path. Calling
functions like close() in the cleanup path might overwrite errno (which is
not what we want). So protect errno until the final return -1;
2013-11-21 16:28:08 -08:00
Kristian Høgsberg
f86c39058a logind: Use dbus_bool_t for bool types in dbus calls
The gcc built-in 'bool' type is not the same size as dbus_bool_t, which is
an uint32_t.  Passing a pointer to bool where dbus expects a uint32_t *
doesn't work.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2013-11-21 10:45:41 -08:00
Giulio Camuffo
576fe2af4b input: set the focus to NULL when the focus's resource is destroyed
with the surface ref-count feature a surface may live on after its
resource was destroyed. so listen for the resource destroy signal
and set the focus to NULL.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-20 16:59:00 -08:00
Kristian Høgsberg
8b66ebd3fa weston-info: Handle shm formats better
Use a switch for this and don't fall back to XRGB8888 if we don't
recognize the format.
2013-11-20 13:54:00 -08:00
Jason Ekstrand
399841dae7 Update the weston man page to include the new Wayland backend options
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-19 13:39:58 -08:00
Jason Ekstrand
3ec57f5d69 compositor-drm: Release the correct buffer in drm_output_release_fb 2013-11-19 13:25:10 -08:00
Jason Ekstrand
42133d47d3 input: Fix a segfault in focus checking
Without this, weston will segfault whenever the focus is a non-client
surface such as the black surface in fullscreen.
2013-11-19 13:23:40 -08:00
Ander Conselvan de Oliveira
895b1fdcb2 gl-renderer: Attach buffer during surface state creation if possible
When a renderer switch happens, it is possible that when the surface
state is created, a buffer for the given surface is already available.
In that case, run the attach routine so that the pixel contents are
properly set. Otherwise, it would only be set when a new attach request
is made for that surface.

Also, change the drm backend so that it keeps the buffer reference in
the weston_surface when running with the pixman renderer. The pixman
renderer keeps a reference to it anyway, so it is never released
early.

This makes the renderer transition seamless, without leaving a black
screen as before.
2013-11-19 13:11:25 -08:00
Ander Conselvan de Oliveira
65796816b9 compositor-drm: Add key binding to switch from pixman to GL renderer
When running with the pixman renderer, the debug binding 'W'
(mod-shift-space W) will cause the compositor to load gl-renderer.so
and start using it instead of the pixman renderer.
2013-11-19 13:11:20 -08:00
Pekka Paalanen
b188e912c3 compositor: fix sub-surface view stacking order
If you opened a window with sub-surfaces, and then raised another window
on top of that, the underlaying window's main surface was stacked
properly, but the sub-surfaces remained on top of the raised window.
IOW, the raised window was in between the other window and its
sub-surfaces.

This got broken in a7af70436b, "Split the
geometry information from weston_surface out into weston_view".

Fix the issues:

In view_list_add_subsurface_view(), the views need to be added to the
end of the list, not to the head. This alone fixes the above problem,
but causes the sub-surface views to be stacked irrespective of their
surface stacking order. The stacking order in this test case is fixed by
the changes to view_list_add(), but for sub-sub-surfaces a similar
change is needed in view_list_add_subsurface_view() too.

In view_list_add(), build the view list in the sub-surface stacking
order, instead of pulling the parent surface always on top. Also handle
the case, when the subsurface_list is completely empty: the parent
surface's view must still be added.

Reported-by: Julien Isorce <julien.isorce@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Cc: Jason Ekstrand <jason@jlekstrand.net>
2013-11-19 12:57:24 -08:00
Emilio Pozuelo Monfort
17467d602d exposay: move the pointer in our motion handler
This is necessary since commit 1959ab.
2013-11-19 11:52:12 -08:00
Emilio Pozuelo Monfort
da64426685 shell: Set output on the focus_surfaces' view
Otherwise we crash when animating the view.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2013-11-19 11:51:51 -08:00
Emilio Pozuelo Monfort
5c22ce652d exposay: Activate a surface when hovering it
This causes the surface to get the keyboard focus, which in turn
causes focus-animation to nicely work with exposay, making the
not focused surfaces to be dimmed.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2013-11-19 11:51:44 -08:00
Emilio Pozuelo Monfort
8224309f14 exposay: add cancel impl to the kbd grab iface
Otherwise we'll crash when cancel is called.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2013-11-19 11:51:26 -08:00
Emilio Pozuelo Monfort
03251b6a7a shell: Implement alt-tab switcher
Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2013-11-19 11:51:18 -08:00
Emilio Pozuelo Monfort
aa7a4761f6 input: Don't send leave events to destroyed views
If a view which has focus is destroyed, we would send a leave
event while changing focus, causing a segfault. Prevent this
by listening to the view's destroy signal and removing it from
the pointer focus.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2013-11-19 11:49:40 -08:00
Daniel Stone
df8133b725 Add Exposay
Exposay provides window overview functions which, when a key which
produces the binding modifier is pressed on its own, scales all
currently-open windows down to be shown overlaid on the desktop,
providing keyboard and mouse navigation to be able to switch window
focus.

[pochu: rebased, ported to weston_view]
2013-11-19 11:49:33 -08:00
Daniel Stone
a67e6b9818 Add move/scale animation
Add an animation which moves a surface to a new location, at the same
time as also rescaling it to a different size from the origin, rather
than the existing scale animation which resizes from the centre.

[pochu: rebased, ported to weston_view]
2013-11-19 11:49:28 -08:00
Daniel Stone
96d47c0ef7 Add modifier-only binding
Add the ability to bind to modifiers; the binding is armed when a key
which sets the requested modifier is pressed, and triggered if the key
is released with no other keys having been pressed in the meantime, as
well as mouse buttons or scroll axes.

This only works for direct modifiers (e.g. Shift and Alt), not modifiers
which latch or lock.

[pochu: rebased]
2013-11-19 11:49:25 -08:00
Louis-Francis Ratté-Boulianne
b482dbd7eb animation, shell: add kbd focus change animation
When enabled, this will make all but the keyboard-focused window dim.
Also the background gets dimmed, if there are any windows open. The
panel is not dimmed.

When the keyboard focus changes, the change in dimming is animated.

The dimming is implemented with transparent solid-color surfaces, two at
most. The net effect of two overlapping dim surfaces is kept constant
during animations (stable fade animation).

There is a new weston.ini option "focus-animation", that defaults to
none, and can be set to "dim-layer" to enable the focus change
animation.

[pq: Sliced, squashed, and rebased the patch series. Fixed surface alpha
interaction with the switcher. Wrote the commit message.]

[pochu: rebased, ported to weston_view]
2013-11-19 11:49:20 -08:00
Axel Davy
dd8b88d102 Wayland backend: set the opaque region when starting fullscreen
The opaque region is not set when we start the nested
compositor fullscreen. This patch fixes this.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2013-11-19 11:44:51 -08:00
Pekka Paalanen
a662206e71 protocol: move sub-surfaces to Wayland
This reverts commit 2396aec684.

This exact version of the sub-surface protocol has been copied into
Wayland core. Therefore it must be removed from here to avoid build
conflicts and useless duplication.

No other changes to sub-surface protocol consumers are needed, the
identical API is now offered by libwayland-client and libwayland-server.

The commit adding sub-surfaces to Wayland is:
Author: Pekka Paalanen <pekka.paalanen@collabora.co.uk>

    protocol: add sub-surfaces to the core

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-11-15 16:23:17 -08:00
Lubomir Rintel
ba44c6bf2e Add [core] backend option
This allows specifying a particular backend to load in a manner similar to
modules.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
2013-11-15 16:17:51 -08:00
Giulio Camuffo
cdb4d29096 compositor: add a way to override the default pointer grab 2013-11-15 16:17:51 -08:00
Giulio Camuffo
1959ab8d22 input: let the pointer motion handlers move the pointer
this allows to implement pointer barriers by using a custom handler
2013-11-15 16:17:51 -08:00
Giulio Camuffo
412b024be8 zoom: use the new pointer motion signal to move the zoom frame. 2013-11-15 16:17:51 -08:00
Giulio Camuffo
6fcb378c01 input: add a motion signal to weston_pointer
The signal will be emitted after the pointer is moved. A shell plugin
can listen to the signal and activate certain effects when the pointer
touches the screen corners, for instance.
2013-11-15 16:17:51 -08:00
Kristian Høgsberg
ace0a3920e weston-test: Always update transform when moving surface
weston_view_update_transform() will post damage in the old and new
positions of the view and thus make sure we always repaint properly.
In particular, in bug 66133, the test suite moves the surface off
any output and weston_surface_schedule_repaint() in commit fails to
do anything, since the surface is not on any output.

After changing view geometry, we have to either call
weston_compositor_schedule_repaint(), which is what shell.c typically
does, though that repaints all outputs, or call
weston_view_update_transform() to force update the transformation
and queue repaints on affected outputs.

https://bugs.freedesktop.org/show_bug.cgi?id=66133
2013-11-13 21:55:57 -08:00
Kristian Høgsberg
a3a784adae compositor: Schedule a repaint in weston_view_damage_below()
We always want a repaint if the view was damaged or changed.  In
particular, we want weston_view_update_transform() to schedule a
repaint for the old and new position if we change the view transform.
2013-11-13 21:33:43 -08:00
Jasper St. Pierre
77a51fd2c8 westoy: Remove some accessors for wl_shell / wl_shell_surface
We want to remove support for these deprecated interfaces. Since
nothing is using them, this is a simple change.
2013-11-13 20:43:56 -08:00
Jasper St. Pierre
bf17590f86 westoy: Remove unused support for window parents
It seems that this was only used by the popup menu infrastructure,
which can handle this all on its own. Implementing e.g. transients
in the future can be done with a simple xdg_shell_set_transient_for.
2013-11-13 16:43:03 -08:00
Jasper St. Pierre
01eaaac79a westoy: Remove window_touch_move
It seems to be the same as window_move, except it ignores the passed
in serial (???) and instead just uses the one of the display.
2013-11-13 16:37:36 -08:00
Neil Roberts
e505171a32 Add calls to wl_shm_buffer_begin/end_access
This wraps all accesses to an SHM buffer between wl_shm_buffer_begin
and end so that wayland-shm can install a handler for SIGBUS and catch
attempts to pass the compositor a buffer that is too small.
2013-11-13 16:32:58 -08:00
Jonas Ådahl
f707e8145b filter: Remove unused variable
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-12 16:20:34 -08:00
Jonas Ådahl
e82f8e4b0f evdev: Synchronize keys only if seat is keyboard capable
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-12 16:20:19 -08:00
Jasper St. Pierre
47f1043877 westoy: Fix the version number we request for wl_seat
If the compositor supports a lower version, like version 2, we need
to request that instead of version 3.
2013-11-12 11:42:43 -08:00
Jason Ekstrand
5ea048014d compositor-wayland: Add fullscreen support
This adds fullscreen support to the wayland backend.  You can make any
output fullscreen by the shortcut CTRL+ALT+F.  You can also run weston with
the --fullscreen option which causes it to create a single fullscreen
output.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-11 13:38:02 -08:00
Jason Ekstrand
12c6dd965b compositor-wayland: Add a --scale option
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-11 13:37:19 -08:00
Jason Ekstrand
0cf39351bb compositor-wayland: Move config parsing into backend_init
This cleans up the configuration and command parsing and separates it from
compositor/output initialization.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-11 13:37:08 -08:00
Jason Ekstrand
584fb62437 compositor-wayland: Fix cursor coordinate transforms so it works on translated outputs
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-11 13:36:45 -08:00
Jason Ekstrand
06ced80f93 compositor-wayland: rename wayland_compositor.inputs to input_list
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-11 13:36:32 -08:00
Jason Ekstrand
4d615a7aa1 compositor-wayland: Remove unused output handling code
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-11 13:36:22 -08:00
Jason Ekstrand
0bdd58f6c0 cairo-util: Rework frame button handling
This makes button handling more correct concerning drags.  Also,
frame_pointer_button returns the original button location in the case of a
release.  This makes filtering of button events much easier for users of
the cair-util frame code.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-07 16:35:06 -08:00
Jason Ekstrand
48ce42177f compositor-wayland: Parse [output] config sections and more options
This commit makes the wayland backend search through the config for
[output] sections with names starting with "WL" and create outputs
accordingly.  Outputs created due to the config file support mode, scale,
and transform parameters.  It also listens for the --output-count
command-line option.

This brings the wayland backend almost up to par, in terms of functionality
with the X11 backend.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-07 16:35:01 -08:00
Jason Ekstrand
33ff636812 Move region transformation code to weston_transformed_region
Both the Pixman renderer and the X11 backend contained effectively the same
region transformation code.  This commit adds a weston_transformed_region
function and changes pixman-renderer and compositor-x11 to use it.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-07 16:34:59 -08:00
Jason Ekstrand
b6a3cc7f17 Make weston_output_transform_coordinate more sane
The output is renamed "output" from "x11_output" and the input coordinates
are changed to wl_fixed_t from int.  This way it is useable in
compositor-wayland as well as compositor-x11 and evdev.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-07 16:34:57 -08:00
Jason Ekstrand
00b842854b Remove the concept of a border from weston_output.
The only user for this was the wayland backend with the GL renderer.  It is
not needed in the Pixman renderer because you can easily create subimages.
All of the fancy output matrix calculations can be replaced by a single
glViewport call.  Also, it didn't work with outputs located anywhere but
(0, 0) and I'm pretty sure output transformed outputs would break it too.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-07 16:34:54 -08:00
Jason Ekstrand
ff2fd46e9c compositor-wayland: Add pixman/SHM fallback mode
This also adds a --use-pixman command-line option to enable the pixman
renderer explicitly.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-07 16:34:47 -08:00