[hackers] Re: [st][PATCH] Set minimum window size to avoid crash when resizing out of bounds
Whoops, my git-email messed up when trying to resend the patch. Apologies 2018-05-18 0:02 GMT+02:00 Michael Buch : > The terminal window is created without lower/upper bounds > for window width/height. On resizing the terminal to a size > of 1x1 or below we crash. This patch sets the minimum > window height and width to prevent resizing past this size > and handling the scenario similar to other terminals. > --- > x.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/x.c b/x.c > index c0bd890..00ea444 100644 > --- a/x.c > +++ b/x.c > @@ -788,15 +788,17 @@ xhints(void) > > sizeh = XAllocSizeHints(); > > - sizeh->flags = PSize | PResizeInc | PBaseSize; > + sizeh->flags = PSize | PResizeInc | PBaseSize | PMinSize; > sizeh->height = win.h; > sizeh->width = win.w; > sizeh->height_inc = win.ch; > sizeh->width_inc = win.cw; > sizeh->base_height = 2 * borderpx; > sizeh->base_width = 2 * borderpx; > + sizeh->min_height = 2 * win.ch; > + sizeh->min_width = 2 * win.cw; > if (xw.isfixed) { > - sizeh->flags |= PMaxSize | PMinSize; > + sizeh->flags |= PMaxSize; > sizeh->min_width = sizeh->max_width = win.w; > sizeh->min_height = sizeh->max_height = win.h; > } > -- > 2.17.0 > >
[hackers] Re: [st][PATCH] Set minimum window size to avoid crash when resizing out of bounds
Nvm, that's the correct patch. Got confused by it auto-replying to the thread... 2018-05-18 0:03 GMT+02:00 Michael Buch : > Whoops, my git-email messed up when trying to resend the patch. > > Apologies > > 2018-05-18 0:02 GMT+02:00 Michael Buch : > >> The terminal window is created without lower/upper bounds >> for window width/height. On resizing the terminal to a size >> of 1x1 or below we crash. This patch sets the minimum >> window height and width to prevent resizing past this size >> and handling the scenario similar to other terminals. >> --- >> x.c | 6 -- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/x.c b/x.c >> index c0bd890..00ea444 100644 >> --- a/x.c >> +++ b/x.c >> @@ -788,15 +788,17 @@ xhints(void) >> >> sizeh = XAllocSizeHints(); >> >> - sizeh->flags = PSize | PResizeInc | PBaseSize; >> + sizeh->flags = PSize | PResizeInc | PBaseSize | PMinSize; >> sizeh->height = win.h; >> sizeh->width = win.w; >> sizeh->height_inc = win.ch; >> sizeh->width_inc = win.cw; >> sizeh->base_height = 2 * borderpx; >> sizeh->base_width = 2 * borderpx; >> + sizeh->min_height = 2 * win.ch; >> + sizeh->min_width = 2 * win.cw; >> if (xw.isfixed) { >> - sizeh->flags |= PMaxSize | PMinSize; >> + sizeh->flags |= PMaxSize; >> sizeh->min_width = sizeh->max_width = win.w; >> sizeh->min_height = sizeh->max_height = win.h; >> } >> -- >> 2.17.0 >> >> >
Re: [hackers] Re: [st][PATCH] Set minimum window size to avoid crash when resizing out of bounds
On Fri, May 18, 2018 at 12:12:32AM +0200, Michael Buch wrote: > Nvm, that's the correct patch. Got confused by it auto-replying to the > thread... It didn't at least as far as Mutt is concerned. Are you using the Gmail web UI? I think the Gmail web UI will treat emails with the same title as part of the same thread even if the In-Reply-To or References fields don't mention the Message-ID of an earlier email. Eric
Re: [hackers] Re: [st][PATCH] Set minimum window size to avoid crash when resizing out of bounds
On Thu, May 17, 2018 at 03:28:06PM -0700, Eric Pruitt wrote: > It didn't at least as far as Mutt is concerned. Are you using the Gmail > web UI? I think the Gmail web UI will treat emails with the same title > as part of the same thread even if the In-Reply-To or References fields > don't mention the Message-ID of an earlier email. Yes, Gmail has the annoying trait that it basically ignores those header fields and instead threads based on how close email Subjects are; e.g. something like "Foo" and "Re: Foo" are threaded but "[PATCH 1/2] Foo" and "[PATCH 2/2] Foo" aren't. It gets fairly annoying when I read LKML with the Gmail WebUI. -- Cheers, Joey Pabalinas signature.asc Description: PGP signature