mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-16 19:50:19 +01:00
games/gtetrinet: Fix UI lockups.
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
4d54b6821f
commit
03a9357b96
3 changed files with 63 additions and 1 deletions
32
games/gtetrinet/cli_opts.diff
Normal file
32
games/gtetrinet/cli_opts.diff
Normal file
|
@ -0,0 +1,32 @@
|
|||
diff -Naur gtetrinet-0.8.0_20220828_6d816ee.orig/src/gtetrinet.c gtetrinet-0.8.0_20220828_6d816ee/src/gtetrinet.c
|
||||
--- gtetrinet-0.8.0_20220828_6d816ee.orig/src/gtetrinet.c 2023-02-10 14:01:33.000000000 -0500
|
||||
+++ gtetrinet-0.8.0_20220828_6d816ee/src/gtetrinet.c 2023-02-13 01:31:08.820702289 -0500
|
||||
@@ -76,13 +76,13 @@
|
||||
GSettings* settings_keys;
|
||||
GSettings* settings_themes;
|
||||
|
||||
-static const struct poptOption options[] = {
|
||||
- {"connect", 'c', POPT_ARG_STRING, &option_connect, 0, ("Connect to server"), ("SERVER")},
|
||||
- {"nickname", 'n', POPT_ARG_STRING, &option_nick, 0, ("Set nickname to use"), ("NICKNAME")},
|
||||
- {"team", 't', POPT_ARG_STRING, &option_team, 0, ("Set team name"), ("TEAM")},
|
||||
- {"spectate", 's', POPT_ARG_NONE, &option_spec, 0, ("Connect as a spectator"), NULL},
|
||||
- {"password", 'p', POPT_ARG_STRING, &option_pass, 0, ("Spectator password"), ("PASSWORD")},
|
||||
- {NULL, 0, 0, NULL, 0, NULL, NULL}
|
||||
+static const GOptionEntry options[] = {
|
||||
+ {"connect", 'c', 0, G_OPTION_ARG_STRING, &option_connect, ("Connect to server"), ("SERVER")},
|
||||
+ {"nickname", 'n', 0, G_OPTION_ARG_STRING, &option_nick, ("Set nickname to use"), ("NICKNAME")},
|
||||
+ {"team", 't', 0, G_OPTION_ARG_STRING, &option_team, ("Set team name"), ("TEAM")},
|
||||
+ {"spectate", 's', 0, G_OPTION_ARG_NONE, &option_spec, ("Connect as a spectator"), NULL},
|
||||
+ {"password", 'p', 0, G_OPTION_ARG_STRING, &option_pass, ("Spectator password"), ("PASSWORD")},
|
||||
+ {NULL, 0, 0, 0, NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
static int gtetrinet_poll_func(GPollFD *passed_fds,
|
||||
@@ -134,7 +134,6 @@
|
||||
argc, argv, GNOME_PARAM_POPT_TABLE, options,
|
||||
GNOME_PARAM_NONE);
|
||||
*/
|
||||
- GOptionEntry options[] = { {NULL}};
|
||||
if (!gtk_init_with_args(&argc,&argv,"gtetrinet",options,NULL,&err))
|
||||
{
|
||||
fprintf (stderr, "Failed to init GTK: %s\n", err->message);
|
|
@ -12,11 +12,15 @@
|
|||
# so I never bothered making a SlackBuild for it. Thanks to r0ni for
|
||||
# finding this gtk3 port of it.
|
||||
|
||||
# 20230213 bkw: BUILD=2
|
||||
# - add nolockup.diff
|
||||
# - fix command-line options
|
||||
|
||||
cd $(dirname $0) ; CWD=$(pwd)
|
||||
|
||||
PRGNAM=gtetrinet
|
||||
VERSION=${VERSION:-0.8.0_20220828_6d816ee}
|
||||
BUILD=${BUILD:-1}
|
||||
BUILD=${BUILD:-2}
|
||||
TAG=${TAG:-_SBo}
|
||||
PKGTYPE=${PKGTYPE:-tgz}
|
||||
|
||||
|
@ -63,6 +67,20 @@ chown -R root:root .
|
|||
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
|
||||
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
|
||||
|
||||
# Reinstate the command-line options, which were removed when porting
|
||||
# from GNOME to Gtk3.
|
||||
patch -p1 < $CWD/cli_opts.diff
|
||||
|
||||
# If gtetrinet tries to connect in TetriFAST mode to a server
|
||||
# that doesn't support TetriFAST, the server will drop the
|
||||
# connection immediately. This patch prevents gtetrinet's UI
|
||||
# from going completely unresponsive if that happens: now we'll
|
||||
# get a "connecting..." dialog with a Cancel button that actually
|
||||
# works. There is surely a better way to fix it (have it actually pop
|
||||
# up a "Server doesn't support TetriFAST" dialog), but this is a tiny
|
||||
# change to the code and works well enough.
|
||||
patch -p1 < $CWD/nolockup.diff
|
||||
|
||||
# desktop-file-validate complains a bit... also use absolute path
|
||||
# to binary.
|
||||
sed -i -e 's,GNOME;Application;,,' \
|
||||
|
|
12
games/gtetrinet/nolockup.diff
Normal file
12
games/gtetrinet/nolockup.diff
Normal file
|
@ -0,0 +1,12 @@
|
|||
diff -Naur gtetrinet-0.8.0_20220828_6d816ee.orig/src/client.c gtetrinet-0.8.0_20220828_6d816ee/src/client.c
|
||||
--- gtetrinet-0.8.0_20220828_6d816ee.orig/src/client.c 2023-02-10 14:01:33.000000000 -0500
|
||||
+++ gtetrinet-0.8.0_20220828_6d816ee/src/client.c 2023-02-12 23:55:28.980242462 -0500
|
||||
@@ -431,6 +431,8 @@
|
||||
{
|
||||
case G_IO_STATUS_EOF :
|
||||
g_warning ("End of file (server closed connection).");
|
||||
+ connected = 1;
|
||||
+ client_disconnect();
|
||||
return -1;
|
||||
break;
|
||||
|
Loading…
Reference in a new issue