summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-09-17 15:29:24 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-09-24 16:14:10 +0200
commitba18c08524cffd3fa03adf49f680f3a80390d61d (patch)
treea97cbbc9a83bc2ad72c63259eaee78572526bfc6 /common
parent89cd310cf6117586701b1e72fe7c2bf0fbd760db (diff)
downloadqtlocation-mapboxgl-ba18c08524cffd3fa03adf49f680f3a80390d61d.tar.gz
add a callback to stop() to allow running the current thread's event loop
Diffstat (limited to 'common')
-rw-r--r--common/glfw_view.cpp6
-rw-r--r--common/glfw_view.hpp1
2 files changed, 6 insertions, 1 deletions
diff --git a/common/glfw_view.cpp b/common/glfw_view.cpp
index f53090a000..fb54d55f39 100644
--- a/common/glfw_view.cpp
+++ b/common/glfw_view.cpp
@@ -183,7 +183,7 @@ int GLFWView::run() {
glfwWaitEvents();
}
- map->stop();
+ map->stop(glfwWaitEvents);
return 0;
}
@@ -192,6 +192,10 @@ void GLFWView::make_active() {
glfwMakeContextCurrent(window);
}
+void GLFWView::notify() {
+ glfwPostEmptyEvent();
+}
+
void GLFWView::swap() {
glfwPostEmptyEvent();
diff --git a/common/glfw_view.hpp b/common/glfw_view.hpp
index d2f6872fc7..481b1598bb 100644
--- a/common/glfw_view.hpp
+++ b/common/glfw_view.hpp
@@ -17,6 +17,7 @@ public:
void initialize(mbgl::Map *map);
void swap();
void make_active();
+ void notify();
void notify_map_change(mbgl::MapChange change, mbgl::timestamp delay = 0);
static void key(GLFWwindow *window, int key, int scancode, int action, int mods);