unsuscribe On Sat, Nov 26, 2016 at 12:00 AM <hackers+h...@suckless.org> wrote:
> Topics (messages 10860 through 10886): > > [hackers] [slock] clarify colors in config.def.h || Markus Teich > 10860 - g...@suckless.org > > [hackers] [slock] move config.h inclusion after type declarations || > Markus Teich > 10861 - g...@suckless.org > > [hackers] [slock] add arg.h and util.h to Makefile || Markus Teich > 10862 - g...@suckless.org > > [hackers] [slock] bump version || Markus Teich > 10863 - g...@suckless.org > > [hackers] [slock][PATCH] Fix resize with multiple monitors and portrait > mode > 10864 - Bob Uhl <b...@zvelo.com> > > [hackers] [slock][PATCH] Fix resize with multiple monitors and portrait > mode > 10865 - Markus Teich <markus.te...@stusta.mhn.de> > > [hackers] [slock][PATCH] Fix resize with multiple monitors and portrait > mode > 10866 - Bob Uhl <b...@zvelo.com> > > [hackers] [slock][PATCH] Fix resize with multiple monitors and portrait > mode > 10867 - Laslo Hunhold <d...@frign.de> > > [hackers] [slock] Fix resize with multiple monitors and portrait mode || > Bob Uhl > 10868 - g...@suckless.org > > [hackers] [slock] there can only be one window in the event || Markus Teich > 10869 - g...@suckless.org > > [hackers] [slock] syntax fix || Markus Teich > 10870 - g...@suckless.org > > [hackers] [slock] rm trailing whitespace in README || Markus Teich > 10871 - g...@suckless.org > > [hackers] [slock][PATCH] Fix resize with multiple monitors and portrait > mode > 10872 - Markus Teich <markus.te...@stusta.mhn.de> > > [hackers] [slock][PATCH] Fix resize with multiple monitors and portrait > mode > 10873 - Bob Uhl <b...@zvelo.com> > > [hackers] [slock][PATCH] Fix resize with multiple monitors and portrait > mode > 10874 - Markus Teich <markus.te...@stusta.mhn.de> > > [hackers] [st][PATCH] Fixed 'missing glyph doesn't use fontconfig config > substitutions' bug > 10875 - spencer.phip...@gmail.com > > [hackers] [st][PATCH] Fixed 'missing glyph doesn't use fontconfig config > substitutions' bug > 10876 - k...@shike2.com > > [hackers] [st][PATCH] Fixed 'missing glyph doesn't use fontconfig config > substitutions' bug > 10877 - Ian Remmler <i...@remmler.org> > > [hackers] [st] Fixed 'missing glyph doesn't use fontconfig config > substitutions' bug || Spencer Phippen > 10878 - g...@suckless.org > > [hackers] [st] Revert "Initial font size issue." || Roberto E. Vargas > Caballero > 10879 - g...@suckless.org > > [hackers] [st][PATCH] Fixed 'missing glyph doesn't use > 10880 - k...@shike2.com > > [hackers] [PATCH][dmenu] Xinerama: correct variable declarations in > preprocessor conditional > 10881 - Thomas Gardner <t...@fastmail.com> > > [hackers] [PATCH][dmenu] Xinerama: correct variable declarations in > preprocessor conditional > 10882 - Quentin Rameau <quinq@fifth.space> > > [hackers] [dmenu] [PATCH v2] Xinerama: correct variable declarations in > preprocessor conditional > 10883 - Thomas Gardner <t...@fastmail.com> > > [hackers] [dmenu] [PATCH v2] Xinerama: correct variable declarations in > preprocessor conditional > 10884 - Quentin Rameau <quinq@fifth.space> > > [hackers] [dmenu] Xinerama: correct variable declarations in preprocessor > conditional || Thomas Gardner > 10885 - g...@suckless.org > > [hackers] [dmenu] [PATCH v2] Xinerama: correct variable declarations in > preprocessor conditional > 10886 - Hiltjo Posthuma <hil...@codemadness.org> > > > > > > ---------- Forwarded message ---------- > From: g...@suckless.org > To: <hackers@suckless.org> > Cc: > Date: Sun, 20 Nov 2016 01:04:19 +0100 (CET) > Subject: [hackers] [slock] clarify colors in config.def.h || Markus Teich > commit ae96836f90c3652fd0907e0632ddd4591d5716fa > Author: Markus Teich <markus.te...@stusta.mhn.de> > AuthorDate: Sun Nov 20 00:29:41 2016 +0100 > Commit: Markus Teich <markus.te...@stusta.mhn.de> > CommitDate: Sun Nov 20 00:29:41 2016 +0100 > > clarify colors in config.def.h > > diff --git a/config.def.h b/config.def.h > index 6fba2b6..9855e21 100644 > --- a/config.def.h > +++ b/config.def.h > @@ -3,10 +3,10 @@ static const char *user = "nobody"; > static const char *group = "nogroup"; > > static const char *colorname[NUMCOLS] = { > - "black", /* after initialization */ > - "#005577", /* during input */ > - "#CC3333", /* wrong password */ > + [INIT] = "black", /* after initialization */ > + [INPUT] = "#005577", /* during input */ > + [FAILED] = "#CC3333", /* wrong password */ > }; > > -/* treat a cleared input like a wrong password */ > +/* treat a cleared input like a wrong password (color) */ > static const int failonclear = 1; > > > > ---------- Forwarded message ---------- > From: g...@suckless.org > To: <hackers@suckless.org> > Cc: > Date: Sun, 20 Nov 2016 01:04:19 +0100 (CET) > Subject: [hackers] [slock] move config.h inclusion after type declarations > || Markus Teich > commit 7d31ff65a0b0388f788ca6932c815ab29e5fb10f > Author: Markus Teich <markus.te...@stusta.mhn.de> > AuthorDate: Sun Nov 20 00:29:01 2016 +0100 > Commit: Markus Teich <markus.te...@stusta.mhn.de> > CommitDate: Sun Nov 20 00:29:01 2016 +0100 > > move config.h inclusion after type declarations > > diff --git a/slock.c b/slock.c > index ad539dc..d2f0886 100644 > --- a/slock.c > +++ b/slock.c > @@ -31,8 +31,6 @@ enum { > NUMCOLS > }; > > -#include "config.h" > - > struct lock { > int screen; > Window root, win; > @@ -46,6 +44,8 @@ struct xrandr { > int errbase; > }; > > +#include "config.h" > + > static void > die(const char *errstr, ...) > { > > > > ---------- Forwarded message ---------- > From: g...@suckless.org > To: <hackers@suckless.org> > Cc: > Date: Sun, 20 Nov 2016 01:04:19 +0100 (CET) > Subject: [hackers] [slock] add arg.h and util.h to Makefile || Markus Teich > commit d5da84cf5adce2f30ed348b631861cc089f3b559 > Author: Markus Teich <markus.te...@stusta.mhn.de> > AuthorDate: Sun Nov 20 00:59:19 2016 +0100 > Commit: Markus Teich <markus.te...@stusta.mhn.de> > CommitDate: Sun Nov 20 01:01:47 2016 +0100 > > add arg.h and util.h to Makefile > > diff --git a/Makefile b/Makefile > index 8b3e248..f4ffbb7 100644 > --- a/Makefile > +++ b/Makefile > @@ -18,7 +18,7 @@ options: > @echo CC $< > @${CC} -c ${CFLAGS} $< > > -${OBJ}: config.h config.mk > +${OBJ}: config.h config.mk arg.h util.h > > config.h: > @echo creating $@ from config.def.h > @@ -35,8 +35,8 @@ clean: > dist: clean > @echo creating dist tarball > @mkdir -p slock-${VERSION} > - @cp -R LICENSE Makefile README config.def.h config.mk ${SRC} \ > - explicit_bzero.c slock.1 slock-${VERSION} > + @cp -R LICENSE Makefile README slock.1 config.mk \ > + ${SRC} explicit_bzero.c config.def.h arg.h util.h > slock-${VERSION} > @tar -cf slock-${VERSION}.tar slock-${VERSION} > @gzip slock-${VERSION}.tar > @rm -rf slock-${VERSION} > > > > ---------- Forwarded message ---------- > From: g...@suckless.org > To: <hackers@suckless.org> > Cc: > Date: Sun, 20 Nov 2016 01:47:47 +0100 (CET) > Subject: [hackers] [slock] bump version || Markus Teich > commit fa1158958466f38cd35c9114023a0175e67ebb6f > Author: Markus Teich <markus.te...@stusta.mhn.de> > AuthorDate: Sun Nov 20 01:07:11 2016 +0100 > Commit: Markus Teich <markus.te...@stusta.mhn.de> > CommitDate: Sun Nov 20 01:07:11 2016 +0100 > > bump version > > diff --git a/config.mk b/config.mk > index 199bf7f..74429ae 100644 > --- a/config.mk > +++ b/config.mk > @@ -1,5 +1,5 @@ > # slock version > -VERSION = 1.3 > +VERSION = 1.4 > > # Customize below to fit your system > > > > > ---------- Forwarded message ---------- > From: Bob Uhl <b...@zvelo.com> > To: hackers mail list <hackers@suckless.org> > Cc: > Date: Tue, 22 Nov 2016 11:24:13 -0700 > Subject: Re: [hackers] [slock][PATCH] Fix resize with multiple monitors > and portrait mode > Markus Teich <markus.te...@stusta.mhn.de> writes: > > > >> When connecting/disconnecting a portrait monitor, the > >> XRRScreenChangeNotifyEvent height & width are reversed due to the XRandR > >> rotation; detect this and DTRT. > > > > I cannot reproduce your issue. I have a script which switches to my > > dock-connected display when I dock my laptop and added a "--rotate left" > to the > > xrandr command, but slock still covers the whole screen correctly > without your > > patch. > > (sorry for the delay; I've been out of the office) > > Did you try connecting/disconnecting the monitor? > > To give an idea of how my desktop is arranged, here's a screenshot of > the whole thing: <https://i.imgsafe.org/489c1a5249.png>. The external > portrait monitor is the left-hand screen, and the laptop monitor is the > right-hand screen. > > In case it helps in reproducing the issue, here's my xrandr command > line: > > xrandr --output HDMI1 --mode 2560x1440 --pos 0x0 --rotate left \ > --output eDP1 --mode 1366x768 --pos 1440x664 --rotate normal \ > --output VGA1 --off > > And here's a screenshot of the effect when slock is invoked, and I then > disconnect the external screen: <https://i.imgsafe.org/48a1aab15a.png>. > As you can see, the right hand of the screen is not covered by slock. > > I did some experimentation, and found that the height and width are > switched when the screen is rotated. A few printf statements revealed > that was indeed the case. > > A similar patch for a different project is found at: > > https://bugs.freedesktop.org/attachment.cgi?id=2994&action=edit > > Bob Uhl > > > > ---------- Forwarded message ---------- > From: Markus Teich <markus.te...@stusta.mhn.de> > To: hackers@suckless.org > Cc: > Date: Tue, 22 Nov 2016 22:22:31 +0100 > Subject: Re: [hackers] [slock][PATCH] Fix resize with multiple monitors > and portrait mode > Bob Uhl wrote: > > A similar patch for a different project is found at: > > > > https://bugs.freedesktop.org/attachment.cgi?id=2994&action=edit > > Heyho Bob, > > which version of slock are you using? Please try the latest one. slock-1.4 > was > just released a few days ago. Build it from source if your distribution > doesn't > have a package for it yet. If the bug persists, what versions of the X > server > and Xrandr extension are you running? > > --Markus > > > > ---------- Forwarded message ---------- > From: Bob Uhl <b...@zvelo.com> > To: hackers mail list <hackers@suckless.org> > Cc: > Date: Tue, 22 Nov 2016 14:54:19 -0700 > Subject: Re: [hackers] [slock][PATCH] Fix resize with multiple monitors > and portrait mode > Markus Teich <markus.te...@stusta.mhn.de> writes: > > > > which version of slock are you using? Please try the latest > > one. slock-1.4 was just released a few days ago. Build it from source > > if your distribution doesn't have a package for it yet. If the bug > > persists, what versions of the X server and Xrandr extension are you > > running? > > I built slock from 1.4, with the same desktop-revealing result. This is > on Xorg 1.16.4, which supports RandR 1.4. > > I merged my patch into 1.4; it fixes the issue. > > The RandR protocol documentation at > <https://www.x.org/releases/X11R7.5/doc/randrproto/randrproto.txt> > indicates under 'RRScreenChangeNotify' (just before section 8.1): > > Note that the sizes in this event reflect the new SCREENSIZE and > thus will appear rotated by the 'rotation' parameter from the sizes > of the screen itself. In other words, when rotation is 90 or 270, > widthInPixels in this event will be the same as the height value > from a ConfigureNotify that reflects the same size change. This > will probably confuse developers. > > I suspect that it's only accidentally working for some folks with > portrait screens. > > Bob > > > > ---------- Forwarded message ---------- > From: Laslo Hunhold <d...@frign.de> > To: hackers@suckless.org > Cc: > Date: Tue, 22 Nov 2016 22:57:22 +0100 > Subject: Re: [hackers] [slock][PATCH] Fix resize with multiple monitors > and portrait mode > On Tue, 22 Nov 2016 14:54:19 -0700 > Bob Uhl <b...@zvelo.com> wrote: > > Hey Bob, > > > I built slock from 1.4, with the same desktop-revealing result. This > > is on Xorg 1.16.4, which supports RandR 1.4. > > > > I merged my patch into 1.4; it fixes the issue. > > > > The RandR protocol documentation at > > <https://www.x.org/releases/X11R7.5/doc/randrproto/randrproto.txt> > > indicates under 'RRScreenChangeNotify' (just before section 8.1): > > > > Note that the sizes in this event reflect the new SCREENSIZE and > > thus will appear rotated by the 'rotation' parameter from the > > sizes of the screen itself. In other words, when rotation is 90 or > > 270, widthInPixels in this event will be the same as the height value > > from a ConfigureNotify that reflects the same size change. > > This will probably confuse developers. > > > > I suspect that it's only accidentally working for some folks with > > portrait screens. > > I second this. @Markus: I totally forgot about this patch, but it is > definitely valid and should be merged. > > Cheers > > Laslo > > -- > Laslo Hunhold <d...@frign.de> > > > > ---------- Forwarded message ---------- > From: g...@suckless.org > To: <hackers@suckless.org> > Cc: > Date: Wed, 23 Nov 2016 00:30:02 +0100 (CET) > Subject: [hackers] [slock] Fix resize with multiple monitors and portrait > mode || Bob Uhl > commit 7a604ec1fae1eda36f210a28a2cf466583a9cb87 > Author: Bob Uhl <b...@zvelo.com> > AuthorDate: Mon Nov 7 10:15:20 2016 -0700 > Commit: Markus Teich <tei...@fs.tum.de> > CommitDate: Wed Nov 23 00:26:51 2016 +0100 > > Fix resize with multiple monitors and portrait mode > > When connecting/disconnecting a portrait monitor, the > XRRScreenChangeNotifyEvent height & width are reversed due to the > XRandR > rotation; detect this and DTRT. > > diff --git a/slock.c b/slock.c > index d2f0886..61fe9ee 100644 > --- a/slock.c > +++ b/slock.c > @@ -201,8 +201,13 @@ readpw(Display *dpy, struct xrandr *rr, struct lock > **locks, int nscreens, > rre = (XRRScreenChangeNotifyEvent*)&ev; > for (screen = 0; screen < nscreens; screen++) { > if (locks[screen]->win == rre->window) { > - XResizeWindow(dpy, > locks[screen]->win, > - rre->width, > rre->height); > + if (rre->rotation == RR_Rotate_90 > || > + rre->rotation == RR_Rotate_270) > + XResizeWindow(dpy, > locks[screen]->win, > + rre->height, > rre->width); > + else > + XResizeWindow(dpy, > locks[screen]->win, > + rre->width, > rre->height); > XClearWindow(dpy, > locks[screen]->win); > } > } > > > > ---------- Forwarded message ---------- > From: g...@suckless.org > To: <hackers@suckless.org> > Cc: > Date: Wed, 23 Nov 2016 00:30:02 +0100 (CET) > Subject: [hackers] [slock] there can only be one window in the event || > Markus Teich > commit 0ff0d9f7a7156a0e0b41d5b208ae5625e3a15dab > Author: Markus Teich <tei...@fs.tum.de> > AuthorDate: Wed Nov 23 00:28:25 2016 +0100 > Commit: Markus Teich <tei...@fs.tum.de> > CommitDate: Wed Nov 23 00:28:25 2016 +0100 > > there can only be one window in the event > > diff --git a/slock.c b/slock.c > index 61fe9ee..700acfb 100644 > --- a/slock.c > +++ b/slock.c > @@ -209,6 +209,7 @@ readpw(Display *dpy, struct xrandr *rr, struct lock > **locks, int nscreens, > XResizeWindow(dpy, > locks[screen]->win, > rre->width, > rre->height); > XClearWindow(dpy, > locks[screen]->win); > + break; > } > } > } else for (screen = 0; screen < nscreens; screen++) > > > > ---------- Forwarded message ---------- > From: g...@suckless.org > To: <hackers@suckless.org> > Cc: > Date: Wed, 23 Nov 2016 00:30:02 +0100 (CET) > Subject: [hackers] [slock] syntax fix || Markus Teich > commit 325581b935c74c321062d1f6873704411bcc5071 > Author: Markus Teich <tei...@fs.tum.de> > AuthorDate: Wed Nov 23 00:28:43 2016 +0100 > Commit: Markus Teich <tei...@fs.tum.de> > CommitDate: Wed Nov 23 00:28:43 2016 +0100 > > syntax fix > > diff --git a/slock.c b/slock.c > index 700acfb..d55eb3d 100644 > --- a/slock.c > +++ b/slock.c > @@ -212,8 +212,10 @@ readpw(Display *dpy, struct xrandr *rr, struct lock > **locks, int nscreens, > break; > } > } > - } else for (screen = 0; screen < nscreens; screen++) > - XRaiseWindow(dpy, locks[screen]->win); > + } else { > + for (screen = 0; screen < nscreens; screen++) > + XRaiseWindow(dpy, locks[screen]->win); > + } > } > } > > > > > ---------- Forwarded message ---------- > From: g...@suckless.org > To: <hackers@suckless.org> > Cc: > Date: Wed, 23 Nov 2016 00:30:02 +0100 (CET) > Subject: [hackers] [slock] rm trailing whitespace in README || Markus Teich > commit 2d2a21a90ad1b53594b1b90b97486189ec54afce > Author: Markus Teich <tei...@fs.tum.de> > AuthorDate: Wed Nov 23 00:29:18 2016 +0100 > Commit: Markus Teich <tei...@fs.tum.de> > CommitDate: Wed Nov 23 00:29:18 2016 +0100 > > rm trailing whitespace in README > > diff --git a/README b/README > index a81290d..dcacd01 100644 > --- a/README > +++ b/README > @@ -1,6 +1,6 @@ > slock - simple screen locker > ============================ > -simple screen locker utility for X. > +simple screen locker utility for X. > > > Requirements > > > > ---------- Forwarded message ---------- > From: Markus Teich <markus.te...@stusta.mhn.de> > To: hackers@suckless.org > Cc: > Date: Wed, 23 Nov 2016 00:32:51 +0100 > Subject: Re: [hackers] [slock][PATCH] Fix resize with multiple monitors > and portrait mode > Bob Uhl wrote: > > I built slock from 1.4, with the same desktop-revealing result. This is > on > > Xorg 1.16.4, which supports RandR 1.4. > > > > I merged my patch into 1.4; it fixes the issue. > > > > The RandR protocol documentation at > > <https://www.x.org/releases/X11R7.5/doc/randrproto/randrproto.txt> > indicates > > under 'RRScreenChangeNotify' (just before section 8.1): > > > > Note that the sizes in this event reflect the new SCREENSIZE and thus > will > > appear rotated by the 'rotation' parameter from the sizes of the screen > > itself. In other words, when rotation is 90 or 270, widthInPixels in > this > > event will be the same as the height value from a ConfigureNotify that > > reflects the same size change. This will probably confuse developers. > > > > I suspect that it's only accidentally working for some folks with > portrait > > screens. > > Heyho Bob, > > thanks for the explanations, I merged your patch with some line-length > modifications. > > --Markus > > > > ---------- Forwarded message ---------- > From: Bob Uhl <b...@zvelo.com> > To: hackers mail list <hackers@suckless.org> > Cc: > Date: Tue, 22 Nov 2016 23:43:53 +0000 > Subject: Re: [hackers] [slock][PATCH] Fix resize with multiple monitors > and portrait mode > > Cool! Is there a suggested Emacs config to support the suckless code > conventions? > > Bob > > On Tue, 22 Nov 2016, 16:33 Markus Teich, <markus.te...@stusta.mhn.de> > wrote: > > Bob Uhl wrote: > > I built slock from 1.4, with the same desktop-revealing result. This is > on > > Xorg 1.16.4, which supports RandR 1.4. > > > > I merged my patch into 1.4; it fixes the issue. > > > > The RandR protocol documentation at > > <https://www.x.org/releases/X11R7.5/doc/randrproto/randrproto.txt> > indicates > > under 'RRScreenChangeNotify' (just before section 8.1): > > > > Note that the sizes in this event reflect the new SCREENSIZE and thus > will > > appear rotated by the 'rotation' parameter from the sizes of the screen > > itself. In other words, when rotation is 90 or 270, widthInPixels in > this > > event will be the same as the height value from a ConfigureNotify that > > reflects the same size change. This will probably confuse developers. > > > > I suspect that it's only accidentally working for some folks with > portrait > > screens. > > Heyho Bob, > > thanks for the explanations, I merged your patch with some line-length > modifications. > > --Markus > > -- > > *Bob Uhl* > *SOA Service Engineer*zvelo, Inc. - 8350 East Crescent Parkway, Suite > 450 - Greenwood Village, CO 80111 > Office: (720) 897.8113 ext. 118 - Toll Free: 1 (877) 77.ZVELO - Fax: > (720) > 897.6544 > b...@zvelo.com - www.zvelo.com > > > > ---------- Forwarded message ---------- > From: Markus Teich <markus.te...@stusta.mhn.de> > To: hackers@suckless.org > Cc: > Date: Wed, 23 Nov 2016 01:01:11 +0100 > Subject: Re: [hackers] [slock][PATCH] Fix resize with multiple monitors > and portrait mode > Bob Uhl wrote: > > Cool! Is there a suggested Emacs config to support the suckless code > > conventions? > > Heyho Bob, > > I don't think so, just write your own. We have a styleguide[0], but it is > only > recommended, not mandatory. If in doubt, the existing projects style is > the one > to use. > > --Markus > > 0: http://suckless.org/coding_style > > > > ---------- Forwarded message ---------- > From: spencer.phip...@gmail.com > To: hackers@suckless.org > Cc: Spencer Phippen <spencer.phip...@gmail.com> > Date: Tue, 22 Nov 2016 19:34:49 -0800 > Subject: [hackers] [st][PATCH] Fixed 'missing glyph doesn't use fontconfig > config substitutions' bug > From: Spencer Phippen <spencer.phip...@gmail.com> > > XftFontMatch does display-specific font configuration (commit 528241a). > Nice. Unfortunately, when we switched from FcFontMatch, we also stopped > storing the post-Fc{Config,Default}Substitute FcPattern for future > lookups. The result is that if a glyph isn't found in the primary font, > secondary font lookups use the original FcPattern, not the configured > one. If you have custom fontconfig rules (like me), this can be > disappointing. > > I basically just copied the guts out of XftFontMatch[1] and saved > the intermediate configured FcPattern. Could be related to the bug that > inspired commit 4242027. > > [1]: https://cgit.freedesktop.org/xorg/lib/libXft/tree/src/xftfont.c > --- > st.c | 22 +++++++++++++++++++--- > 1 file changed, 19 insertions(+), 3 deletions(-) > > diff --git a/st.c b/st.c > index e50e884..031272f 100644 > --- a/st.c > +++ b/st.c > @@ -3373,16 +3373,32 @@ xgeommasktogravity(int mask) > int > xloadfont(Font *f, FcPattern *pattern) > { > + FcPattern *configured; > FcPattern *match; > FcResult result; > XGlyphInfo extents; > int wantattr, haveattr; > > - match = XftFontMatch(xw.dpy, xw.scr, pattern, &result); > - if (!match) > + /* > + * Manually configure instead of calling XftMatchFont > + * so that we can use the configured pattern for > + * "missing glyph" lookups. > + */ > + configured = FcPatternDuplicate(pattern); > + if (!configured) > + return 1; > + > + FcConfigSubstitute(NULL, configured, FcMatchPattern); > + XftDefaultSubstitute(xw.dpy, xw.scr, configured); > + > + match = FcFontMatch(NULL, configured, &result); > + if (!match) { > + FcPatternDestroy(configured); > return 1; > + } > > if (!(f->match = XftFontOpenPattern(xw.dpy, match))) { > + FcPatternDestroy(configured); > FcPatternDestroy(match); > return 1; > } > @@ -3414,7 +3430,7 @@ xloadfont(Font *f, FcPattern *pattern) > strlen(ascii_printable), &extents); > > f->set = NULL; > - f->pattern = FcPatternDuplicate(pattern); > + f->pattern = configured; > > f->ascent = f->match->ascent; > f->descent = f->match->descent; > -- > 2.10.2 > > > > > ---------- Forwarded message ---------- > From: k...@shike2.com > To: hackers@suckless.org > Cc: > Date: Wed, 23 Nov 2016 22:05:55 +0100 > Subject: Re: [hackers] [st][PATCH] Fixed 'missing glyph doesn't use > fontconfig config substitutions' bug > > > I basically just copied the guts out of XftFontMatch[1] and saved > > the intermediate configured FcPattern. Could be related to the bug that > > inspired commit 4242027. > > > > Ok, your patch seems correct, but I would like to know if your patch solves > the issue of the commit 4242027, because in this case we can remove the > changes of that commit, which are a bit ugly. Can you verify it? > > Regards, > > > > > ---------- Forwarded message ---------- > From: Ian Remmler <i...@remmler.org> > To: hackers mail list <hackers@suckless.org> > Cc: > Date: Wed, 23 Nov 2016 15:23:37 -0600 > Subject: Re: [hackers] [st][PATCH] Fixed 'missing glyph doesn't use > fontconfig config substitutions' bug > On Wed, Nov 23, 2016 at 10:05:55PM +0100, k...@shike2.com wrote: > > Ok, your patch seems correct, but I would like to know if your patch > solves > > the issue of the commit 4242027, because in this case we can remove the > > changes of that commit, which are a bit ugly. Can you verify it? > > I reverted 4242027, applied this patch, and it does indeed fix the > problem for me. > > -- > - Ian. > > > > ---------- Forwarded message ---------- > From: g...@suckless.org > To: <hackers@suckless.org> > Cc: > Date: Thu, 24 Nov 2016 20:22:08 +0100 (CET) > Subject: [hackers] [st] Fixed 'missing glyph doesn't use fontconfig config > substitutions' bug || Spencer Phippen > commit fa9a4599720703932d1c4f16b9aeee1f91f96263 > Author: Spencer Phippen <spencer.phip...@gmail.com> > AuthorDate: Wed Nov 23 19:17:59 2016 +0100 > Commit: Roberto E. Vargas Caballero <k...@shike2.com> > CommitDate: Thu Nov 24 20:20:45 2016 +0100 > > Fixed 'missing glyph doesn't use fontconfig config substitutions' bug > > XftFontMatch does display-specific font configuration (commit 528241a). > Nice. Unfortunately, when we switched from FcFontMatch, we also stopped > storing the post-Fc{Config,Default}Substitute FcPattern for future > lookups. The result is that if a glyph isn't found in the primary font, > secondary font lookups use the original FcPattern, not the configured > one. If you have custom fontconfig rules (like me), this can be > disappointing. > > I basically just copied the guts out of XftFontMatch[1] and saved > the intermediate configured FcPattern. Could be related to the bug that > inspired commit 4242027. > > [1]: https://cgit.freedesktop.org/xorg/lib/libXft/tree/src/xftfont.c > > diff --git a/st.c b/st.c > index e50e884..031272f 100644 > --- a/st.c > +++ b/st.c > @@ -3373,16 +3373,32 @@ xgeommasktogravity(int mask) > int > xloadfont(Font *f, FcPattern *pattern) > { > + FcPattern *configured; > FcPattern *match; > FcResult result; > XGlyphInfo extents; > int wantattr, haveattr; > > - match = XftFontMatch(xw.dpy, xw.scr, pattern, &result); > - if (!match) > + /* > + * Manually configure instead of calling XftMatchFont > + * so that we can use the configured pattern for > + * "missing glyph" lookups. > + */ > + configured = FcPatternDuplicate(pattern); > + if (!configured) > + return 1; > + > + FcConfigSubstitute(NULL, configured, FcMatchPattern); > + XftDefaultSubstitute(xw.dpy, xw.scr, configured); > + > + match = FcFontMatch(NULL, configured, &result); > + if (!match) { > + FcPatternDestroy(configured); > return 1; > + } > > if (!(f->match = XftFontOpenPattern(xw.dpy, match))) { > + FcPatternDestroy(configured); > FcPatternDestroy(match); > return 1; > } > @@ -3414,7 +3430,7 @@ xloadfont(Font *f, FcPattern *pattern) > strlen(ascii_printable), &extents); > > f->set = NULL; > - f->pattern = FcPatternDuplicate(pattern); > + f->pattern = configured; > > f->ascent = f->match->ascent; > f->descent = f->match->descent; > > > > ---------- Forwarded message ---------- > From: g...@suckless.org > To: <hackers@suckless.org> > Cc: > Date: Thu, 24 Nov 2016 20:22:08 +0100 (CET) > Subject: [hackers] [st] Revert "Initial font size issue." || Roberto E. > Vargas Caballero > commit e44832408bb3147826c346872b49de105a4d0e0b > Author: Roberto E. Vargas Caballero <k...@shike2.com> > AuthorDate: Thu Nov 24 20:21:19 2016 +0100 > Commit: Roberto E. Vargas Caballero <k...@shike2.com> > CommitDate: Thu Nov 24 20:21:19 2016 +0100 > > Revert "Initial font size issue." > > This reverts commit 424202798b02554092ba84dd59fb7b79b59b7b75. > > diff --git a/st.c b/st.c > index 031272f..d6fe58a 100644 > --- a/st.c > +++ b/st.c > @@ -3488,9 +3488,6 @@ xloadfonts(char *fontstr, double fontsize) > if (usedfontsize < 0) { > FcPatternGetDouble(dc.font.match->pattern, > FC_PIXEL_SIZE, 0, &fontval); > - FcPatternAddDouble(pattern, FC_PIXEL_SIZE, fontval); > - if (xloadfont(&dc.font, pattern)) > - die("st: can't open font %s\n", fontstr); > usedfontsize = fontval; > if (fontsize == 0) > defaultfontsize = fontval; > > > > ---------- Forwarded message ---------- > From: k...@shike2.com > To: hackers@suckless.org > Cc: > Date: Thu, 24 Nov 2016 20:22:30 +0100 > Subject: Re: [hackers] [st][PATCH] Fixed 'missing glyph doesn't use > > I reverted 4242027, applied this patch, and it does indeed fix the > > problem for me. > > Applied. > > > > > ---------- Forwarded message ---------- > From: Thomas Gardner <t...@fastmail.com> > To: hackers@suckless.org > Cc: > Date: Fri, 25 Nov 2016 10:55:02 +1000 > Subject: [hackers] [PATCH][dmenu] Xinerama: correct variable declarations > in preprocessor conditional > > Greetings, > > The config.mk option must never have been rigorously tested. > > --- > dmenu.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/dmenu.c b/dmenu.c > index 9278e91..6512844 100644 > --- a/dmenu.c > +++ b/dmenu.c > @@ -544,11 +544,13 @@ setup(void) > XIM xim; > #ifdef XINERAMA > XineramaScreenInfo *info; > - Window w, pw, dw, *dws; > + Window pw; > + int a, j, di, n, area = 0; > +#endif > + Window w, dw, *dws; > XWindowAttributes wa; > - int a, j, di, n, i = 0, area = 0; > unsigned int du; > -#endif > + int i = 0; > > /* init appearance */ > scheme[SchemeNorm] = drw_scm_create(drw, colors[SchemeNorm], 2); > -- > 2.10.2 > > > > > ---------- Forwarded message ---------- > From: Quentin Rameau <quinq@fifth.space> > To: hackers@suckless.org > Cc: > Date: Fri, 25 Nov 2016 11:57:13 +0100 > Subject: Re: [hackers] [PATCH][dmenu] Xinerama: correct variable > declarations in preprocessor conditional > > Greetings, > Hi, > > > The config.mk option must never have been rigorously tested. > Thank you for spotting that, but maybe the description, if any, could > be a little more constructive? > > > --- > > dmenu.c | 8 +++++--- > > 1 file changed, 5 insertions(+), 3 deletions(-) > > > > diff --git a/dmenu.c b/dmenu.c > > index 9278e91..6512844 100644 > > --- a/dmenu.c > > +++ b/dmenu.c > > @@ -544,11 +544,13 @@ setup(void) > > XIM xim; > > #ifdef XINERAMA > > XineramaScreenInfo *info; > > - Window w, pw, dw, *dws; > > + Window pw; > > + int a, j, di, n, area = 0; > > +#endif > > + Window w, dw, *dws; > > XWindowAttributes wa; > > - int a, j, di, n, i = 0, area = 0; > > unsigned int du; > > -#endif > > + int i = 0; > > > > /* init appearance */ > > scheme[SchemeNorm] = drw_scm_create(drw, colors[SchemeNorm], > > 2); > Just put all common declarations above the ifdef > > > > > ---------- Forwarded message ---------- > From: Thomas Gardner <t...@fastmail.com> > To: hackers@suckless.org > Cc: > Date: Fri, 25 Nov 2016 22:38:09 +1000 > Subject: [hackers] [dmenu] [PATCH v2] Xinerama: correct variable > declarations in preprocessor conditional > --- > Sorry Quentin, I know now that this is where to include remarks. > > dmenu.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/dmenu.c b/dmenu.c > index 9278e91..1cfefcd 100644 > --- a/dmenu.c > +++ b/dmenu.c > @@ -539,15 +539,16 @@ run(void) > static void > setup(void) > { > - int x, y; > + int x, y, i = 0; > + unsigned int du; > XSetWindowAttributes swa; > XIM xim; > + Window w, dw, *dws; > + XWindowAttributes wa; > #ifdef XINERAMA > XineramaScreenInfo *info; > - Window w, pw, dw, *dws; > - XWindowAttributes wa; > - int a, j, di, n, i = 0, area = 0; > - unsigned int du; > + Window pw; > + int a, j, di, n, area = 0; > #endif > > /* init appearance */ > -- > 2.10.2 > > > > ---------- Forwarded message ---------- > From: Quentin Rameau <quinq@fifth.space> > To: hackers@suckless.org > Cc: > Date: Fri, 25 Nov 2016 13:52:34 +0100 > Subject: Re: [hackers] [dmenu] [PATCH v2] Xinerama: correct variable > declarations in preprocessor conditional > > Sorry Quentin, I know now that this is where to include remarks. > No problem, thanks for correcting! > > > dmenu.c | 11 ++++++----- > > 1 file changed, 6 insertions(+), 5 deletions(-) > > > > diff --git a/dmenu.c b/dmenu.c > > index 9278e91..1cfefcd 100644 > > --- a/dmenu.c > > +++ b/dmenu.c > > @@ -539,15 +539,16 @@ run(void) > > static void > > setup(void) > > { > > - int x, y; > > + int x, y, i = 0; > > + unsigned int du; > > XSetWindowAttributes swa; > > XIM xim; > > + Window w, dw, *dws; > > + XWindowAttributes wa; > > #ifdef XINERAMA > > XineramaScreenInfo *info; > > - Window w, pw, dw, *dws; > > - XWindowAttributes wa; > > - int a, j, di, n, i = 0, area = 0; > > - unsigned int du; > > + Window pw; > > + int a, j, di, n, area = 0; > > #endif > > > > /* init appearance */ > Looks fine to me, let's wait for other's approval. > > > > ---------- Forwarded message ---------- > From: g...@suckless.org > To: <hackers@suckless.org> > Cc: > Date: Fri, 25 Nov 2016 14:25:45 +0100 (CET) > Subject: [hackers] [dmenu] Xinerama: correct variable declarations in > preprocessor conditional || Thomas Gardner > commit e90b88e12a88d6214c00d5ee58ceb69446aa5ac4 > Author: Thomas Gardner <t...@fastmail.com> > AuthorDate: Fri Nov 25 22:38:09 2016 +1000 > Commit: Hiltjo Posthuma <hil...@codemadness.org> > CommitDate: Fri Nov 25 14:21:40 2016 +0100 > > Xinerama: correct variable declarations in preprocessor conditional > > diff --git a/dmenu.c b/dmenu.c > index 9278e91..1cfefcd 100644 > --- a/dmenu.c > +++ b/dmenu.c > @@ -539,15 +539,16 @@ run(void) > static void > setup(void) > { > - int x, y; > + int x, y, i = 0; > + unsigned int du; > XSetWindowAttributes swa; > XIM xim; > + Window w, dw, *dws; > + XWindowAttributes wa; > #ifdef XINERAMA > XineramaScreenInfo *info; > - Window w, pw, dw, *dws; > - XWindowAttributes wa; > - int a, j, di, n, i = 0, area = 0; > - unsigned int du; > + Window pw; > + int a, j, di, n, area = 0; > #endif > > /* init appearance */ > > > > ---------- Forwarded message ---------- > From: Hiltjo Posthuma <hil...@codemadness.org> > To: hackers mail list <hackers@suckless.org> > Cc: > Date: Fri, 25 Nov 2016 14:24:41 +0100 > Subject: Re: [hackers] [dmenu] [PATCH v2] Xinerama: correct variable > declarations in preprocessor conditional > On Fri, Nov 25, 2016 at 10:38:09PM +1000, Thomas Gardner wrote: > > --- > > Sorry Quentin, I know now that this is where to include remarks. > > > > dmenu.c | 11 ++++++----- > > 1 file changed, 6 insertions(+), 5 deletions(-) > > > > diff --git a/dmenu.c b/dmenu.c > > index 9278e91..1cfefcd 100644 > > --- a/dmenu.c > > +++ b/dmenu.c > > @@ -539,15 +539,16 @@ run(void) > > static void > > setup(void) > > { > > - int x, y; > > + int x, y, i = 0; > > + unsigned int du; > > XSetWindowAttributes swa; > > XIM xim; > > + Window w, dw, *dws; > > + XWindowAttributes wa; > > #ifdef XINERAMA > > XineramaScreenInfo *info; > > - Window w, pw, dw, *dws; > > - XWindowAttributes wa; > > - int a, j, di, n, i = 0, area = 0; > > - unsigned int du; > > + Window pw; > > + int a, j, di, n, area = 0; > > #endif > > > > /* init appearance */ > > -- > > 2.10.2 > > > > Hey Thomas, > > Thanks for the patch. I have pushed it to master. > > -- > Kind regards, > Hiltjo >