Commit Graph

3551 Commits

Author SHA1 Message Date
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
Tomeu Vizoso
7498758525 rpi: Protect in-use DispmanX resources from premature deletion
The compositor will check if the client destroyed the wl_buffer
while it was in use in a display update, and delete the resource
itself once the update has finished.
2013-10-25 11:05:45 -07:00
Tomeu Vizoso
34dad7d69b rpi: Remove dangling reference to weston_view
This also marks the rpir_view for destroy in rpi_renderer_finish_frame()
2013-10-25 11:05:03 -07:00
Tomeu Vizoso
e3df6f1bbc rpi: Only check for prematurely destroyed wl_buffers in the EGL case 2013-10-25 11:03:57 -07:00
Tomeu Vizoso
4424774782 rpi: EGL surfaces need to be swapped always that we have an incoming back buffer 2013-10-25 11:03:47 -07:00
Tomeu Vizoso
15767813c2 rpi: Fix logging of buffer swaps for the EGL case 2013-10-25 11:03:25 -07:00
Tomeu Vizoso
5c3ea3b71a rpi: Initialize surface's list of views 2013-10-25 11:03:18 -07:00
Tomeu Vizoso
1d7ad62768 rpi: Link with EGL if ENABLE_EGL 2013-10-25 11:03:06 -07:00
Peter Hutterer
64db37e53c protocol: hook up xmllint to check validity 2013-10-25 10:58:15 -07:00
Kristian Høgsberg
c85f1d4595 shell.c: Prevent moving a window from more than one source
It was possible to start a move or resize with a pointer and then
start another move for the same surface with touch or a pointer from
another seat, which would make the window flicker around.  With this
commit, we now reject any attempts to move or resize a surface that is
currently grabbed.
2013-10-24 16:52:00 -07:00
Kristian Høgsberg
0d94f41b44 shell.c: Don't overwrite focus surface argument in activate_binding()
We need either the pointer or touch focus, which is passed in to
activate_binding().  Don't overwrite this with the pointer focus.
2013-10-24 16:29:51 -07:00
Kristian Høgsberg
7ab139ce16 shell: Don't cast weston_view to surface when we just need view->surface
Most of the shell.c bindings take effect on the current pointer or
touch focus.  That's now a view, but we need a surface in these cases.
Just get the surface from view->surface instead of trying to cast a
view to a surface.
2013-10-24 16:21:39 -07:00
Kristian Høgsberg
aa2700dcc8 compositor: Remove two unused variables 2013-10-24 15:54:49 -07:00
Kristian Høgsberg
48588f8696 shell: Create a view for the grab_surface
Without the view, we can't set pointer and touch focus to the grab_surface
and touch moving fails.
2013-10-24 15:51:35 -07:00
Kristian Høgsberg
c3244d7abc input: Properly handle setting touch focus to NULL
This happens on TOUCH_UP, and we unconditionally dereference view->surface.
2013-10-24 14:21:53 -07:00
Kristian Høgsberg
b5a4f986d4 compositor-x11: Use the fullscreen size provided by the configure event
Make sure we initialize the x11 shm state using the right window size.

https://bugs.freedesktop.org/show_bug.cgi?id=70590
2013-10-23 23:38:50 -07:00
Kristian Høgsberg
a3a0e1867e shell: Add the right output object to the shell output_list
Error on my part while renaming the shell_output variable.
2013-10-23 23:36:04 -07:00
Xiong Zhang
6b48142f8a shell: register output->destroy_signal handler
setup_output_destroy_handler() deal with output created at
drm backend initialize time.
handle_output_create() deal with output created by hot plug handler
output_destroy_handler is removed when output was unplugged or
shell is destroyed.

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
2013-10-23 23:17:15 -07:00
Xiong Zhang
83d8ee779e window, desktop-shell: deal with output unplug on client side
when output is removed, weston-desktop-shell should destroy panel
and background surface on destroyed output.

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
2013-10-23 22:36:37 -07:00
Xiong Zhang
971165368d compositor: set surface->plane from destroyed plane to NULL
In drm backend, the cursor_surface->plane point to
drm_output->cursor_plane.when this output is removed,
drm_output->cursor_plane is destroyed, butcursor_surface->plane
still point to destroyed plane. So once mouse move to this
cursor_surface and system will repaint this cursor_surface,
segment fault will generate in weston_surface_damage_below() function.

V2:
-set surface->plane to NULL whose plane point to unplugged output,
 then change weston_surface_damage_below() to do nothing if
 surface->plane is NULL (Kristian)
