Age | Commit message (Collapse) | Author |
|
|
|
The vast majority of monospaced fonts are roughly half as wide as they
are tall; to account for this when displaying icons, `xprop` draws each
pixel twice in the horizontal, which nicely evens out the proportions.
This patch utilizes the Lower Half Block character (▄) to obtain the
same result in a quarter of the space. By setting both a background and
a foreground color, we can draw two pixels per character cell, thereby
halving the apparent height of an icon rather than doubling its width.
Signed-off-by: Eden Bynever <edenbynever@proton.me>
Part-of: <https://gitlab.freedesktop.org/xorg/app/xprop/-/merge_requests/10>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Reported by gcc 13.2 with -std=gnu2x:
xprop.c: In function ‘Handle_Question_Mark’:
xprop.c:1291:10: error: expected identifier or ‘(’ before ‘true’
1291 | long true;
| ^~~~
xprop.c:1293:49: error: lvalue required as unary ‘&’ operand
1293 | dformat = Scan_Exp(dformat, thunks, format, &true);
| ^
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Clears many gcc -Wshadow warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Resolves gcc -Wmissing-prototypes warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Resolves gcc -Wsuggest-attribute=noreturn warning
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Found by using:
codespell --builtin clear,rare,usage,informal,code,names
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
Make sure the function succeeded before looking at the return value.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
Fix the test when computing size necessary for true color output to
use 'is_truecolor_term' instead of 'is_utf8_locale'. A non-utf8 locale
with a true color terminal would have under-allocated the
buffer. Also, check for truecolor first to match the output code.
This doesn't fix the fact that this code over-allocates by a factor of
two in this case, but that at least won't cause memory corruption.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
Make sure we clean up after this call by using the XFreeStringList
function.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
Auto-detecting the terminal width and eliding icons that are too wide
is a nice new feature, but we shouldn't change the behaviour when that
width is not detectable (e.g., when output to a file). Change the
default terminal width from 80 to 144 + 8 to get back to the previous
output format.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
Otherwise looks like this:
Icon (48 x 48):
(not shown) Icon (64 x 64):
(not shown) Icon (128 x 128):
(not shown)
|
|
|
|
|
|
We need up to 3 bytes per character in UTF8 mode, not 4.
|
|
Assuming we can query the terminal width.
|
|
`-help` is mentioned in the manpages, but actually running `xprop -help`
results in xprop exiting with status 1 as it doesn't recognise the option.
This has been the source of major confusion here:
https://github.com/franciscolourenco/done/issues/77#issuecomment-612404448
Signed-off-by: Jason Nader <jason.nader@protonmail.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
dsimple.c:322:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i=0; i<nchildren; i++) {
^
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Found by gcc 7.3:
xprop.c: In function ‘Read_Quoted’:
xprop.c:163:8: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
} else
^~~~
xprop.c:164:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’
ptr++[0] = c; length--;
^~~~~~
Introduced in initial commit to X Consortium RCS in 1987:
https://cgit.freedesktop.org/~alanc/xc-historical/commit/xc/programs/xprop/xprop.c?id=18ea83d7457743936e99a574b50e208f7697f096
Actual effect is minimal - for every \-escaped newline in the DFORMAT
portion of a xprop formats file, xprop subtracted one byte too many
from the count of bytes still available in the buffer, which could lead
it to return an error of "Bad format file format: dformat too long." when
there was still room left. Since the original buffer size was 10,000
bytes, and the current size is 500,000 bytes, it's unlikely anyone ever
hit this in real usage.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
|
|
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
fall-outs, when they contain space.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Syncs the invocation of configure with the one from the server.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
|
|
Signed-off-by: Eirik Byrkjeflot Anonsen <eirik@eirikba.org>
|
|
Signed-off-by: Eirik Byrkjeflot Anonsen <eirik@eirikba.org>
|
|
Signed-off-by: Eirik Byrkjeflot Anonsen <eirik@eirikba.org>
|
|
Signed-off-by: Eirik Byrkjeflot Anonsen <eirik@eirikba.org>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
See http://people.gnome.org/~walters/docs/build-api.txt
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Allows us to get rid of a second copy of the code that differed only
in the unicode argument passed on to Format_String.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Silences -Wformat-nonliteral warnings about passing through
unknown format arguments to vfprintf.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Regroup AC statements under the Autoconf initialization section.
Regroup AM statements under the Automake initialization section.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|