From b143297961e93329d2c522194602e0850147e693 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 27 Jan 2019 17:09:52 +0100 Subject: FUCK GTK GARBAGE DO NOT EVER USE AGAIN --- src/Window.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Window.cpp b/src/Window.cpp index 1344429..5991bb3 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -42,7 +42,8 @@ namespace dchat } Window::Window() : - chatWindow(this) + chatWindow(this), + needUpdate(false) { set_border_width(0); windowNotification = Gtk::manage(new WindowNotification()); @@ -239,6 +240,13 @@ namespace dchat { dispatcherHandler(); } + + if(needUpdate) + { + needUpdate = false; + fprintf(stderr, "Redraw!\n"); + queue_draw(); + } }); Rooms::connect(bootstrapNode->c_str(), 27130, roomCallbackFuncs); @@ -281,6 +289,15 @@ namespace dchat } + void Window::refresh() + { + if(needUpdate) + return; + + needUpdate = true; + dispatcher.emit(); + } + void Window::dispatchFunction(DispatcherHandler func) { std::lock_guard lock(dispatcherMutex); -- cgit v1.2.3