Commit Graph

3759 Commits

Author SHA1 Message Date
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
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