[PATCH] Add minimum size for terminal

Stefan Risberg steffenomak at gmail.com
Mon Jun 18 16:09:10 PDT 2012


On Mon, Jun 18, 2012 at 08:59:26PM +0200, Alexander Preisinger wrote:
> At the moment the terminal can a negativ size and resizing it can create
> some artifacts.
> ---
>  clients/terminal.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/clients/terminal.c b/clients/terminal.c
> index 4308875..7e1c741 100644
> --- a/clients/terminal.c
> +++ b/clients/terminal.c
> @@ -772,6 +772,12 @@ resize_handler(struct widget *widget,
>  	struct terminal *terminal = data;
>  	int32_t columns, rows, m;
>  
> +    if (width < 200)
> +        width = 200;
> +
> +    if (height < 50)
> +        height = 50;
> +
>  	m = 2 * terminal->margin;
>  	columns = (width - m) / (int32_t) terminal->extents.max_x_advance;
>  	rows = (height - m) / (int32_t) terminal->extents.height;
> -- 
> 1.7.10.4
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel

I assume that 50 in height is the minimum to display one line in the terminal?


More information about the wayland-devel mailing list