[PATCH weston 2/3] compositor: Add kill signal

Kristian Høgsberg hoegsberg at gmail.com
Thu Oct 4 08:07:04 PDT 2012


On Thu, Sep 27, 2012 at 05:48:36PM +0300, Tiago Vignatti wrote:
> For now it's being emitted only on the desktop shell kill binding.

Ok, let's go with this approach.

Kristian

> Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
> ---
>  src/compositor.c |    1 +
>  src/compositor.h |    1 +
>  src/shell.c      |    4 ++++
>  3 files changed, 6 insertions(+)
> 
> diff --git a/src/compositor.c b/src/compositor.c
> index 417c508..95ee258 100644
> --- a/src/compositor.c
> +++ b/src/compositor.c
> @@ -2737,6 +2737,7 @@ weston_compositor_init(struct weston_compositor *ec,
>  	ec->wl_display = display;
>  	wl_signal_init(&ec->destroy_signal);
>  	wl_signal_init(&ec->activate_signal);
> +	wl_signal_init(&ec->kill_signal);
>  	wl_signal_init(&ec->lock_signal);
>  	wl_signal_init(&ec->unlock_signal);
>  	wl_signal_init(&ec->show_input_panel_signal);
> diff --git a/src/compositor.h b/src/compositor.h
> index aea4f8d..bde4772 100644
> --- a/src/compositor.h
> +++ b/src/compositor.h
> @@ -294,6 +294,7 @@ struct weston_compositor {
>  	struct weston_shell_interface shell_interface;
>  
>  	struct wl_signal activate_signal;
> +	struct wl_signal kill_signal;
>  	struct wl_signal lock_signal;
>  	struct wl_signal unlock_signal;
>  
> diff --git a/src/shell.c b/src/shell.c
> index 789fc36..3bf6e80 100644
> --- a/src/shell.c
> +++ b/src/shell.c
> @@ -3505,12 +3505,16 @@ force_kill_binding(struct wl_seat *seat, uint32_t time, uint32_t key,
>  {
>  	struct wl_surface *focus_surface;
>  	struct wl_client *client;
> +	struct desktop_shell *shell = data;
> +	struct weston_compositor *compositor = shell->compositor;
>  	pid_t pid;
>  
>  	focus_surface = seat->keyboard->focus;
>  	if (!focus_surface)
>  		return;
>  
> +	wl_signal_emit(&compositor->kill_signal, focus_surface);
> +
>  	client = focus_surface->resource.client;
>  	wl_client_get_credentials(client, &pid, NULL, NULL);
>  
> -- 
> 1.7.9.5
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list