-set surface->plane to NULL in weston_surface_unmap(),
 so that all surfaces that have a non-NULL plane pointer wil be
 on compositor->surface_list (Kristian).

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

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
2013-10-23 22:23:28 -07:00
Kristian Høgsberg
89f4bc4fc4 window.c: Don't put titlebars on menu windows 2013-10-23 22:12:13 -07:00
Kristian Høgsberg
c680e90489 window.c: Use frame code for drawing menus
This gives us a nice frame and drop shadows for the menus.
2013-10-23 21:49:30 -07:00
Kristian Høgsberg
a83be20d7f terminal: Show character grid size in header bar when resizing
We don't have a reliable way to know when to clear this indicator.
Typically the pointer will still be over the window when the resize is
done and we'll get an enter event, but if the window sets a max size
the pointer may be over another window when the resize is done.

We'll need a new wl_shell (or more likely xdg_shell) event for this.
2013-10-23 20:47:35 -07:00
Kristian Høgsberg
67b8215bcb terminal: Add context menu with new terminal/copy/paste 2013-10-23 16:52:05 -07:00
Kristian Høgsberg
14f39b290b terminal: Add scroll-back history
Ctrl-Shift-UP/DOWN to scroll through the history.
2013-10-23 16:29:14 -07:00
Kristian Høgsberg
5d380c3c5f configure.ac: Bump version to 1.3.90 for the master branch 2013-10-23 09:30:48 -07:00
Rui Matos
3eccb8658d clients/window: Dispose of previous keymap and state on keymap change 2013-10-22 15:25:04 -07:00
Rui Matos
0c194ced57 compositor-wayland: Handle keymap changes 2013-10-22 15:25:01 -07:00
Rui Matos
c6c2f8e655 compositor-x11: Update keymap when XKB keymap changes 2013-10-22 15:24:58 -07:00
Rui Matos
65196bc0b9 input: Add core API to update the keymap
How and when to update the keymap is left to each backend.

The new keymap only becomes effective when no keys are pressed and we
keep latched and locked modifiers from the previous state.
2013-10-22 15:24:55 -07:00
Jason Ekstrand
a7af70436b Split the geometry information from weston_surface out into weston_view
The weston_surface structure is split into two structures:

 * The weston_surface structure storres everything required for a
   client-side or server-side surface.  This includes buffers; callbacks;
   backend private data; input, damage, and opaque regions; and a few other
   bookkeeping bits.

 * The weston_view structure represents an entity in the scenegraph and
   storres all of the geometry information.  This includes clip region,
   alpha, position, and the transformation list as well as all of the
   temporary information derived from the geometry state.  Because a view,
   and not a surface, is a scenegraph element, the view is what is placed
   in layers and planes.

There are a few things worth noting about the surface/view split:

 1. This is *not* a modification to the protocol.  It is, instead, a
    modification to Weston's internal scenegraph to allow a single surface
    to exist in multiple places at a time.  Clients are completely unaware
    of how many views to a particular surface exist.

 2. A view is considered a direct child of a surface and is destroyed when
    the surface is destroyed.  Because of this, the view.surface pointer is
    always valid and non-null.

 3. The compositor's surface_list is replaced with a view_list.  Due to
    subsurfaces, building the view list is a little more complicated than
    it used to be and involves building a tree of views on the fly whenever
    subsurfaces are used.  However, this means that backends can remain
    completely subsurface-agnostic.

 4. Surfaces and views both keep track of which outputs they are on.

 5. The weston_surface structure now has width and height fields.  These
    are populated when a new buffer is attached before surface.configure
    is called.  This is because there are many surface-based operations
    that really require the width and height and digging through the views
    didn't work well.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-10-22 13:34:11 -07:00
Kristian Høgsberg
d4c1cd77c3 logind: Remove missing 'else'
Only fall through to cleaning up weston-launch or standalone state
if we didn't use logind.
2013-10-22 13:19:23 -07:00
Kristian Høgsberg
10ddd97ecf compositor: Remove redundant and not well-defined focus field
It was never clear what this field really did.
2013-10-22 12:40:54 -07:00
Kristian Høgsberg
2e611264a3 compositor-drm: Don't call drop/set master anymore
This is done by either laucnher-util.c directly, weston-launch or
logind, depending on how we're launched.
2013-10-22 12:27:46 -07:00
David Herrmann
1edf44ce26 compositor: finish frame if redraw fails
If we are about to finish a frame, but a redraw is pending and we let the
compositor redraw, we need to check for errors. If the redraw fails and
the backend cannot schedule a page-flip, we need to finish the frame,
anyway.

All backends except DRM use a timer to schedule frames. Hence, they cannot
fail. But for DRM, we need to be able to handle drmModePageFlip() failures
in case access got revoked.

This fixes a bug where logind+drm caused keyboard input to be missed as we
didn't reenable it after a failed page-flip during deactivation.
2013-10-22 12:24:56 -07:00