aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2019-12-27 20:16:39 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2019-12-27 20:16:39 +0100
commit1d2997b2d587602aee9769842d34f9f67810a479 (patch)
treebb0e0dc2b4532baadf4f2e933aa75694b1a14b5c
parent30de00ce5fb7e0e85ac9dfc003546035250a9a95 (diff)
downloadd2tk-1d2997b2d587602aee9769842d34f9f67810a479.tar.xz
pugl: force full refresh upon FOCUS/ENTER/LEAVE.
-rw-r--r--VERSION2
-rw-r--r--d2tk/base.h3
-rw-r--r--d2tk/core.h3
-rw-r--r--src/backend_cairo.c2
-rw-r--r--src/base.c6
-rw-r--r--src/core.c8
-rw-r--r--src/frontend_pugl.c3
7 files changed, 24 insertions, 3 deletions
diff --git a/VERSION b/VERSION
index ba6c26a..91fca19 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.931
+0.1.937
diff --git a/d2tk/base.h b/d2tk/base.h
index 78e1962..8f46f6c 100644
--- a/d2tk/base.h
+++ b/d2tk/base.h
@@ -671,6 +671,9 @@ d2tk_base_set_dimensions(d2tk_base_t *base, d2tk_coord_t w, d2tk_coord_t h);
D2TK_API void
d2tk_base_get_dimensions(d2tk_base_t *base, d2tk_coord_t *w, d2tk_coord_t *h);
+D2TK_API void
+d2tk_base_set_full_refresh(d2tk_base_t *base);
+
#ifdef __cplusplus
}
#endif
diff --git a/d2tk/core.h b/d2tk/core.h
index 903118d..bbe0d3c 100644
--- a/d2tk/core.h
+++ b/d2tk/core.h
@@ -206,6 +206,9 @@ d2tk_core_set_dimensions(d2tk_core_t *core, d2tk_coord_t w, d2tk_coord_t h);
D2TK_API void
d2tk_core_get_dimensions(d2tk_core_t *core, d2tk_coord_t *w, d2tk_coord_t *h);
+D2TK_API void
+d2tk_core_set_full_refresh(d2tk_core_t *core);
+
#ifdef __cplusplus
}
#endif
diff --git a/src/backend_cairo.c b/src/backend_cairo.c
index fa31168..0a39638 100644
--- a/src/backend_cairo.c
+++ b/src/backend_cairo.c
@@ -151,7 +151,7 @@ d2tk_cairo_post(void *data, d2tk_core_t *core __attribute__((unused)),
cairo_surface_t *surf = cairo_image_surface_create_for_data(
(uint8_t *)pixels, CAIRO_FORMAT_ARGB32, w, h, w*sizeof(uint32_t));
- //FIXME reuse/update suface
+ //FIXME reuse/update surface
cairo_rectangle(ctx, 0, 0, w, h);
cairo_clip(ctx);
diff --git a/src/base.c b/src/base.c
index f0ff45d..75cd8c4 100644
--- a/src/base.c
+++ b/src/base.c
@@ -979,3 +979,9 @@ d2tk_base_get_dimensions(d2tk_base_t *base, d2tk_coord_t *w, d2tk_coord_t *h)
{
d2tk_core_get_dimensions(base->core, w, h);
}
+
+D2TK_API void
+d2tk_base_set_full_refresh(d2tk_base_t *base)
+{
+ d2tk_core_set_full_refresh(base->core);
+}
diff --git a/src/core.c b/src/core.c
index 7e91c09..fbf9864 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1610,7 +1610,7 @@ d2tk_core_set_dimensions(d2tk_core_t *core, d2tk_coord_t w, d2tk_coord_t h)
{
core->w = w;
core->h = h;
- core->full_refresh = true;
+ d2tk_core_set_full_refresh(core);
_d2tk_bitmap_resize(core, w, h);
}
@@ -1627,3 +1627,9 @@ d2tk_core_get_dimensions(d2tk_core_t *core, d2tk_coord_t *w, d2tk_coord_t *h)
*h = core->h;
}
}
+
+D2TK_API void
+d2tk_core_set_full_refresh(d2tk_core_t *core)
+{
+ core->full_refresh = true;
+}
diff --git a/src/frontend_pugl.c b/src/frontend_pugl.c
index d0ff8c7..c176d37 100644
--- a/src/frontend_pugl.c
+++ b/src/frontend_pugl.c
@@ -118,6 +118,8 @@ _d2tk_pugl_event_func(PuglView *view, const PuglEvent *e)
// fall-through
case PUGL_FOCUS_OUT:
{
+ d2tk_base_set_full_refresh(base);
+
puglPostRedisplay(dpugl->view);
} break;
@@ -126,6 +128,7 @@ _d2tk_pugl_event_func(PuglView *view, const PuglEvent *e)
{
_d2tk_pugl_modifiers(dpugl, e->crossing.state);
d2tk_base_set_mouse_pos(base, e->crossing.x, e->crossing.y);
+ d2tk_base_set_full_refresh(base);
puglPostRedisplay(dpugl->view);
} break;