aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Window.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/Window.hpp b/include/Window.hpp
index 4355fb8..645b578 100644
--- a/include/Window.hpp
+++ b/include/Window.hpp
@@ -10,6 +10,7 @@
#include <mutex>
#include <random>
#include <vector>
+#include <glibmm/dispatcher.h>
namespace dchat
{
@@ -22,7 +23,9 @@ namespace dchat
std::shared_ptr<Rooms> rooms;
WindowNotification *windowNotification;
private:
+ using DispatcherHandler = std::function<void()>;
bool drawBackground(const Cairo::RefPtr<Cairo::Context> &cairo);
+ void dispatchFunction(DispatcherHandler func);
private:
class OverlayDrawable : public Gtk::Overlay
{
@@ -53,5 +56,9 @@ namespace dchat
std::vector<Node> backgroundNodes;
int prevTimeMillis;
sigc::connection drawBackgroundConnection;
+
+ Glib::Dispatcher dispatcher;
+ std::mutex dispatcherMutex;
+ std::vector<DispatcherHandler> dispatcherHandlers;
};
} \ No newline at end of file