Commit Graph

3735 Commits

Author SHA1 Message Date
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
Tomeu Vizoso
96dc9e4f1f rpi: Remove create_view and destroy_view implementations
And also remove the vfunc definitions from the compositor as they
are unused now.
2013-10-28 14:36:26 -07:00
Kristian Høgsberg
9b8e1b17fe configure.ac: Require wayland >= 1.3.91 2013-10-25 16:18:17 -07:00
Kristian Høgsberg
0eee0a28ba weston-launch: Revoke and close input fds when we vt switch away
We used to leak the input fds, as weston would reopen all fds on vt
enter.  We could just close them after sending the open fd through the
socket, but this patch also adds support for the new EVIOCREVOKE evdev
ioctl, that revokes the fd in question (including the copy that we
sent to the compositor).

https://bugs.freedesktop.org/show_bug.cgi?id=70849
2013-10-25 13:34:58 -07:00
Kristian Høgsberg
3742434cfd configure.ac: Require at least version 0.3.0 of xkbcommon
https://bugs.freedesktop.org/show_bug.cgi?id=70870
2013-10-25 12:49:00 -07:00
Kristian Høgsberg
5e392ef64e .gitignore: Add .valid files 2013-10-25 12:21:51 -07:00
Ander Conselvan de Oliveira
adda00e72f pixman-renderer, gl-renderer: Destroy surface state with the renderer
Previously the renderers destroy function assumed they are only called
when the compositor is shutting down and that the compositor had
already destroyed all the surfaces. However, if a runtime renderer
switch would be done, the surface state would be leaked.

This patch adds a destroy_signal to the pixman and gl renderers. The
surface state objects will listen for that signal and destroy
themselves if needed.

This is a step towards runtime switchable renderers.
2013-10-25 12:21:51 -07:00
Ander Conselvan de Oliveira
aa398ae1f3 compositor: Let renderers create and destroy surface state on their own
Remove create_surface() and destroy_surface() from the renderer
interface and change the renderers to create surface state on demand
and destroy it using the weston_surface's destroy signal.

Also make sure the surfaces' renderer state is reset to NULL on
destruction.

This is a step towards runtime switchable renderers.

(rpi-renderer changes are only compile-tested)
2013-10-25 12:21:51 -07:00
Ander Conselvan de Oliveira
6b16214fb9 pixman-renderer, gl-renderer: Destroy debug bindings on clean up
Also make sure backends destroy the renderers before shutting down the
compositor to avoid a double call to weston_binding_destroy().

This is a step towards making renderers switchable during runtime.
2013-10-25 12:17:51 -07:00
Ander Conselvan de Oliveira
c68b1085ed pixman-renderer: Initialize pixman-renderer struct with zeros
Othrewise a crash may happen because of an unitialized value of the
create_view field.
2013-10-25 11:09:10 -07:00