Commit Graph

3844 Commits

Author SHA1 Message Date
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
Jason Ekstrand
310382fb2f gl-renderer: Remove the renderer-global border support
This was only ever used by the wayland backend and is no longer used there.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-07 16:34:13 -08:00
Jason Ekstrand
7744f71550 compositor-wayland: Add an actual frame around the compositor window
This adds a window frame with a close button.  Similar to the X11 backend,
The window supports dragging but not resizing.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-07 16:34:10 -08:00
Jason Ekstrand
0b61bf444b gl-renderer: Add support for per-output multi-texture borders.
The first advantage of this new API is that it is per-output instead of
global to the gl_renderer instance.  This means that different windows can
have different titles, different button states, etc.  The new api also uses
four textures (one for each side) instead of one.  This allows you to draw
real borders with text and buttons in them instead of a simple image that
gets streached.

Images will be scaled as needed, so the right and left can be one pixel
tall if desired.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-07 16:34:08 -08:00
Jason Ekstrand
8f89fcb22b compositor-wayland: Rename structure members and make things more consistant
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-07 16:34:04 -08:00
Kristian Høgsberg
1d75c7d3a2 xwm: Set input region for fullscreen surfaces correctly
The logic here broke at some point so that we would only update the
input region for non-fullscreen windows.  Thus, a fullscreen window would
be stuck with whatever size the most recent non-fullscreen size was.

https://bugs.freedesktop.org/show_bug.cgi?id=69219
2013-10-30 23:46:08 -07:00
Jason Ekstrand
286ff6817b compositor-wayland: Flush the display on commit
This fixes the problem where animations will wait to play until input is
received.  In general, it also makes the backend far more responsive.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>

https://bugs.freedesktop.org/show_bug.cgi?id=68221
2013-10-30 23:31:46 -07:00
Kristian Høgsberg
453de7a7e5 compositor-wayland: Handle HUP or ERR from event loop
Otherwise we end up in a busy loop instead of exiting nicely.
2013-10-30 23:15:44 -07:00
Kristian Høgsberg
a28ba55b56 launcher: Make sure we drop drm master before we allow VT switches
On shutdown, we can risk having a pending vt switch that we normally
handle in the vt signal handler.  However as we put the vt back in VT_AUTO
mode, the pending VT switch will go through and if we haven't dropped
drm master at that point, we could switch to another display server
without dropping drm master.  That will typically crash the other server,
so let's try to make sure we don't do that.

https://bugs.freedesktop.org/show_bug.cgi?id=70877
2013-10-30 16:27:16 -07:00
Kristian Høgsberg
aa2ee8bdf6 shell: Create view for lock surface
Nothing created the view for the lock surface and weston would crash
when trying to display it.

https://bugs.freedesktop.org/show_bug.cgi?id=70873
2013-10-30 15:49:45 -07:00
Kristian Høgsberg
529a81a898 logind: Return proper error value when tty or seat doesn't match
If the seat or tty doesn't match we return with r == 0, which looks like
success to weston_launcher_connect(), which then fails to fall back
to the legacy path.

https://bugs.freedesktop.org/show_bug.cgi?id=70876
2013-10-30 13:53:01 -07:00
Kristian Høgsberg
90dfb11428 animation.c: Schedule a repaint when the animation is done
Otherwise we don't repaint with the final state of the surface and
we're stuck with the second-to-last frame of the animation until
something else (moving the mouse or such) triggers a redraw.

https://bugs.freedesktop.org/show_bug.cgi?id=70930
2013-10-30 09:07:04 -07:00
Kristian Høgsberg
912e0a117a Fall back to ANIMATION_NONE if startup-animation is zoom
get_animation_type() parses "none", "zoom" and "fade" but for the
startup animation, we only support "none" and "fade".  If we get "zoom"
just fall back to "none" like we do for all unrecognized strings.

https://bugs.freedesktop.org/show_bug.cgi?id=71006
2013-10-30 08:59:55 -07:00
Jason Ekstrand
4a7409a1f5 toytoolkit: Don't segfault on window close
Without this commit, the client will segmentation fault due to accessing
the frame after everything has been destroyed.
2013-10-30 08:40:24 -07:00
Kristian Høgsberg
8ae63851dd window.c: Don't ungrab input after displaying the menu
We used to ungrab first to stop any existing grab and then grab after
showing the menu. That was broken in c680e90489, which
moved the ungrab down below the grab, and as a result menus are now
shown without a grab.  This commit moves the grab back up.
2013-10-28 22:06:11 -07:00
Kristian Høgsberg
b27901c5a7 input.c: Rename default grab functions to be consistent
Jonas recent patches made the inconsistency obvious, this patch fixes it.
2013-10-28 15:32:02 -07:00
Jonas Ådahl
1ea343e1be Add cancel function to grab interfaces
A grab can potentially allocate memory and would normally end the grab
itself, freeing the allocated memory in the process. However at in some
situations the compositor may want to abort a grab. The grab owner still
needs to free some memory and abort the grab properly. To do this a new
function 'cancel' is introduced in all the grab interfaces instructing
the grabs owner to abort the grab.

This patch also hooks up grab cancelling to seat device releasing and
when the compositor looses focus, which would potentially leak memory
before.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-10-28 14:44:06 -07:00
Jonas Ådahl
1c6e63e880 shell: Don't leak weston_touch_move_grab structs
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-10-28 14:39:18 -07:00
Jonas Ådahl
b18018867b input: Remove unused variable
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-10-28 14:38:38 -07:00
Jonas Ådahl
b8e62d9cdb configure.ac: Report if built with XCB-XKB or not
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-10-28 14:38:31 -07:00
Jonas Ådahl
f88571fdef compositor-x11: Hide update_xkb_keymap behind #ifdef HAVE_XCB_XKB
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-10-28 14:38:27 -07:00
Jonas Ådahl
80511efe43 tests/.gitignore: Add *.trs
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-10-28 14:38:23 -07:00