diff options
author | xengineering <me@xengineering.eu> | 2023-01-08 18:43:45 +0100 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-01-08 18:43:45 +0100 |
commit | 2602ba91fb804224aeece0c9abf1abcbc2345403 (patch) | |
tree | 33270f8935249cc8a2c2a850eb5e33b214fe79f0 | |
parent | 271a8baaeb5cbd19047c50681d955c14115fc86f (diff) | |
download | limox-2602ba91fb804224aeece0c9abf1abcbc2345403.tar limox-2602ba91fb804224aeece0c9abf1abcbc2345403.tar.zst limox-2602ba91fb804224aeece0c9abf1abcbc2345403.zip |
Implement close on click
This adds the option to close the XMPP connection.
-rw-r--r-- | gui.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -19,6 +19,7 @@ #include <SDL2/SDL.h> #include <stdbool.h> +#include <unistd.h> #include "xmpp.h" @@ -65,6 +66,9 @@ void gui_run(void) { case SDL_MOUSEBUTTONDOWN: if (xmpp_fd == -1) { xmpp_fd = xmpp_connect(); + } else { + close(xmpp_fd); + printf("Closed XMPP connection.\n"); } break; } |