diff options
author | Stefan Wildemann <gta04@metalstrolche.de> | 2021-09-01 21:52:34 +0200 |
---|---|---|
committer | Stefan Wildemann <gta04@metalstrolche.de> | 2021-09-01 21:52:34 +0200 |
commit | f6fefddcb166f2135ecc297d4994accf8668a8cf (patch) | |
tree | d10c513180a8f0999273052e31b4229609845ea8 | |
parent | b9916f468bcc7fdd8b86e5efa808769d7fb38111 (diff) | |
download | navit-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.c | 6 |
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) { |