diff options
author | B. Watson <urchlay@slackware.uk> | 2023-05-17 15:34:59 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-05-20 11:17:50 +0700 |
commit | 6f1d2d54cdd064448d5baa4cbc4b13f46ffa5372 (patch) | |
tree | d2e840e2d73def6512d250df22e4d74fa01aab83 /system | |
parent | 865dfb9fe2f3b157cc4ed70570c42d8ad246e4a6 (diff) |
system/xtrs: Fix window close button.
Signed-off-by: B. Watson <urchlay@slackware.uk>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r-- | system/xtrs/README | 3 | ||||
-rw-r--r-- | system/xtrs/window_close.diff | 35 | ||||
-rw-r--r-- | system/xtrs/xtrs.SlackBuild | 10 |
3 files changed, 44 insertions, 4 deletions
diff --git a/system/xtrs/README b/system/xtrs/README index b5ae112c6d6c..25afdd811be5 100644 --- a/system/xtrs/README +++ b/system/xtrs/README @@ -9,6 +9,3 @@ density, and even hard disk drives. A simple xtrs.desktop file is included that will start xtrs with the default options. Read the included 'xtrs' man page after installation for more information and command-line options. - -Note for first-time users: press F8 to exit xtrs. The regular -window-close button is non-functional. diff --git a/system/xtrs/window_close.diff b/system/xtrs/window_close.diff new file mode 100644 index 000000000000..96bef4e05ec6 --- /dev/null +++ b/system/xtrs/window_close.diff @@ -0,0 +1,35 @@ +diff -Naur xtrs-4.9d/trs_xinterface.c xtrs-4.9d.patched/trs_xinterface.c +--- xtrs-4.9d/trs_xinterface.c 2009-06-15 23:23:09.000000000 -0400 ++++ xtrs-4.9d.patched/trs_xinterface.c 2023-05-17 15:31:29.237827697 -0400 +@@ -730,6 +730,7 @@ + Colormap color_map; + XColor cdef; + XGCValues gcvals; ++ Atom wm_delete_window; + char *fontname = NULL; + char *widefontname = NULL; + int len; +@@ -737,6 +738,7 @@ + + screen = DefaultScreen(display); + color_map = DefaultColormap(display,screen); ++ wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", False); + + (void) sprintf(option, "%s%s", program_name, ".foreground"); + if (XrmGetResource(x_db, option, "Xtrs.Foreground", &type, &value)) { +@@ -937,6 +939,7 @@ + trs_fix_size(window, OrigWidth, OrigHeight); + XStoreName(display,window,title); + XSelectInput(display, window, EVENT_MASK); ++ XSetWMProtocols(display, window, &wm_delete_window, 1); + + (void) sprintf(option, "%s%s", program_name, ".iconic"); + if (XrmGetResource(x_db, option, "Xtrs.Iconic", &type, &value)) { +@@ -1002,6 +1005,7 @@ + if (wait) { + XNextEvent(display, &event); + } else { ++ if (XCheckTypedEvent(display, ClientMessage, &event)) trs_exit(); + if (!XCheckMaskEvent(display, ~0, &event)) return; + } + diff --git a/system/xtrs/xtrs.SlackBuild b/system/xtrs/xtrs.SlackBuild index fc6a154f337d..c0d9fb78d0f7 100644 --- a/system/xtrs/xtrs.SlackBuild +++ b/system/xtrs/xtrs.SlackBuild @@ -7,6 +7,10 @@ # There was no license on the original version. Modified version is # licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. +# 20230517 bkw: BUILD=4 +# - include patch from Jens Guenther (sdltrs upstream maintainer) to +# make the window close button work. + # 20230418 bkw: BUILD=3 # - new maintainer. # - use ROMs from trs80-roms package by default. @@ -21,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=xtrs VERSION=${VERSION:-4.9d} -BUILD=${BUILD:-3} +BUILD=${BUILD:-4} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -72,6 +76,10 @@ find . -type f -a -exec chmod 644 {} + -o \ # - use correct app-defaults dir. patch -p1 < $CWD/sbo.diff +# 20230517 bkw: Jens Guenther's "quick and dirty" patch to make the +# windowmanager's close button work. Many thanks! +patch -p1 < $CWD/window_close.diff + # 20230418 bkw: the -laoss here allows xtrs to make sound via ALSA # or PulseAudio (via /etc/asound.conf). make DEBUG="$SLKCFLAGS" EXTRALIBS="-laoss" |