Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#1343 closed defect/bug (fixed)

Navigation status OSD shows "unknown" image after window resize

Reported by: mvglasow (2) Owned by: mvglasow (2)
Priority: major Milestone:
Component: osd/core Version: git master
Severity: normal Keywords: OSD, nav_status
Cc:

Description

Resizing the application window (on desktop versions, tested on Linux) or changing screen orientation (tested on Android) causes the status OSD to display an "unknown" image.

Log output below – first the OSD is displayed correctly, then the window is resized and the placeholder image is shown, as a nonexistent image path is set.

debug:osd_core:osd_navigation_status_draw:image=/home/michael/workspaces/navit/navit-linux/navit/xpm/status_position_wait_wh_64_64.png
debug:osd_core:osd_navigation_status_draw:gr_image=0xfcc9b0
error:navit:osd_std_config:Error in saved command: not_ready, item=0xe25e40.
error:navit:osd_std_config:Error in saved command: not_ready, item=0xe61d20.
debug:osd_core:osd_navigation_status_draw:image=/home/michael/workspaces/navit/navit-linux/navit/xpm/status_unknown_14087168)_wh_64_64.png
error:navit:graphics_image_new_scaled_rotated:No image for '/home/michael/workspaces/navit/navit-linux/navit/xpm/status_unknown_14087168)_wh_64_64.png'
error:osd_core:osd_navigation_status_draw:failed to load /home/michael/workspaces/navit/navit-linux/navit/xpm/status_unknown_14087168)_wh_64_64.png in -1x-1

Change History (2)

comment:1 Changed 5 years ago by mvglasow (2)

  • Owner changed from Singesang to mvglasow (2)

comment:2 Changed 5 years ago by mvglasow (2)

  • Resolution set to fixed
  • Status changed from new to closed

The draw method for the navigation_status OSD, osd_navigation_status_draw(), can be invoked in two different ways:

  • As an attribute callback for navigation.nav_status (with the new status passed as its argument): this happens when the status changes.
  • As the draw function (with the navit object and the vehicle passed as arguments): this happens when the window needs to be redrawn.

Since the method was written to expect the status as an argument, the second case would cause it to interpret the address of the navit object as a status value, leading to the behavior observed.

I now renamed the attribute callback to osd_navigation_status_draw_do(), with the same signature. Additionally I created new osd_navigation_status_draw() method with the standard signature for that method, which acts as a wrapper around osd_navigation_status_draw_do(). This fixes it.

Fixed in 76b6a25/r6563.

Last edited 5 years ago by mvglasow (2) (previous) (diff)
Note: See TracTickets for help on using tickets.