...to avoid taking either of the <then> or <else> branches on timeout.
#include <wayland-client.h>
#include <wayland-cursor.h>
#include <wlr/util/log.h>
+#include "action-prompt-codes.h"
#include "pool-buffer.h"
#include "cursor-shape-v1-client-protocol.h"
#include "wlr-layer-shell-unstable-v1-client-protocol.h"
#define LABNAG_MAX_HEIGHT 500
-#define LAB_EXIT_FAILURE 255
-#define LAB_EXIT_SUCCESS 0
struct conf {
PangoFontDescription *font_description;
wl_display_cancel_read(nag->display);
}
if (nag->pollfds[FD_TIMER].revents & POLLIN) {
+ exit_status = LAB_EXIT_TIMEOUT;
break;
}
if (nag->pollfds[FD_SIGNAL].revents & POLLIN) {
server_protos,
epoll_dep,
],
+ include_directories: [labwc_inc],
install: true
)
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef LABWC_ACTION_PROMPT_CODES_H
+#define LABWC_ACTION_PROMPT_CODES_H
+
+#define LAB_EXIT_FAILURE 255
+#define LAB_EXIT_TIMEOUT 254
+#define LAB_EXIT_SUCCESS 0
+
+#endif /* LABWC_ACTION_PROMPT_CODES_H */
#include <unistd.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/util/log.h>
+#include "action-prompt-codes.h"
#include "common/macros.h"
#include "common/list.h"
#include "common/mem.h"
wlr_log(WLR_INFO, "Found pending prompt for exit code %d", exit_code);
struct wl_list *actions = NULL;
- if (exit_code == 0) {
+ if (exit_code == LAB_EXIT_SUCCESS) {
wlr_log(WLR_INFO, "Selected the 'then' branch");
actions = action_get_actionlist(prompt->action, "then");
+ } else if (exit_code == LAB_EXIT_TIMEOUT) {
+ /* no-op */
} else {
wlr_log(WLR_INFO, "Selected the 'else' branch");
actions = action_get_actionlist(prompt->action, "else");