[PATCH weston] terminal: Handle the window close event.

Kristian Høgsberg hoegsberg at gmail.com
Mon Jan 28 09:29:03 PST 2013


On Mon, Jan 28, 2013 at 01:11:06AM -0800, Dima Ryazanov wrote:
> There may be multiple windows open, so destroy the terminal instead of exiting.

Thanks, good fix, committed.  Just a stylistic nitpick: we treat
commit subjects as headers wrt to punctuation (eg like a newspaper
headline) so they don't end in '.'.

Kristian

> Signed-off-by: Dima Ryazanov <dima at gmail.com>
> ---
>  clients/terminal.c |    9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/clients/terminal.c b/clients/terminal.c
> index 25acc81..664df5d 100644
> --- a/clients/terminal.c
> +++ b/clients/terminal.c
> @@ -2069,6 +2069,14 @@ fullscreen_handler(struct window *window, void *data)
>  	window_set_fullscreen(window, !window_is_fullscreen(terminal->window));
>  }
>  
> +static void
> +close_handler(struct window *window, void *data)
> +{
> +	struct terminal *terminal = data;
> +
> +	terminal_destroy(terminal);
> +}
> +
>  static int
>  handle_bound_key(struct terminal *terminal,
>  		 struct input *input, uint32_t sym, uint32_t time)
> @@ -2541,6 +2549,7 @@ terminal_create(struct display *display)
>  	window_set_keyboard_focus_handler(terminal->window,
>  					  keyboard_focus_handler);
>  	window_set_fullscreen_handler(terminal->window, fullscreen_handler);
> +	window_set_close_handler(terminal->window, close_handler);
>  
>  	widget_set_redraw_handler(terminal->widget, redraw_handler);
>  	widget_set_resize_handler(terminal->widget, resize_handler);
> -- 
> 1.7.10.4
> 
> _______________________________________________
> 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