summaryrefslogtreecommitdiff
path: root/gui.c
diff options
context:
space:
mode:
Diffstat (limited to 'gui.c')
-rw-r--r--gui.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gui.c b/gui.c
index a7f0886..6d0d267 100644
--- a/gui.c
+++ b/gui.c
@@ -31,6 +31,7 @@ void gui_run(void) {
SDL_Renderer* renderer;
SDL_Texture* texture;
uint32_t* pixels;
+ int xmpp_fd = -1;
// init SDL2 and create window
SDL_Init(SDL_INIT_VIDEO);
@@ -62,7 +63,9 @@ void gui_run(void) {
quit = true;
break;
case SDL_MOUSEBUTTONDOWN:
- xmpp_connect();
+ if (xmpp_fd == -1) {
+ xmpp_fd = xmpp_connect();
+ }
break;
}
SDL_RenderClear(renderer);