summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wildemann <gta04@metalstrolche.de>2021-09-01 21:52:34 +0200
committerStefan Wildemann <gta04@metalstrolche.de>2021-09-01 21:52:34 +0200
commitf6fefddcb166f2135ecc297d4994accf8668a8cf (patch)
treed10c513180a8f0999273052e31b4229609845ea8
parentb9916f468bcc7fdd8b86e5efa808769d7fb38111 (diff)
downloadnavit-f6fefddcb166f2135ecc297d4994accf8668a8cf.tar.gz
Fix:core: cancel drawing on resize request
This commit causes navit to cancel async drawing in case of resize request. Drawing is started again after that. this should effectively cause a redraw on subsequent calls to resize. Some graphics like qt5 call resize for both dimension changes if the wigdet get's resized.
-rw-r--r--navit/navit.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/navit/navit.c b/navit/navit.c
index f80890e2c..14087c4ed 100644
--- a/navit/navit.c
+++ b/navit/navit.c
@@ -490,8 +490,12 @@ void navit_handle_resize(struct navit *this_, int w, int h) {
graphics_set_rect(this_->gra, &sel.u.p_rect);
if (callback)
callback_list_call_attr_1(this_->attr_cbl, attr_graphics_ready, this_);
- if (this_->ready == 3)
+ if (this_->ready == 3) {
+ /* About to resize. Cancel drawing whatever it is */
+ graphics_draw_cancel(this_->gra, this_->displaylist);
+ /* draw again even if we did not cancel anything */
navit_draw_async(this_, 1);
+ }
}
static void navit_resize(void *data, int w, int h) {