aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>2022-05-02 13:54:18 +0200
committerVasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>2022-05-04 21:54:37 +0000
commit22f8d43e5859401260a4c1dcaf1fa144e54d396a (patch)
treece6f980471d891279561f55d45a5cfbd91c20a75
parent6ebbb41822da663bd78f6cea089cb862c05f3a27 (diff)
Fix no reaction to 'Ctrl+C'.
'Ctrl+C' was intercepted by 'handler'. Function 'handler' set 'running' to zero but it had no effect since wl_display_dispatch was waiting for wayland events. Bug-AGL: SPEC-4347 Signed-off-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com> Change-Id: I71fcb8bc48a54d483737c83187c18414770580eb
-rw-r--r--src/main.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/main.c b/src/main.c
index b15829e..240e44c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -28,7 +28,6 @@
#include <string.h>
#include <stddef.h>
#include <assert.h>
-#include <signal.h>
#include <wayland-client.h>
#include <wayland-util.h>
@@ -118,7 +117,7 @@ static void state_app(void *data, struct agl_shell_desktop *agl_shell_desktop,
{
if (strcmp(app_id, app_id_to_activate) == 0 &&
state == AGL_SHELL_DESKTOP_APP_STATE_ACTIVATED) {
- raise(SIGINT);
+ running = 0;
}
}
@@ -199,28 +198,16 @@ destroy_display(struct display *display)
free(display);
}
-static void
-handler(int sig, siginfo_t *si, void *unused)
-{
- running = 0;
-}
-
int main(int argc, char *argv[])
{
struct display *display;
struct window_output *w_output;
- struct sigaction sa;
int ret = 0;
if (argc < 2) {
exit(EXIT_FAILURE);
}
- sa.sa_flags = SA_SIGINFO;
- sigemptyset(&sa.sa_mask);
- sa.sa_sigaction = handler;
- sigaction(SIGINT, &sa, NULL);
-
display = create_display();
/* the app has to be already started, or not already active */