accessibility/mag: Fix all-black window bug.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
0e2fe6403b
commit
4f82040ebc
|
@ -1,8 +1,5 @@
|
||||||
.\" Man page generated from reStructuredText.
|
.\" Man page generated from reStructuredText.
|
||||||
.
|
.
|
||||||
.TH MAG 1 "2020-11-01" "20100913" "SlackBuilds.org"
|
|
||||||
.SH NAME
|
|
||||||
mag \- dynamic X11 screen magnifier
|
|
||||||
.
|
.
|
||||||
.nr rst2man-indent-level 0
|
.nr rst2man-indent-level 0
|
||||||
.
|
.
|
||||||
|
@ -30,6 +27,9 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
||||||
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
||||||
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
|
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
|
||||||
..
|
..
|
||||||
|
.TH "MAG" 1 "2021-12-07" "20100913" "SlackBuilds.org"
|
||||||
|
.SH NAME
|
||||||
|
mag \- dynamic X11 screen magnifier
|
||||||
.\" RST source for mag(1) man page. Convert with:
|
.\" RST source for mag(1) man page. Convert with:
|
||||||
.
|
.
|
||||||
.\" rst2man.py mag.rst > mag.1
|
.\" rst2man.py mag.rst > mag.1
|
||||||
|
@ -49,16 +49,16 @@ furthest corner away from the mouse. Without, you can grab it and move it as you
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
.B \-s
|
.B \-s
|
||||||
small window.
|
small window.
|
||||||
.TP
|
.TP
|
||||||
.B \-m
|
.B \-m
|
||||||
medium window.
|
medium window.
|
||||||
.TP
|
.TP
|
||||||
.B \-l
|
.B \-l
|
||||||
large window.
|
large window.
|
||||||
.TP
|
.TP
|
||||||
.B \-d
|
.B \-d
|
||||||
Dynamic placement.
|
Dynamic placement.
|
||||||
.TP
|
.TP
|
||||||
.BI \-z \ n
|
.BI \-z \ n
|
||||||
|
@ -70,6 +70,10 @@ Original X placement.
|
||||||
.BI \-y \ Ycoord
|
.BI \-y \ Ycoord
|
||||||
Original Y placement.
|
Original Y placement.
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
|
.SH BUGS
|
||||||
|
.sp
|
||||||
|
There is no way to exit \fBmag\fP normally. Use e.g. \fBkillall mag\fP or
|
||||||
|
\fBxkill\fP to force it to quit.
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
.sp
|
.sp
|
||||||
mag was written by Danny Chouinard.
|
mag was written by Danny Chouinard.
|
||||||
|
|
|
@ -8,11 +8,15 @@
|
||||||
|
|
||||||
# VERSION comes from the last modified date on the homepage.
|
# VERSION comes from the last modified date on the homepage.
|
||||||
|
|
||||||
|
# 20211207 bkw: BUILD=2
|
||||||
|
# - fix blank window on -current (it shouldn't have worked on 14.2 either).
|
||||||
|
# - add BUGS to man page (no way to exit mag).
|
||||||
|
|
||||||
cd $(dirname $0) ; CWD=$(pwd)
|
cd $(dirname $0) ; CWD=$(pwd)
|
||||||
|
|
||||||
PRGNAM=mag
|
PRGNAM=mag
|
||||||
VERSION=${VERSION:-20100913}
|
VERSION=${VERSION:-20100913}
|
||||||
BUILD=${BUILD:-1}
|
BUILD=${BUILD:-2}
|
||||||
TAG=${TAG:-_SBo}
|
TAG=${TAG:-_SBo}
|
||||||
PKGTYPE=${PKGTYPE:-tgz}
|
PKGTYPE=${PKGTYPE:-tgz}
|
||||||
|
|
||||||
|
@ -54,7 +58,22 @@ set -e
|
||||||
# In case you're wondering, -Wl,-s builds a stripped binary.
|
# In case you're wondering, -Wl,-s builds a stripped binary.
|
||||||
rm -rf $PKG
|
rm -rf $PKG
|
||||||
mkdir -p $PKG/usr/bin $OUTPUT
|
mkdir -p $PKG/usr/bin $OUTPUT
|
||||||
|
|
||||||
|
cd $PKG
|
||||||
|
|
||||||
|
# 20211207 bkw: we *do* have to patch it now, and we don't want
|
||||||
|
# to write to $CWD, so:
|
||||||
|
cat $CWD/$PRGNAM.c > $PRGNAM.c
|
||||||
|
|
||||||
|
# 20211207 bkw: silly mistake in the code: it was calling
|
||||||
|
# XDestroyImage(ximage) before the for loop that *uses* ximage.
|
||||||
|
# On 14.2's X, this was equivalent to a use-after-free, and worked
|
||||||
|
# accidentally most (or even all) of the time, but on -current's X,
|
||||||
|
# it results in a blank (all-black) window.
|
||||||
|
patch -p0 < $CWD/xdestroyimage.diff
|
||||||
|
|
||||||
gcc $SLKCFLAGS -Wl,-s -o $PKG/usr/bin/$PRGNAM $PRGNAM.c -lX11
|
gcc $SLKCFLAGS -Wl,-s -o $PKG/usr/bin/$PRGNAM $PRGNAM.c -lX11
|
||||||
|
rm $PRGNAM.c
|
||||||
|
|
||||||
# Man page written by SlackBuild author. Please don't include mag.rst
|
# Man page written by SlackBuild author. Please don't include mag.rst
|
||||||
# in the package, it's the source for the man page only.
|
# in the package, it's the source for the man page only.
|
||||||
|
|
|
@ -43,6 +43,12 @@ OPTIONS
|
||||||
-x Xcoord Original X placement.
|
-x Xcoord Original X placement.
|
||||||
-y Ycoord Original Y placement.
|
-y Ycoord Original Y placement.
|
||||||
|
|
||||||
|
BUGS
|
||||||
|
====
|
||||||
|
|
||||||
|
There is no way to exit **mag** normally. Use e.g. **killall mag** or
|
||||||
|
**xkill** to force it to quit.
|
||||||
|
|
||||||
AUTHORS
|
AUTHORS
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
--- mag.c 2010-09-13 13:56:43.000000000 -0400
|
||||||
|
+++ mag.c.fixed 2021-12-07 23:23:49.729231259 -0500
|
||||||
|
@@ -174,7 +174,6 @@
|
||||||
|
ximage=XGetImage(display,root,x-sx,y-sy,width/zoom,height/zoom,AllPlanes,ZPixmap);
|
||||||
|
// fprintf(stderr,"XGetImage returns:%d\n",(int)ximage);
|
||||||
|
// XPutImage(display,main_win,the_GC,ximage,0,0,0,0,width,height);
|
||||||
|
- XDestroyImage(ximage);
|
||||||
|
for(sx=0;sx<width/zoom;sx++) {
|
||||||
|
for(sy=0;sy<height/zoom;sy++) {
|
||||||
|
pix=XGetPixel(ximage,sx,sy);
|
||||||
|
@@ -186,6 +185,7 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ XDestroyImage(ximage);
|
||||||
|
XFlush(display);
|
||||||
|
} else {
|
||||||
|
usleep(30000);
|
Loading…
Reference in New Issue