summaryrefslogtreecommitdiff
path: root/navit/navit.c
diff options
context:
space:
mode:
authorStefan Wildemann <metalstrolch@users.noreply.github.com>2021-09-13 11:36:50 +0200
committerGitHub <noreply@github.com>2021-09-13 11:36:50 +0200
commit0ed1660858a6b3055077f3b0d245c0316beb621c (patch)
tree64faca31f26907f3e46cab8622e792839386cec0 /navit/navit.c
parentda065b411d6bee9e7f9b7424bb615d64c7e4cc54 (diff)
downloadnavit-0ed1660858a6b3055077f3b0d245c0316beb621c.tar.gz
Fix:core: cancel drawing on resize request (#1142)
* 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. * Fix:graphics:qt5 Clear pixmap on resize To remove ugly artefacts after resizing the widget until navit completes to redraw the screen the widgets pixmap is cleared.
Diffstat (limited to 'navit/navit.c')
-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) {