guibuilder_pel7x64builder0
3 years ago
21 changed files with 12265 additions and 3207 deletions
@ -0,0 +1,126 @@ |
|||||||
|
From d8ba605b7779ce5d2fc893c44fc2986ecf176e47 Mon Sep 17 00:00:00 2001 |
||||||
|
From: XScreenSaver owners <xscreensaver-owner@fedoraproject.org> |
||||||
|
Date: Wed, 9 Dec 2020 22:12:09 +0900 |
||||||
|
Subject: [PATCH] barcode / glsnake: sanitize the names of modes |
||||||
|
|
||||||
|
--- |
||||||
|
hacks/barcode.c | 10 ---------- |
||||||
|
hacks/glx/glsnake.c | 12 ++++++------ |
||||||
|
2 files changed, 6 insertions(+), 16 deletions(-) |
||||||
|
|
||||||
|
diff --git a/hacks/barcode.c b/hacks/barcode.c |
||||||
|
index 20c2f38..ba3e2b2 100644 |
||||||
|
--- a/hacks/barcode.c |
||||||
|
+++ b/hacks/barcode.c |
||||||
|
@@ -122,8 +122,6 @@ static const char *words[] = |
||||||
|
"bird flu", |
||||||
|
"bliss", |
||||||
|
"bogosity", |
||||||
|
- "boobies", |
||||||
|
- "boobs", |
||||||
|
"booty", |
||||||
|
"bread", |
||||||
|
"brogrammers", |
||||||
|
@@ -139,7 +137,6 @@ static const char *words[] = |
||||||
|
"chocolate", |
||||||
|
"chupacabra", |
||||||
|
"CLONE", |
||||||
|
- "cock", |
||||||
|
"congress", |
||||||
|
"constriction", |
||||||
|
"contrition", |
||||||
|
@@ -184,7 +181,6 @@ static const char *words[] = |
||||||
|
"fear", |
||||||
|
"fever", |
||||||
|
"filth", |
||||||
|
- "flatulence", |
||||||
|
"fluff", |
||||||
|
"fnord", |
||||||
|
"followers", |
||||||
|
@@ -202,9 +198,7 @@ static const char *words[] = |
||||||
|
"happiness", |
||||||
|
"hate", |
||||||
|
"helplessness", |
||||||
|
- "hemorrhoid", |
||||||
|
"hermaphrodite", |
||||||
|
- "heroin", |
||||||
|
"heroine", |
||||||
|
"hope", |
||||||
|
"hysteria", |
||||||
|
@@ -286,7 +280,6 @@ static const char *words[] = |
||||||
|
"punishment", |
||||||
|
"punk rock", |
||||||
|
"punk", |
||||||
|
- "pussy", |
||||||
|
"quagmire", |
||||||
|
"quarantine", |
||||||
|
"quartz", |
||||||
|
@@ -295,7 +288,6 @@ static const char *words[] = |
||||||
|
"rage", |
||||||
|
"readout", |
||||||
|
"reality", |
||||||
|
- "rectum", |
||||||
|
"reject", |
||||||
|
"rejection", |
||||||
|
"respect", |
||||||
|
@@ -365,8 +357,6 @@ static const char *words[] = |
||||||
|
"venom", |
||||||
|
"verifiability", |
||||||
|
"very fine people", |
||||||
|
- "viagra", |
||||||
|
- "vibrator", |
||||||
|
"victim", |
||||||
|
"vignette", |
||||||
|
"villainy", |
||||||
|
diff --git a/hacks/glx/glsnake.c b/hacks/glx/glsnake.c |
||||||
|
index 8efc681..125df90 100644 |
||||||
|
--- a/hacks/glx/glsnake.c |
||||||
|
+++ b/hacks/glx/glsnake.c |
||||||
|
@@ -539,7 +539,7 @@ static const struct model_s model[] = { |
||||||
|
PIN, ZERO, RIGHT, RIGHT, ZERO, PIN, PIN, ZERO, PIN, PIN, ZERO, |
||||||
|
RIGHT, ZERO } |
||||||
|
}, |
||||||
|
- { "k's turd", |
||||||
|
+ { "caterpillar", |
||||||
|
{ RIGHT, RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN, RIGHT, LEFT, |
||||||
|
RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN, |
||||||
|
RIGHT, LEFT, RIGHT, PIN, ZERO } |
||||||
|
@@ -564,22 +564,22 @@ static const struct model_s model[] = { |
||||||
|
ZERO, PIN, ZERO, ZERO, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, ZERO, |
||||||
|
ZERO, ZERO, ZERO } |
||||||
|
}, |
||||||
|
- { "kissy box", |
||||||
|
+ { "ribbon", |
||||||
|
{ PIN, ZERO, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, ZERO, ZERO, |
||||||
|
ZERO, PIN, ZERO, ZERO, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, ZERO, |
||||||
|
ZERO, PIN, ZERO } |
||||||
|
}, |
||||||
|
- { "erect penis", /* thanks benno */ |
||||||
|
+ { "shuffle board", /* thanks benno */ |
||||||
|
{ PIN, ZERO, PIN, PIN, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, PIN, |
||||||
|
PIN, ZERO, ZERO, ZERO, RIGHT, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, |
||||||
|
ZERO, ZERO } |
||||||
|
}, |
||||||
|
- { "flaccid penis", |
||||||
|
+ { "anchor", |
||||||
|
{ PIN, ZERO, PIN, PIN, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, PIN, |
||||||
|
PIN, ZERO, ZERO, ZERO, RIGHT, PIN, ZERO, ZERO, ZERO, ZERO, ZERO, |
||||||
|
ZERO, ZERO } |
||||||
|
}, |
||||||
|
- { "vagina", |
||||||
|
+ { "engagement ring", |
||||||
|
{ RIGHT, ZERO, ZERO, ZERO, RIGHT, ZERO, ZERO, PIN, ZERO, ZERO, |
||||||
|
LEFT, ZERO, ZERO, ZERO, LEFT, ZERO, LEFT, PIN, LEFT, PIN, RIGHT, |
||||||
|
PIN, RIGHT, ZERO } |
||||||
|
@@ -999,7 +999,7 @@ static const struct model_s model[] = { |
||||||
|
{ "Parrot", |
||||||
|
{ ZERO, ZERO, ZERO, ZERO, RIGHT, RIGHT, ZERO, LEFT, PIN, RIGHT, ZERO, RIGHT, ZERO, RIGHT, ZERO, RIGHT, PIN, LEFT, ZERO, RIGHT, LEFT, ZERO, PIN, ZERO } |
||||||
|
}, |
||||||
|
- { "Penis", |
||||||
|
+ { "Shuttle", |
||||||
|
{ PIN, PIN, RIGHT, ZERO, PIN, PIN, ZERO, PIN, ZERO, ZERO, RIGHT, PIN, LEFT, ZERO, ZERO, PIN, ZERO, PIN, PIN, ZERO, LEFT, PIN, PIN, ZERO } |
||||||
|
}, |
||||||
|
{ "PictureComingSoon", |
||||||
|
-- |
||||||
|
2.29.2 |
||||||
|
|
@ -0,0 +1,42 @@ |
|||||||
|
From bc93d94efe27f6a42cfe1d5c5c5723565f3930de Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mamoru TASAKA <mtasaka@fedoraproject.org> |
||||||
|
Date: Thu, 10 Dec 2020 11:45:51 +0900 |
||||||
|
Subject: [PATCH] asm6502.c/immediate: readd free() call accidentally removed |
||||||
|
during gcc warnings fix |
||||||
|
|
||||||
|
valgrind detects the following leak: |
||||||
|
|
||||||
|
==200428== 4,480 bytes in 56 blocks are definitely lost in loss record 307 of 310 |
||||||
|
==200428== at 0x483BAE9: calloc (vg_replace_malloc.c:760) |
||||||
|
==200428== by 0x1122AB: UnknownInlinedFun (asm6502.c:115) |
||||||
|
==200428== by 0x1122AB: UnknownInlinedFun (asm6502.c:1411) |
||||||
|
==200428== by 0x1122AB: UnknownInlinedFun (asm6502.c:1576) |
||||||
|
==200428== by 0x1122AB: UnknownInlinedFun (asm6502.c:1652) |
||||||
|
==200428== by 0x1122AB: compileCode (asm6502.c:2028) |
||||||
|
==200428== by 0x118602: UnknownInlinedFun (asm6502.c:2230) |
||||||
|
==200428== by 0x118602: UnknownInlinedFun (m6502.c:93) |
||||||
|
==200428== by 0x118602: m6502_draw (m6502.c:230) |
||||||
|
==200428== by 0x10D9D7: UnknownInlinedFun (screenhack.c:597) |
||||||
|
==200428== by 0x10D9D7: main (screenhack.c:991) |
||||||
|
|
||||||
|
During gcc warnings fix (about -Wstringop), strncpy() is changed to sprintf, but the following |
||||||
|
free() should not be removed, otherwise m6502 will leak memory. |
||||||
|
--- |
||||||
|
hacks/asm6502.c | 1 + |
||||||
|
1 file changed, 1 insertion(+) |
||||||
|
|
||||||
|
diff --git a/hacks/asm6502.c b/hacks/asm6502.c |
||||||
|
index 1d5c896..dd8a11b 100644 |
||||||
|
--- a/hacks/asm6502.c |
||||||
|
+++ b/hacks/asm6502.c |
||||||
|
@@ -1413,6 +1413,7 @@ static BOOL immediate(char **s, Param *param){ |
||||||
|
(*s)++; /* move past < or > */ |
||||||
|
if (paramLabel(s, &label)){ |
||||||
|
sprintf(param->label, "%.*s", MAX_LABEL_LEN-1, label); |
||||||
|
+ free(label); |
||||||
|
return TRUE; |
||||||
|
} |
||||||
|
free(label); |
||||||
|
-- |
||||||
|
2.29.2 |
||||||
|
|
@ -0,0 +1,33 @@ |
|||||||
|
From dab3a04fbd2c4658614471cd4d8550ce0e0cef7b Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mamoru TASAKA <mtasaka@fedoraproject.org> |
||||||
|
Date: Thu, 10 Dec 2020 16:38:26 +0900 |
||||||
|
Subject: [PATCH] beats/draw_beats: avoid integer overflow by multiplication |
||||||
|
|
||||||
|
gcc10 -fsanitize=undefined detects the following integer overflow: |
||||||
|
------------------------------------------ |
||||||
|
../../../hacks/glx/beats.c:325:53: runtime error: signed integer overflow: 3665625 * 42587 cannot be represented in type 'int' |
||||||
|
../../../hacks/glx/beats.c:326:21: runtime error: signed integer overflow: 1489149219 * 1233599 cannot be represented in type 'int' |
||||||
|
------------------------------------------ |
||||||
|
Avoid this by using unsigned integer. |
||||||
|
--- |
||||||
|
hacks/glx/beats.c | 4 ++-- |
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-) |
||||||
|
|
||||||
|
diff --git a/hacks/glx/beats.c b/hacks/glx/beats.c |
||||||
|
index 64fd689..19565ec 100644 |
||||||
|
--- a/hacks/glx/beats.c |
||||||
|
+++ b/hacks/glx/beats.c |
||||||
|
@@ -322,8 +322,8 @@ draw_beats (ModeInfo *mi) |
||||||
|
} |
||||||
|
} |
||||||
|
/* pseudo-random generator based on current minute */ |
||||||
|
- timeSeed = (((tmM+1) * (tmM+1) * ((tmH+1) * 37) * |
||||||
|
- ((tmD+1) * 1151) * 1233599) % 653); |
||||||
|
+ timeSeed = (((tmM+1) * (tmM+1) * ((tmH+1) * 37ULL) * |
||||||
|
+ ((tmD+1) * 1151ULL) * 1233599ULL) % 653); |
||||||
|
cycle = timeSeed % 4; |
||||||
|
if(bp->preset_cycle != -1){ |
||||||
|
cycle = bp->preset_cycle; |
||||||
|
-- |
||||||
|
2.29.2 |
||||||
|
|
@ -0,0 +1,65 @@ |
|||||||
|
From 2b1643d361274d52259820561747165af423a420 Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mamoru TASAKA <mtasaka@fedoraproject.org> |
||||||
|
Date: Mon, 28 Dec 2020 15:14:30 +0900 |
||||||
|
Subject: [PATCH 4/6] xscreensaver-systemd: fix blurb strncpy |
||||||
|
|
||||||
|
Shut up the following gcc11 -Wall warning: |
||||||
|
--------------------------------------------- |
||||||
|
In function 'strncpy', |
||||||
|
inlined from 'blurb' at ../../driver/xscreensaver-systemd.c:387:3: |
||||||
|
/usr/include/bits/string_fortified.h:91:10: warning: 'strncpy' output may be truncated copying 8 bytes from a string of length 88 [-Wstringop-truncation] |
||||||
|
--------------------------------------------- |
||||||
|
|
||||||
|
Note that the current blurb() implementation contains some code which is |
||||||
|
actually not working. Currently: |
||||||
|
--------------------------------------------- |
||||||
|
376 blurb (void) |
||||||
|
377 { |
||||||
|
378 static char buf[255]; |
||||||
|
|
||||||
|
386 ctime_r (&now, ct); |
||||||
|
387 strncpy(buf+n, ct+11, 8); |
||||||
|
388 strcpy(buf+n+9, ": "); |
||||||
|
389 return buf; |
||||||
|
390 } |
||||||
|
--------------------------------------------- |
||||||
|
With the line 378, the contents of buf[] is all initialized to 0. |
||||||
|
the line 388 strncpy() puts some string from ct to |
||||||
|
buf[n+0], buf[n+1], ... , and buf[n+7] (8 bytes, not putting terminating |
||||||
|
null character). Here buf[n+8] is still 0 (null character) because |
||||||
|
buf[] is all initialized to 0. |
||||||
|
The line 388 puts the string to buf[n+9] and buf[n+10], but as |
||||||
|
buf[n+8] is still 0, the line 388 does essentially nothing. |
||||||
|
|
||||||
|
Note that the other part of this file calls blurb() like: |
||||||
|
---------------------------------------------- |
||||||
|
402 fprintf (stderr, "%s: exec: %s\n", blurb(), buf); |
||||||
|
---------------------------------------------- |
||||||
|
i.e. "%s" always followed by ":" which compensates for the line 388. |
||||||
|
--- |
||||||
|
driver/xscreensaver-systemd.c | 8 +------- |
||||||
|
1 file changed, 1 insertion(+), 7 deletions(-) |
||||||
|
|
||||||
|
diff --git a/driver/xscreensaver-systemd.c b/driver/xscreensaver-systemd.c |
||||||
|
index 2da99de..f6bd104 100644 |
||||||
|
--- a/driver/xscreensaver-systemd.c |
||||||
|
+++ b/driver/xscreensaver-systemd.c |
||||||
|
@@ -378,14 +378,8 @@ blurb (void) |
||||||
|
static char buf[255]; |
||||||
|
time_t now = time ((time_t *) 0); |
||||||
|
char ct[100]; |
||||||
|
- int n = strlen(progname); |
||||||
|
- if (n > 100) n = 99; |
||||||
|
- strncpy(buf, progname, n); |
||||||
|
- buf[n++] = ':'; |
||||||
|
- buf[n++] = ' '; |
||||||
|
ctime_r (&now, ct); |
||||||
|
- strncpy(buf+n, ct+11, 8); |
||||||
|
- strcpy(buf+n+9, ": "); |
||||||
|
+ sprintf(buf, "%.99s: %.8s", progname, ct+11); |
||||||
|
return buf; |
||||||
|
} |
||||||
|
|
||||||
|
-- |
||||||
|
2.29.2 |
||||||
|
|
@ -0,0 +1,78 @@ |
|||||||
|
From a93c17b054313f8ce0b0474942177a3aa646893b Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mamoru TASAKA <mtasaka@fedoraproject.org> |
||||||
|
Date: Mon, 28 Dec 2020 15:29:41 +0900 |
||||||
|
Subject: [PATCH 5/6] recanim.c: fix up -Wformat-overflow warning: |
||||||
|
|
||||||
|
From gcc11 -Wall: |
||||||
|
-------------------------------------------------------------- |
||||||
|
../../hacks/recanim.c: In function 'screenhack_record_anim_free': |
||||||
|
../../hacks/recanim.c:435:12: warning: '%s' directive writing up to 1023 bytes into a region of size 968 [-Wformat-overflow=] |
||||||
|
435 | " -c:v libx264" |
||||||
|
| ^~~~~~~~~~~~~~~ |
||||||
|
...... |
||||||
|
442 | fn); |
||||||
|
| ~~ |
||||||
|
../../hacks/recanim.c:439:15: note: format string is defined here |
||||||
|
439 | " '%s'" |
||||||
|
| ^~ |
||||||
|
-------------------------------------------------------------- |
||||||
|
|
||||||
|
To silence this warning, calculate the size of the string which is "supposed to be" |
||||||
|
written and if the size is going to be oversized, exit abnormally. |
||||||
|
--- |
||||||
|
hacks/recanim.c | 14 ++++++++++---- |
||||||
|
1 file changed, 10 insertions(+), 4 deletions(-) |
||||||
|
|
||||||
|
diff --git a/hacks/recanim.c b/hacks/recanim.c |
||||||
|
index b1c7e0a..bf9084c 100644 |
||||||
|
--- a/hacks/recanim.c |
||||||
|
+++ b/hacks/recanim.c |
||||||
|
@@ -391,6 +391,7 @@ screenhack_record_anim_free (record_anim_state *st) |
||||||
|
const char *type = "png"; |
||||||
|
char cmd[1024]; |
||||||
|
char fn[1024]; |
||||||
|
+ size_t len_cmd; |
||||||
|
const char *soundtrack = 0; |
||||||
|
|
||||||
|
fprintf (stderr, "%s: wrote %d frames\n", progname, st->frame_count); |
||||||
|
@@ -417,7 +418,8 @@ screenhack_record_anim_free (record_anim_state *st) |
||||||
|
if (! soundtrack) soundtrack = "../../" ST; |
||||||
|
if (stat (soundtrack, &s)) soundtrack = 0; |
||||||
|
|
||||||
|
- sprintf (cmd, |
||||||
|
+ len_cmd = 0; |
||||||
|
+ len_cmd += snprintf (cmd, sizeof cmd - len_cmd, |
||||||
|
"ffmpeg" |
||||||
|
" -hide_banner" |
||||||
|
" -loglevel error" |
||||||
|
@@ -425,13 +427,16 @@ screenhack_record_anim_free (record_anim_state *st) |
||||||
|
" -i '%s-%%06d.%s'" |
||||||
|
" -r %d", /* rate of output: must be after -i */ |
||||||
|
st->fps, progname, type, st->fps); |
||||||
|
- if (soundtrack) |
||||||
|
- sprintf (cmd + strlen(cmd), |
||||||
|
+ if (len_cmd >= sizeof cmd) abort(); |
||||||
|
+ if (soundtrack) { |
||||||
|
+ len_cmd += snprintf (cmd + len_cmd, sizeof cmd - len_cmd, |
||||||
|
" -i '%s' -map 0:v:0 -map 1:a:0 -acodec aac" |
||||||
|
/* Truncate or pad audio to length of video */ |
||||||
|
" -filter_complex '[1:0] apad' -shortest", |
||||||
|
soundtrack); |
||||||
|
- sprintf (cmd + strlen(cmd), |
||||||
|
+ if (len_cmd >= sizeof cmd) abort(); |
||||||
|
+ } |
||||||
|
+ len_cmd += snprintf (cmd + len_cmd, sizeof cmd - len_cmd, |
||||||
|
" -c:v libx264" |
||||||
|
" -profile:v high" |
||||||
|
" -crf 18" |
||||||
|
@@ -440,6 +445,7 @@ screenhack_record_anim_free (record_anim_state *st) |
||||||
|
" </dev/null" |
||||||
|
/*" 2>&-"*/, |
||||||
|
fn); |
||||||
|
+ if (len_cmd >= sizeof cmd) abort(); |
||||||
|
fprintf (stderr, "%s: exec: %s\n", progname, cmd); |
||||||
|
/* Use empty body to kill warning from gcc -Wall with |
||||||
|
"warning: ignoring return value of 'system', |
||||||
|
-- |
||||||
|
2.29.2 |
||||||
|
|
@ -0,0 +1,33 @@ |
|||||||
|
From 2a744c80fb0e8ec22c1b7d3656f7cbdcad2f3fef Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mamoru TASAKA <mtasaka@fedoraproject.org> |
||||||
|
Date: Mon, 28 Dec 2020 15:31:38 +0900 |
||||||
|
Subject: [PATCH 6/6] asm6502.c/newAsmLine: shut up -Wstringop warning |
||||||
|
|
||||||
|
Shut up the following warning by gcc11 -Wall: |
||||||
|
---------------------------------------------------------- |
||||||
|
In function 'strncpy', |
||||||
|
inlined from 'newAsmLine' at ../../hacks/asm6502.c:1181:5, |
||||||
|
inlined from 'parseAssembly' at ../../hacks/asm6502.c:1661:14, |
||||||
|
inlined from 'compileCode' at ../../hacks/asm6502.c:2029:13: |
||||||
|
/usr/include/bits/string_fortified.h:91:10: warning: 'strncpy' specified bound 80 equals destination size [-Wstringop-truncation] |
||||||
|
---------------------------------------------------------- |
||||||
|
--- |
||||||
|
hacks/asm6502.c | 2 +- |
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-) |
||||||
|
|
||||||
|
diff --git a/hacks/asm6502.c b/hacks/asm6502.c |
||||||
|
index dd8a11b..28a85d1 100644 |
||||||
|
--- a/hacks/asm6502.c |
||||||
|
+++ b/hacks/asm6502.c |
||||||
|
@@ -1178,7 +1178,7 @@ static AsmLine *newAsmLine(char *cmd, char *label, BOOL decl, Param *param, int |
||||||
|
newp = (AsmLine *) ecalloc(1, sizeof(AsmLine)); |
||||||
|
newp->labelDecl = decl; |
||||||
|
newp->label = newLabel(); |
||||||
|
- strncpy(newp->label->label,label,MAX_LABEL_LEN); |
||||||
|
+ sprintf(newp->label->label, "%.*s", MAX_LABEL_LEN - 1, label); |
||||||
|
newp->command = estrdup(cmd); |
||||||
|
newp->param = newParam(); |
||||||
|
copyParam(newp->param, param); |
||||||
|
-- |
||||||
|
2.29.2 |
||||||
|
|
@ -0,0 +1,54 @@ |
|||||||
|
From 0638fb6fca4b10120d08e5b1d546dea0013faa07 Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mamoru TASAKA <mtasaka@fedoraproject.org> |
||||||
|
Date: Mon, 28 Dec 2020 18:03:25 +0900 |
||||||
|
Subject: [PATCH] lock.c/draw_passwd_window: show logo and ok button |
||||||
|
|
||||||
|
On Fedora 33 and on some environment, user may see the issue on |
||||||
|
lock screen: |
||||||
|
* xscreensaver logo is not shown |
||||||
|
* ok and new login buttons are not shown |
||||||
|
|
||||||
|
To fix these issue, two modifications seem needed. |
||||||
|
* Calling XSync() is needed to make ok button appear |
||||||
|
* draw_shaded_rectangle() on the whole window must be called before |
||||||
|
painting logo |
||||||
|
--- |
||||||
|
driver/lock.c | 13 +++++++------ |
||||||
|
1 file changed, 7 insertions(+), 6 deletions(-) |
||||||
|
|
||||||
|
diff --git a/driver/lock.c b/driver/lock.c |
||||||
|
index 8bcd2e0..7133dc0 100644 |
||||||
|
--- a/driver/lock.c |
||||||
|
+++ b/driver/lock.c |
||||||
|
@@ -750,6 +750,12 @@ draw_passwd_window (saver_info *si) |
||||||
|
x3 = pw->width - (pw->shadow_width * 2); |
||||||
|
y1 = (pw->shadow_width * 2) + spacing + spacing; |
||||||
|
|
||||||
|
+ /* The shadow around the whole window |
||||||
|
+ */ |
||||||
|
+ draw_shaded_rectangle (si->dpy, si->passwd_dialog, |
||||||
|
+ 0, 0, pw->width, pw->height, pw->shadow_width, |
||||||
|
+ pw->shadow_top, pw->shadow_bottom); |
||||||
|
+ |
||||||
|
/* top heading |
||||||
|
*/ |
||||||
|
XSetFont (si->dpy, gc1, pw->heading_font->fid); |
||||||
|
@@ -994,14 +1000,9 @@ draw_passwd_window (saver_info *si) |
||||||
|
pw->thermo_width - 1, pw->thermo_field_height - 1); |
||||||
|
#endif |
||||||
|
|
||||||
|
- /* The shadow around the whole window |
||||||
|
- */ |
||||||
|
- draw_shaded_rectangle (si->dpy, si->passwd_dialog, |
||||||
|
- 0, 0, pw->width, pw->height, pw->shadow_width, |
||||||
|
- pw->shadow_top, pw->shadow_bottom); |
||||||
|
- |
||||||
|
XFreeGC (si->dpy, gc1); |
||||||
|
XFreeGC (si->dpy, gc2); |
||||||
|
+ XSync (si->dpy, False); |
||||||
|
|
||||||
|
update_passwd_window (si, pw->passwd_string, pw->ratio); |
||||||
|
} |
||||||
|
-- |
||||||
|
2.29.2 |
||||||
|
|
@ -0,0 +1,33 @@ |
|||||||
|
From 9b948db8377c0ac146eae2d865c987e73d9109ad Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mamoru TASAKA <mtasaka@fedoraproject.org> |
||||||
|
Date: Fri, 11 Dec 2020 10:40:09 +0900 |
||||||
|
Subject: [PATCH] test-screens.c: add skel XA_SCREENSAVER_VERSION definition |
||||||
|
|
||||||
|
To avoid the following link error: |
||||||
|
---------------------------------------------------- |
||||||
|
/usr/bin/ld: test-screens.o: in function `update_screen_layout': |
||||||
|
/builddir/build/BUILD/xscreensaver-5.45/x86_64-pc-linux-gnu/driver/../../driver/screens.c:1104: undefined reference to `XA_SCREENSAVER_VERSION' |
||||||
|
collect2: error: ld returned 1 exit status |
||||||
|
---------------------------------------------------- |
||||||
|
|
||||||
|
On xscreensaver-5.45, in screens.c/update_screen_layout some logic is added using |
||||||
|
XA_SCREENSAVER_VERSION . |
||||||
|
--- |
||||||
|
driver/test-screens.c | 1 + |
||||||
|
1 file changed, 1 insertion(+) |
||||||
|
|
||||||
|
diff --git a/driver/test-screens.c b/driver/test-screens.c |
||||||
|
index 2fb3e35..c5dfa02 100644 |
||||||
|
--- a/driver/test-screens.c |
||||||
|
+++ b/driver/test-screens.c |
||||||
|
@@ -39,6 +39,7 @@ |
||||||
|
|
||||||
|
char *progname = 0; |
||||||
|
char *progclass = "XScreenSaver"; |
||||||
|
+Atom XA_SCREENSAVER_VERSION; |
||||||
|
|
||||||
|
const char *blurb(void) { return progname; } |
||||||
|
|
||||||
|
-- |
||||||
|
2.29.2 |
||||||
|
|
@ -0,0 +1,31 @@ |
|||||||
|
From bcb4b5355e73274722a6169dfa4f532353b3d6a7 Mon Sep 17 00:00:00 2001 |
||||||
|
From: XScreenSaver owners <xscreensaver-owner@fedoraproject.org> |
||||||
|
Date: Wed, 9 Dec 2020 22:35:55 +0900 |
||||||
|
Subject: [PATCH] test-password.c: add skel definition for |
||||||
|
clientmessage_response |
||||||
|
|
||||||
|
Fix below |
||||||
|
|
||||||
|
/usr/bin/ld: /tmp/test-passwd.BnNU2t.ltrans0.ltrans.o: in function `passwd_event_loop': |
||||||
|
/foo/xscreensaver-5.45/x86_64-pc-linux-gnu/driver/../../driver/lock.c:1937: undefined reference to `clientmessage_response' |
||||||
|
collect2: error: ld returned 1 exit status |
||||||
|
make: *** [Makefile:842: test-passwd] Error 1 |
||||||
|
--- |
||||||
|
driver/test-passwd.c | 1 + |
||||||
|
1 file changed, 1 insertion(+) |
||||||
|
|
||||||
|
diff --git a/driver/test-passwd.c b/driver/test-passwd.c |
||||||
|
index 9b4f98e..1c4dccc 100644 |
||||||
|
--- a/driver/test-passwd.c |
||||||
|
+++ b/driver/test-passwd.c |
||||||
|
@@ -67,6 +67,7 @@ void describe_monitor_layout (saver_info *si) { } |
||||||
|
Bool update_screen_layout (saver_info *si) { return 0; } |
||||||
|
Bool in_signal_handler_p = 0; |
||||||
|
char *timestring (time_t when) { return ""; } |
||||||
|
+void clientmessage_response (saver_info *si, Window w, Bool error, const char *stderr_msg, const char *protocol_msg) {} |
||||||
|
|
||||||
|
const char *blurb(void) { return progname; } |
||||||
|
Atom XA_SCREENSAVER, XA_DEMO, XA_PREFS; |
||||||
|
-- |
||||||
|
2.29.2 |
||||||
|
|
@ -0,0 +1,65 @@ |
|||||||
|
From ef72c9500015a36bf0b4b412337ec2d890d092b6 Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mamoru TASAKA <mtasaka@fedoraproject.org> |
||||||
|
Date: Fri, 2 Apr 2021 18:46:14 +0900 |
||||||
|
Subject: [PATCH] screensaver_id: search parenthesis first for searching year |
||||||
|
|
||||||
|
Fedora package modifies screensaver_id string to %%version-%%release . |
||||||
|
Adjust window_init function so that "year" information is |
||||||
|
parsed correctly. |
||||||
|
--- |
||||||
|
driver/demo-Gtk.c | 4 +++- |
||||||
|
driver/dialog.c | 4 +++- |
||||||
|
driver/xscreensaver-systemd.c | 4 +++- |
||||||
|
3 files changed, 9 insertions(+), 3 deletions(-) |
||||||
|
|
||||||
|
diff --git a/driver/demo-Gtk.c b/driver/demo-Gtk.c |
||||||
|
index b5e82e2..3874045 100644 |
||||||
|
--- a/driver/demo-Gtk.c |
||||||
|
+++ b/driver/demo-Gtk.c |
||||||
|
@@ -779,8 +779,10 @@ about_menu_cb (GtkAction *menu_action, gpointer user_data) |
||||||
|
char *desc = _("For updates, check https://www.jwz.org/xscreensaver/"); |
||||||
|
|
||||||
|
char *version = strdup (screensaver_id + 17); |
||||||
|
- char *year = strchr (version, '-'); |
||||||
|
+ char *year; |
||||||
|
char *s = strchr (version, ' '); |
||||||
|
+ year = strchr (version, '('); /* Search parenthesis first */ |
||||||
|
+ year = strchr (year, '-'); |
||||||
|
*s = 0; |
||||||
|
year = strchr (year+1, '-') + 1; |
||||||
|
s = strchr (year, ')'); |
||||||
|
diff --git a/driver/dialog.c b/driver/dialog.c |
||||||
|
index fce74c4..9a8173f 100644 |
||||||
|
--- a/driver/dialog.c |
||||||
|
+++ b/driver/dialog.c |
||||||
|
@@ -949,8 +949,10 @@ window_init (Widget root_widget, Bool splash_p) |
||||||
|
/* Put the version number in the label. */ |
||||||
|
{ |
||||||
|
char *version = strdup (screensaver_id + 17); |
||||||
|
- char *year = strchr (version, '-'); |
||||||
|
+ char *year; |
||||||
|
char *s = strchr (version, ' '); |
||||||
|
+ year = strchr (version, '('); /* Search parenthesis first */ |
||||||
|
+ year = strchr (year, '-'); |
||||||
|
*s = 0; |
||||||
|
year = strchr (year+1, '-') + 1; |
||||||
|
s = strchr (year, ')'); |
||||||
|
diff --git a/driver/xscreensaver-systemd.c b/driver/xscreensaver-systemd.c |
||||||
|
index d06174a..c9a66a1 100644 |
||||||
|
--- a/driver/xscreensaver-systemd.c |
||||||
|
+++ b/driver/xscreensaver-systemd.c |
||||||
|
@@ -950,8 +950,10 @@ main (int argc, char **argv) |
||||||
|
{ |
||||||
|
int i; |
||||||
|
char *version = strdup (screensaver_id + 17); |
||||||
|
- char *year = strchr (version, '-'); |
||||||
|
+ char *year; |
||||||
|
char *s = strchr (version, ' '); |
||||||
|
+ year = strchr (version, '('); /* Search parenthesis first */ |
||||||
|
+ year = strchr (year, '-'); |
||||||
|
*s = 0; |
||||||
|
year = strchr (year+1, '-') + 1; |
||||||
|
s = strchr (year, ')'); |
||||||
|
-- |
||||||
|
2.31.1 |
||||||
|
|
@ -0,0 +1,30 @@ |
|||||||
|
From 7b256829ce730ab93b76e4f4f2e72f0132122ba1 Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mamoru TASAKA <mtasaka@fedoraproject.org> |
||||||
|
Date: Mon, 3 May 2021 14:43:56 +0900 |
||||||
|
Subject: [PATCH] xscreensaver-text use en_US locale for lscpu |
||||||
|
|
||||||
|
Downstream bug: https://bugzilla.redhat.com/show_bug.cgi?id=1956089 |
||||||
|
xscreensaver-text in version 6.00 adds CPU model detection, using |
||||||
|
lscpu command utility and using regex. |
||||||
|
Since regex string is locale-independent, the result of lscpu should be |
||||||
|
locale-independent. For now, let's use en_US "LANGUAGE". |
||||||
|
--- |
||||||
|
hacks/xscreensaver-text | 2 +- |
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-) |
||||||
|
|
||||||
|
diff --git a/hacks/xscreensaver-text b/hacks/xscreensaver-text |
||||||
|
index 421fae7..645bdd0 100755 |
||||||
|
--- a/hacks/xscreensaver-text |
||||||
|
+++ b/hacks/xscreensaver-text |
||||||
|
@@ -428,7 +428,7 @@ sub output() { |
||||||
|
# we're running on. This info also exists in various /proc/ files, |
||||||
|
# but if /proc/ exists, lscpu probably exists as well. |
||||||
|
# |
||||||
|
- my $cpu = `lscpu 2>&-`; |
||||||
|
+ my $cpu = `env LANGUAGE=en_US lscpu 2>&-`; |
||||||
|
if ($cpu) { |
||||||
|
my ($model) = ($cpu =~ m/^Model name:\s*(.*)$/mi); |
||||||
|
#my ($arch) = ($cpu =~ m/^Architecture:\s*(.*)$/mi); |
||||||
|
-- |
||||||
|
2.31.1 |
||||||
|
|
@ -0,0 +1,27 @@ |
|||||||
|
From 13e1203d8cc00a8462dbd2656257b46b411b2854 Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mamoru TASAKA <mtasaka@fedoraproject.org> |
||||||
|
Date: Mon, 3 May 2021 15:00:31 +0900 |
||||||
|
Subject: [PATCH] dialog.c: window_init: show more version string |
||||||
|
|
||||||
|
Fedora modifies version string to "6.00-1.fc34" to show rpm "release", for example. |
||||||
|
Let's allow more length for version string for password dialog. |
||||||
|
--- |
||||||
|
driver/dialog.c | 2 +- |
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-) |
||||||
|
|
||||||
|
diff --git a/driver/dialog.c b/driver/dialog.c |
||||||
|
index 9a8173f..3020880 100644 |
||||||
|
--- a/driver/dialog.c |
||||||
|
+++ b/driver/dialog.c |
||||||
|
@@ -959,7 +959,7 @@ window_init (Widget root_widget, Bool splash_p) |
||||||
|
*s = 0; |
||||||
|
ws->heading_label = (char *) malloc (100); |
||||||
|
ws->version = strdup(version); |
||||||
|
- sprintf (ws->heading_label, "XScreenSaver %.4s, v%.10s", year, version); |
||||||
|
+ sprintf (ws->heading_label, "XScreenSaver %.4s, v%.14s", year, version); |
||||||
|
|
||||||
|
if (splash_p) |
||||||
|
{ |
||||||
|
-- |
||||||
|
2.31.1 |
||||||
|
|
@ -0,0 +1,59 @@ |
|||||||
|
From 1c66f1de86cd3cd360cf3c8de371126a9e1e9fc9 Mon Sep 17 00:00:00 2001 |
||||||
|
From: XScreenSaver owners <xscreensaver-owner@fedoraproject.org> |
||||||
|
Date: Mon, 3 May 2021 21:33:26 +0900 |
||||||
|
Subject: [PATCH] fontglide.c: pick_font_1 exclude substitution rectagle glyph |
||||||
|
|
||||||
|
Currently (with using XFT) pick_font_1 picks up one font randomly |
||||||
|
from all installed fonts, according to XftListFonts. |
||||||
|
So when some non-latin fonts are installed and selected by pick_font_1, |
||||||
|
(e.g. Lohit-Gujarati.ttf: used for Gujarati language, part of India) |
||||||
|
such font may fail to show strings returned by xscreensaver-text |
||||||
|
correctly, and may show substitusion rectagle glyph. |
||||||
|
|
||||||
|
So to select a font which can show glyph properly, use XftCharExists |
||||||
|
(ref: blank_character_p in texfont.c) |
||||||
|
|
||||||
|
Also, to show debug message correctly with /* DEBUG */ defined, |
||||||
|
copy name2 to pattern. |
||||||
|
--- |
||||||
|
hacks/fontglide.c | 17 +++++++++++++++++ |
||||||
|
1 file changed, 17 insertions(+) |
||||||
|
|
||||||
|
diff --git a/hacks/fontglide.c b/hacks/fontglide.c |
||||||
|
index 3eff604..be1ac63 100644 |
||||||
|
--- a/hacks/fontglide.c |
||||||
|
+++ b/hacks/fontglide.c |
||||||
|
@@ -270,6 +270,7 @@ pick_font_1 (state *s, sentence *se) |
||||||
|
/* #### This gets a link error with FcFontSetDestroy missing. */ |
||||||
|
/* if (fs) XftFontSetDestroy (fs); */ |
||||||
|
|
||||||
|
+ sprintf(pattern, "%s", name2); |
||||||
|
se->xftfont = font; |
||||||
|
ok = True; |
||||||
|
goto DONE_2; |
||||||
|
@@ -571,6 +572,22 @@ pick_font_1 (state *s, sentence *se) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
+# if defined(HAVE_XFT) && !defined(HAVE_JWXYZ) /* Real Xft under real X11 */ |
||||||
|
+ { |
||||||
|
+ unsigned long uc = 0; |
||||||
|
+ utf8_decode ((const unsigned char *)"M", 1, &uc); |
||||||
|
+ if (!XftCharExists (s->dpy, se->xftfont, (FcChar32) uc)) |
||||||
|
+ { |
||||||
|
+# ifdef DEBUG |
||||||
|
+ if (s->debug_p) |
||||||
|
+ fprintf (stderr, "%s: skipping font returning substitution rectangle: %s\n", |
||||||
|
+ progname, pattern2); |
||||||
|
+#endif |
||||||
|
+ return False; |
||||||
|
+ } |
||||||
|
+ } |
||||||
|
+# endif |
||||||
|
+ |
||||||
|
|
||||||
|
# ifdef DEBUG |
||||||
|
if (s->debug_p) |
||||||
|
-- |
||||||
|
2.31.1 |
||||||
|
|
@ -0,0 +1,55 @@ |
|||||||
|
From 6c6c990727caa881b7b3f045dfaa0a167d347507 Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mamoru TASAKA <mtasaka@fedoraproject.org> |
||||||
|
Date: Tue, 4 May 2021 09:58:54 +0900 |
||||||
|
Subject: [PATCH] blurb: show 1/100 sec on linux |
||||||
|
|
||||||
|
--- |
||||||
|
driver/blurb.c | 24 +++++++++++++++++++++++- |
||||||
|
1 file changed, 23 insertions(+), 1 deletion(-) |
||||||
|
|
||||||
|
diff --git a/driver/blurb.c b/driver/blurb.c |
||||||
|
index d732a9b..010923b 100644 |
||||||
|
--- a/driver/blurb.c |
||||||
|
+++ b/driver/blurb.c |
||||||
|
@@ -28,8 +28,23 @@ blurb (void) |
||||||
|
struct tm tm; |
||||||
|
time_t now; |
||||||
|
int i; |
||||||
|
+#ifdef __linux__ |
||||||
|
+ struct timespec tp; |
||||||
|
+ unsigned int sec_per_100 = 0; |
||||||
|
+#endif |
||||||
|
+ |
||||||
|
+#ifdef __linux__ |
||||||
|
+ if ( (clock_gettime(CLOCK_REALTIME_COARSE, &tp)) == 0 ) |
||||||
|
+ { |
||||||
|
+ now = tp.tv_sec; |
||||||
|
+ sec_per_100 = tp.tv_nsec / 10000000; /* 10^9 / 10^7 */ |
||||||
|
+ } |
||||||
|
+ else |
||||||
|
+#endif |
||||||
|
+ { |
||||||
|
+ now = time ((time_t *) 0); |
||||||
|
+ } |
||||||
|
|
||||||
|
- now = time ((time_t *) 0); |
||||||
|
localtime_r (&now, &tm); |
||||||
|
i = strlen (progname); |
||||||
|
if (i > 40) i = 40; |
||||||
|
@@ -44,6 +59,13 @@ blurb (void) |
||||||
|
buf[i++] = ':'; |
||||||
|
buf[i++] = '0' + (tm.tm_sec >= 10 ? tm.tm_sec/10 : 0); |
||||||
|
buf[i++] = '0' + (tm.tm_sec % 10); |
||||||
|
+ |
||||||
|
+#ifdef __linux__ |
||||||
|
+ buf[i++] = '.'; |
||||||
|
+ buf[i++] = '0' + (sec_per_100 >= 10 ? sec_per_100/10 : 0); |
||||||
|
+ buf[i++] = '0' + (sec_per_100 % 10); |
||||||
|
+#endif |
||||||
|
+ |
||||||
|
buf[i] = 0; |
||||||
|
return buf; |
||||||
|
} |
||||||
|
-- |
||||||
|
2.31.1 |
||||||
|
|
@ -0,0 +1,100 @@ |
|||||||
|
From 63b985a5aae04b89f6a4357cb10dfeba9f482cd7 Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mamoru TASAKA <mtasaka@fedoraproject.org> |
||||||
|
Date: Tue, 6 Jul 2021 22:27:21 +0900 |
||||||
|
Subject: [PATCH 1/2] main_loop: consistently check init file after some |
||||||
|
activitity occurred. |
||||||
|
|
||||||
|
Current main_loop logic is: |
||||||
|
* Block until some activity happens or timeout happens, |
||||||
|
timeout is until last activity + blank_timeout |
||||||
|
* When block is released, if 60sec has already passed since the last |
||||||
|
time init file is checked, init file is checked again. |
||||||
|
|
||||||
|
So: |
||||||
|
* When a user has been editing init file for some long time, |
||||||
|
activity has been occuring. |
||||||
|
In this case, init file is checked every 60sec. |
||||||
|
* However when: |
||||||
|
- on "a" time init file is checked |
||||||
|
- user edits init file, shortly |
||||||
|
- then user stops activity |
||||||
|
then the edited init file won't checked until last activity + blank_timeout |
||||||
|
(because block won't be released until that time) |
||||||
|
|
||||||
|
This behavior is inconsistent. |
||||||
|
|
||||||
|
With this patch, |
||||||
|
* When block is released, if 45sec (instead of 60sec) has already passed since the last |
||||||
|
time init file is checked, init file is checked again. |
||||||
|
* When some activity happens, main_loop is next blocked until some activity |
||||||
|
happens or timeout, timeout is until last activity + 50sec, which |
||||||
|
is shorter than activity + blank_timeout, because blank_timeout is more than 60sec. |
||||||
|
|
||||||
|
Then when user stops activity, init file is checked again after 50sec (block is released), |
||||||
|
so it is guaranteed that init file change is checked before 1min, when user may expect |
||||||
|
blanking happens (when user changes init file so that blank should happen after 1 min). |
||||||
|
So this behavior is consistent. |
||||||
|
--- |
||||||
|
driver/xscreensaver.c | 13 +++++++++++-- |
||||||
|
1 file changed, 11 insertions(+), 2 deletions(-) |
||||||
|
|
||||||
|
diff --git a/driver/xscreensaver.c b/driver/xscreensaver.c |
||||||
|
index bfce5f7..24ea27c 100644 |
||||||
|
--- a/driver/xscreensaver.c |
||||||
|
+++ b/driver/xscreensaver.c |
||||||
|
@@ -1388,6 +1388,7 @@ main_loop (Display *dpy) |
||||||
|
time_t last_checked_init_file = now; |
||||||
|
Bool authenticated_p = False; |
||||||
|
Bool ignore_motion_p = False; |
||||||
|
+ Bool maybe_init_file_changed_p = False; |
||||||
|
|
||||||
|
enum { UNBLANKED, BLANKED, LOCKED, AUTH } current_state = UNBLANKED; |
||||||
|
|
||||||
|
@@ -1471,7 +1472,12 @@ main_loop (Display *dpy) |
||||||
|
struct timeval tv; |
||||||
|
time_t until; |
||||||
|
switch (current_state) { |
||||||
|
- case UNBLANKED: until = active_at + blank_timeout; break; |
||||||
|
+ case UNBLANKED: |
||||||
|
+ { |
||||||
|
+ until = active_at + blank_timeout; |
||||||
|
+ if (maybe_init_file_changed_p) until = active_at + 50; |
||||||
|
+ break; |
||||||
|
+ } |
||||||
|
case BLANKED: until = blanked_at + lock_timeout; break; |
||||||
|
default: until = 0; |
||||||
|
} |
||||||
|
@@ -1502,6 +1508,7 @@ main_loop (Display *dpy) |
||||||
|
} |
||||||
|
|
||||||
|
now = time ((time_t *) 0); |
||||||
|
+ maybe_init_file_changed_p = False; |
||||||
|
|
||||||
|
|
||||||
|
/******************************************************************** |
||||||
|
@@ -1566,6 +1573,7 @@ main_loop (Display *dpy) |
||||||
|
XEvent xev; |
||||||
|
XNextEvent (dpy, &xev); |
||||||
|
now = time ((time_t *) 0); |
||||||
|
+ maybe_init_file_changed_p = True; |
||||||
|
|
||||||
|
/**************************************************************** |
||||||
|
Client Messages |
||||||
|
@@ -1905,12 +1913,13 @@ main_loop (Display *dpy) |
||||||
|
/* If it's time, see if the .xscreensaver file has changed, since that |
||||||
|
might change the blank and lock timeouts. |
||||||
|
*/ |
||||||
|
- if (now >= last_checked_init_file + 60) |
||||||
|
+ if (now >= last_checked_init_file + 45) |
||||||
|
{ |
||||||
|
last_checked_init_file = now; |
||||||
|
if (verbose_p) |
||||||
|
fprintf(stderr,"%s: checking init file\n", blurb()); |
||||||
|
read_init_files (False); |
||||||
|
+ maybe_init_file_changed_p = False; |
||||||
|
} |
||||||
|
|
||||||
|
/* Now that events have been processed, see if the state should change, |
||||||
|
-- |
||||||
|
2.31.1 |
||||||
|
|
@ -0,0 +1,95 @@ |
|||||||
|
From 721236d9406c5ecba9e95edff6f4105799968596 Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mamoru TASAKA <mtasaka@fedoraproject.org> |
||||||
|
Date: Tue, 6 Jul 2021 23:38:11 +0900 |
||||||
|
Subject: [PATCH 2/2] main_loop: check init file saver_mode |
||||||
|
|
||||||
|
With xscreensaver 6 saver/gfx split, -gfx checks saver_mode, but |
||||||
|
currently saver does not check saver_mode. |
||||||
|
As a result, even if user has set saver_mode to "off" in init file, |
||||||
|
saver will blank screen. |
||||||
|
|
||||||
|
With this patch, saver will check saver_mode again. |
||||||
|
--- |
||||||
|
driver/xscreensaver.c | 24 +++++++++++++++++++++++- |
||||||
|
1 file changed, 23 insertions(+), 1 deletion(-) |
||||||
|
|
||||||
|
diff --git a/driver/xscreensaver.c b/driver/xscreensaver.c |
||||||
|
index 24ea27c..1c88a00 100644 |
||||||
|
--- a/driver/xscreensaver.c |
||||||
|
+++ b/driver/xscreensaver.c |
||||||
|
@@ -140,6 +140,7 @@ |
||||||
|
#include <X11/cursorfont.h> |
||||||
|
#include <X11/Xos.h> |
||||||
|
#include <X11/extensions/XInput2.h> |
||||||
|
+#include <X11/Intrinsic.h> |
||||||
|
|
||||||
|
#include "xmu.h" |
||||||
|
#include "blurb.h" |
||||||
|
@@ -147,6 +148,7 @@ |
||||||
|
#include "clientmsg.h" |
||||||
|
#include "xinput.h" |
||||||
|
#include "prefs.h" |
||||||
|
+#include "types.h" |
||||||
|
|
||||||
|
|
||||||
|
#undef countof |
||||||
|
@@ -171,6 +173,7 @@ static Bool locking_disabled_p = False; |
||||||
|
static unsigned int blank_timeout = 0; |
||||||
|
static unsigned int lock_timeout = 0; |
||||||
|
static unsigned int pointer_hysteresis = 0; |
||||||
|
+static saver_mode mode_pref = ONE_HACK; |
||||||
|
|
||||||
|
/* Subprocesses. */ |
||||||
|
#define SAVER_GFX_PROGRAM "xscreensaver-gfx" |
||||||
|
@@ -677,6 +680,19 @@ parse_time (const char *string) |
||||||
|
return ((h * 60 * 60) + (m * 60) + s); |
||||||
|
} |
||||||
|
|
||||||
|
+/* Mostly copied from prefsw.c. |
||||||
|
+*/ |
||||||
|
+static int |
||||||
|
+parse_mode (const char *s) |
||||||
|
+{ |
||||||
|
+ /* most copied from */ |
||||||
|
+ if (s && !strcasecmp (s, "one")) return ONE_HACK; |
||||||
|
+ else if (s && !strcasecmp (s, "blank")) return BLANK_ONLY; |
||||||
|
+ else if (s && !strcasecmp (s, "off")) return DONT_BLANK; |
||||||
|
+ else if (s && !strcasecmp (s, "random-same")) return RANDOM_HACKS_SAME; |
||||||
|
+ else return RANDOM_HACKS; |
||||||
|
+} |
||||||
|
+ |
||||||
|
|
||||||
|
/* This program only needs a very few options from the init file, so it |
||||||
|
just reads the .ad file and the .xscreensaver file directly rather |
||||||
|
@@ -705,6 +721,7 @@ static void init_line_handler (int lineno, |
||||||
|
if (i >= 0) |
||||||
|
pointer_hysteresis = i; |
||||||
|
} |
||||||
|
+ if (!strcmp (key, "mode")) mode_pref = parse_mode(val); |
||||||
|
} |
||||||
|
|
||||||
|
static void |
||||||
|
@@ -1947,7 +1964,8 @@ main_loop (Display *dpy) |
||||||
|
force_lock_p = False; /* Single shot */ |
||||||
|
} |
||||||
|
else if (force_blank_p || |
||||||
|
- now >= active_at + blank_timeout) |
||||||
|
+ ((mode_pref != DONT_BLANK) && |
||||||
|
+ (now >= active_at + blank_timeout))) |
||||||
|
{ |
||||||
|
fprintf (stderr, "%s: blanking\n", blurb()); |
||||||
|
if (grab_keyboard_and_mouse (mouse_screen (dpy))) |
||||||
|
@@ -1960,6 +1978,10 @@ main_loop (Display *dpy) |
||||||
|
fprintf (stderr, "%s: unable to grab -- blanking aborted!\n", |
||||||
|
blurb()); |
||||||
|
} |
||||||
|
+ else if ((mode_pref == DONT_BLANK) && (now >= active_at + blank_timeout)) |
||||||
|
+ { |
||||||
|
+ fprintf (stderr, "%s: blanking disabled\n", blurb()); |
||||||
|
+ } |
||||||
|
|
||||||
|
if (current_state == BLANKED || current_state == LOCKED) |
||||||
|
{ |
||||||
|
-- |
||||||
|
2.31.1 |
||||||
|
|
@ -0,0 +1,97 @@ |
|||||||
|
From fc353003f93883bf62a9865472e6f206a62b09f1 Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mamoru TASAKA <mtasaka@fedoraproject.org> |
||||||
|
Date: Thu, 8 Jul 2021 23:06:46 +0900 |
||||||
|
Subject: [PATCH] window_init: check if asterisk font is available and provide |
||||||
|
fallback character |
||||||
|
|
||||||
|
Downstream bug: https://bugzilla.redhat.com/show_bug.cgi?id=1980173 |
||||||
|
On Fedora 34, using US locale (LANG=en_US.UTF-8), when both |
||||||
|
"dejavu-sans-fonts" and "bitstream-vera-sans-fonts" rpms are installed, |
||||||
|
* xscreensaver-auth requests "sans-serif" to xft |
||||||
|
* xft chooses bitstream-vera-sans (according to fontconfig settings) |
||||||
|
45-latin.conf seems to be saying so. |
||||||
|
* gucharmap shows that while "dejavu-sans-fonts" contains glyph for "U+25CF", |
||||||
|
however bitstream-vera-sans-fonts does not. |
||||||
|
Then such people sees white rectangles when typing password. |
||||||
|
|
||||||
|
For now, check if corresponding font is available, and if not, provide |
||||||
|
fallback character |
||||||
|
--- |
||||||
|
driver/dialog.c | 33 ++++++++++++++++++++++++++++++--- |
||||||
|
1 file changed, 30 insertions(+), 3 deletions(-) |
||||||
|
|
||||||
|
diff --git a/driver/dialog.c b/driver/dialog.c |
||||||
|
index 7f1ec8b..a17e9af 100644 |
||||||
|
--- a/driver/dialog.c |
||||||
|
+++ b/driver/dialog.c |
||||||
|
@@ -79,6 +79,7 @@ |
||||||
|
#include "font-retry.h" |
||||||
|
#include "prefs.h" |
||||||
|
#include "usleep.h" |
||||||
|
+#include "utf8wc.h" |
||||||
|
|
||||||
|
extern Bool debug_p; |
||||||
|
|
||||||
|
@@ -193,6 +194,7 @@ struct window_state { |
||||||
|
char *date_format; |
||||||
|
char *kbd_layout_label; |
||||||
|
char *newlogin_cmd; |
||||||
|
+ const char *asterisk_utf8; |
||||||
|
|
||||||
|
/* Resources for fonts and colors */ |
||||||
|
XftDraw *xftdraw; |
||||||
|
@@ -674,6 +676,31 @@ get_int (window_state *ws, const char *name, const char *rclass) |
||||||
|
return get_integer_resource (ws->dpy, (char *) name, (char *) rclass); |
||||||
|
} |
||||||
|
|
||||||
|
+static const char *pickup_asterisk_utf8 (window_state *ws) |
||||||
|
+{ |
||||||
|
+ static char picked_string[8]; |
||||||
|
+ const unsigned long uc_list[] = { |
||||||
|
+ 0x25CF, /* Black Circle */ |
||||||
|
+ 0x2022, /* Bullet */ |
||||||
|
+ '*' /* Fallback */ |
||||||
|
+ }; |
||||||
|
+ const unsigned long *uc_cand = uc_list; |
||||||
|
+ int encoded_length; |
||||||
|
+ size_t index; |
||||||
|
+ |
||||||
|
+ /* -1 is so that result will pick up fallback string as a last resort */ |
||||||
|
+ for (index = 0; index < sizeof uc_list / sizeof *uc_list - 1; index++) { |
||||||
|
+ /* borrowed from blank_character_p in texfont.c */ |
||||||
|
+ if (XftCharExists (ws->dpy, ws->label_font, (FcChar32) *uc_cand)) break; |
||||||
|
+ uc_cand++; |
||||||
|
+ } |
||||||
|
+ |
||||||
|
+ encoded_length = utf8_encode(*uc_cand, picked_string, sizeof picked_string - 1); |
||||||
|
+ picked_string[encoded_length] = 0; |
||||||
|
+ |
||||||
|
+ return picked_string; |
||||||
|
+} |
||||||
|
+ |
||||||
|
|
||||||
|
/* Decide where on the X11 screen to place the dialog. |
||||||
|
This is complicated because, in the face of RANDR and Xinerama, we want |
||||||
|
@@ -983,6 +1010,8 @@ window_init (Widget root_widget, Bool splash_p) |
||||||
|
ws->label_font = get_font (ws, "labelFont"); |
||||||
|
ws->date_font = get_font (ws, "dateFont"); |
||||||
|
ws->hostname_font = get_font (ws, "unameFont"); |
||||||
|
+ |
||||||
|
+ ws->asterisk_utf8 = pickup_asterisk_utf8(ws); |
||||||
|
|
||||||
|
ws->foreground = get_color (ws, "foreground", "Foreground"); |
||||||
|
ws->background = get_color (ws, "background", "Background"); |
||||||
|
@@ -2003,9 +2032,7 @@ handle_keypress (window_state *ws, XKeyEvent *event) |
||||||
|
*out = 0; |
||||||
|
for (i = 0; i < MAX_PASSWD_CHARS && ws->plaintext_passwd_char_size[i]; i++) |
||||||
|
{ |
||||||
|
- const char *b = /* "\xE2\x80\xA2"; */ /* U+2022 Bullet */ |
||||||
|
- "\xe2\x97\x8f"; /* U+25CF Black Circle */ |
||||||
|
- strcat (out, b); |
||||||
|
+ strcat (out, ws->asterisk_utf8); |
||||||
|
out += strlen(out); |
||||||
|
} |
||||||
|
} |
||||||
|
-- |
||||||
|
2.31.1 |
||||||
|
|
@ -0,0 +1,56 @@ |
|||||||
|
From 6af675deb2bac3cce2dcdb9b19cce23d946d680a Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mamoru TASAKA <mtasaka@fedoraproject.org> |
||||||
|
Date: Sun, 11 Jul 2021 14:28:57 +0900 |
||||||
|
Subject: [PATCH] destroy_window: check ws->xftdraw to avoid nullptr |
||||||
|
dereference |
||||||
|
|
||||||
|
Downstream report: |
||||||
|
https://bugzilla.redhat.com/show_bug.cgi?id=1966287 |
||||||
|
|
||||||
|
There was a bug report that xscreensaver-auth segfaults that |
||||||
|
" |
||||||
|
when resuming from suspension, sometimes the screen is |
||||||
|
blank and only the cursor is visible and responds to movement. |
||||||
|
" |
||||||
|
and crash detector says xscreensaver-auth was segfaulting like: |
||||||
|
|
||||||
|
=================================================================== |
||||||
|
(gdb) bt |
||||||
|
#0 0x00007f83a9a46715 in XftDrawDestroy (draw=0x0) at |
||||||
|
/usr/src/debug/libXft-2.3.3-6.fc34.x86_64/src/xftdraw.c:278 |
||||||
|
#1 0x000055d0754f9c6e in destroy_window (ws=0x55d076c04c80) at |
||||||
|
../../driver/dialog.c:1764 |
||||||
|
#2 0x000055d07550027e in xscreensaver_auth_finished (closure=<optimized out>, |
||||||
|
authenticated_p=<optimized out>) at ../../driver/dialog.c:2499 |
||||||
|
#3 0x000055d0754f5e16 in xscreensaver_auth (conv_fn=<optimized out>, |
||||||
|
finished_fn=<optimized out>, closure=<optimized out>) at |
||||||
|
../../driver/passwd.c:266 |
||||||
|
#4 main (argc=<optimized out>, argv=<optimized out>) at |
||||||
|
../../driver/xscreensaver-auth.c:324 |
||||||
|
=================================================================== |
||||||
|
|
||||||
|
This means that when doing "XftDrawDestroy (ws->xftdraw);" in destroy_window(), |
||||||
|
ws->xftdraw is null. |
||||||
|
|
||||||
|
Currently I cannot figure out why this can happen, however for now |
||||||
|
I add a nullptr check to avoid this... |
||||||
|
--- |
||||||
|
driver/dialog.c | 2 +- |
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-) |
||||||
|
|
||||||
|
diff --git a/driver/dialog.c b/driver/dialog.c |
||||||
|
index a17e9af..1f2c957 100644 |
||||||
|
--- a/driver/dialog.c |
||||||
|
+++ b/driver/dialog.c |
||||||
|
@@ -1790,7 +1790,7 @@ destroy_window (window_state *ws) |
||||||
|
XftColorFree (ws->dpy, DefaultVisualOfScreen (ws->screen), |
||||||
|
DefaultColormapOfScreen (ws->screen), |
||||||
|
&ws->xft_error_foreground); |
||||||
|
- XftDrawDestroy (ws->xftdraw); |
||||||
|
+ if (ws->xftdraw) XftDrawDestroy (ws->xftdraw); |
||||||
|
|
||||||
|
# if 0 /* screw this, we're exiting anyway */ |
||||||
|
if (ws->foreground != black && ws->foreground != white) |
||||||
|
-- |
||||||
|
2.31.1 |
||||||
|
|
Loading…
Reference in new issue