summaryrefslogtreecommitdiff
path: root/gui.c
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2022-12-04 14:04:06 +0100
committerxengineering <me@xengineering.eu>2023-01-08 18:43:01 +0100
commit271a8baaeb5cbd19047c50681d955c14115fc86f (patch)
tree95ee8dbf8bf6288d1da09d15f9a4d39a129c6360 /gui.c
parent9e2a44364bfae9a226e02fe7ddad032b16a1318f (diff)
downloadlimox-271a8baaeb5cbd19047c50681d955c14115fc86f.tar
limox-271a8baaeb5cbd19047c50681d955c14115fc86f.tar.zst
limox-271a8baaeb5cbd19047c50681d955c14115fc86f.zip
Connect on mouse click
With this commit the client starts the connection to the server as soon as the user clicks into the application window. Disconnect or reading / writing to the stream is not implemented.
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);