From bab82948507dacfff804e11e376b00d7a5e12f04 Mon Sep 17 00:00:00 2001 From: Logan Rathbone Date: Sat, 4 Feb 2023 07:51:04 -0500 Subject: Prevent ZENITY_TIMEOUT from clashing with custom response IDs Redefine ZENITY_TIMEOUT response ID as INT_MAX Also, add and use ZENITY_TIMEOUT_DEFAULT exit status (hardcoded to 5 to keep consistent with what it has happened to be for the entire 3.x release cycle; POLA and all). See #48 --- src/zenity.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/zenity.h') diff --git a/src/zenity.h b/src/zenity.h index 404eec77..c50a76bd 100644 --- a/src/zenity.h +++ b/src/zenity.h @@ -33,7 +33,14 @@ typedef enum { ZENITY_ESC, ZENITY_ERROR, ZENITY_EXTRA, - ZENITY_TIMEOUT + /* Previously, this was not specified to any value, which could cause it to + * clash with the custom response ID that happened to match it. We could set + * this to a negative value tha doesn't clash with one of GtkDialog's + * predefined response ID's as it's doubtful GTK will ever extend the GtkDialog + * API at this stage -- but technically negative values are reserved for the + * library and positive values for applications, according to gtkdialog.c + */ + ZENITY_TIMEOUT = INT_MAX } ZenityExitCode; typedef struct { -- cgit