Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance

2022-03-30 Thread NRK
On Tue, Mar 29, 2022 at 07:33:27PM +0200, Quentin Rameau wrote: > > On Mon, Mar 28, 2022 at 05:57:48PM +0600, NRK wrote: > > > And on the topic of ellipsis_width, we currently don't account for > > > fallback font: > > > > > > usedfont = drw->fonts; > > > drw_font_getexts(usedfont, "...", 3, &

Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance

2022-03-29 Thread NRK
On Tue, Mar 29, 2022 at 05:18:12PM +0200, Stein Gunnar Bakkeby wrote: > For 0002 how about leaving the ellipsis_width as 0 and do this? > > if (!ellipsis_width && render) > ellipsis_width = drw_fontset_getwidth(drw, ellipsis); When invoked from drw_fontset_getwidth(), `render` wont be active,

Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance

2022-03-29 Thread Stein Gunnar Bakkeby
For 0002 how about leaving the ellipsis_width as 0 and do this? if (!ellipsis_width && render) ellipsis_width = drw_fontset_getwidth(drw, ellipsis); Moving the "..." to a static(?) const variable named ellipsis would make it easier to replace this with something else (like the ellipsis charac

Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance

2022-03-29 Thread NRK
On Tue, Mar 29, 2022 at 07:33:27PM +0200, Quentin Rameau wrote: > > @@ -283,7 +284,10 @@ drw_text(Drw *drw, int x, int y, unsigned int w, > > unsigned int h, unsigned int lp > > } > > > > usedfont = drw->fonts; > > - drw_font_getexts(usedfont, "...", 3, &ellipsis_width, NULL); > > +

Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance

2022-03-29 Thread Quentin Rameau
> On Mon, Mar 28, 2022 at 05:57:48PM +0600, NRK wrote: > > And on the topic of ellipsis_width, we currently don't account for > > fallback font: > > > > usedfont = drw->fonts; > > drw_font_getexts(usedfont, "...", 3, &ellipsis_width, NULL); > > > > The assumption here was that every font

Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance

2022-03-29 Thread NRK
On Mon, Mar 28, 2022 at 05:57:48PM +0600, NRK wrote: > And on the topic of ellipsis_width, we currently don't account for > fallback font: > > usedfont = drw->fonts; > drw_font_getexts(usedfont, "...", 3, &ellipsis_width, NULL); > > The assumption here was that every font should have

Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance

2022-03-28 Thread NRK
On Mon, Mar 28, 2022 at 10:01:10AM +0200, Stein Gunnar Bakkeby wrote: > That ellipsis_w guard makes sense to add. > > You are right in that it is simpler to call drw_text. If we make another > call to XftDrawStringUtf8 then we also need to recalculate ty. You'd also need to call XFillRectangle(..

Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance

2022-03-28 Thread Stein Gunnar Bakkeby
That ellipsis_w guard makes sense to add. You are right in that it is simpler to call drw_text. If we make another call to XftDrawStringUtf8 then we also need to recalculate ty. On Sun, Mar 27, 2022 at 8:52 PM NRK wrote: > On Sat, Mar 26, 2022 at 12:02:12AM +0100, Stein Gunnar Bakkeby wrote:

Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance

2022-03-27 Thread NRK
On Sat, Mar 26, 2022 at 12:02:12AM +0100, Stein Gunnar Bakkeby wrote: > for the first patch, what was the incentive for making a call to drw_text > to draw the ellipsis rather than making another call to XftDrawStringUtf8? Was simpler to just call drw_text. > As-is, and I am primarily thinking of

Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance

2022-03-27 Thread Stein Gunnar Bakkeby
Hi NRK, for the first patch, what was the incentive for making a call to drw_text to draw the ellipsis rather than making another call to XftDrawStringUtf8? As-is, and I am primarily thinking of the bar in dwm in this case, if you were to have limited space and there is only enough space to write

Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance

2022-03-25 Thread Hiltjo Posthuma
On Fri, Mar 25, 2022 at 03:34:29PM +0600, NRK wrote: > Hi, > > Fixed a couple bugs/issues with the previous patches and attached the > amended ones. I'm confident that these patches shouldn't have any > remaining logic issues, but feel free to point them out in case there is. > > Some notable cha

Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance

2022-03-25 Thread Quentin Rameau
> Hi, Hi NRK, > Fixed a couple bugs/issues with the previous patches and attached the > amended ones. I'm confident that these patches shouldn't have any > remaining logic issues, but feel free to point them out in case there is. > Additionally, there's one *new* patch attached, which fixes the