summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-01-08 18:43:45 +0100
committerxengineering <me@xengineering.eu>2023-01-08 18:43:45 +0100
commit2602ba91fb804224aeece0c9abf1abcbc2345403 (patch)
tree33270f8935249cc8a2c2a850eb5e33b214fe79f0
parent271a8baaeb5cbd19047c50681d955c14115fc86f (diff)
downloadlimox-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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gui.c b/gui.c
index 6d0d267..2b4a2a2 100644
--- a/gui.c
+++ b/gui.c
@@ -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;
}