haiku/src/apps/autoraise
Kyle Ambroff-Kao 107712bf01 AutoRaise: Properly load tray icon bitmap
AutoRaise needs to load bitmaps stored as resources in the AppRaise
image. The strategy it used before was to store the path to itself in
its settings file.

It stored the entry_ref to the image in the settings, which may not be
stable across reboots with packagefs. In addition, the path could
change at some point for any other reason.

This patch changes AutoRaise to just use the same method as other tray
applets, which is to search the process for the image containing the
AutoRaise code, and then to get the path from the image_info.

Most of the initialization work is performed by TrayView::_init(),
which is called by the constructor. Some of the operations performed
by this method can fail, leaving TrayView partially initialized. Any
error is handled by returning early after telling Deskbar to remove
this item so that it will not continue running in a partially
initialized state. Deskbar will invoke the destructor so even a
partially initialized TrayView will be cleaned up.

Fixes #16473

Change-Id: Id1ac1ef78d410a7d191cfe88f1ba1db30e258adc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3341
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-10-22 17:52:53 +00:00
..
AutoRaise.rdef Use resource definition files instead of DoCatalogs rule. Rename B_TRANSLATE_APP_NAME and related macros to the more generic B_TRANSLATE_SYSTEM_NAME, to also fits add-ons, folders, etc, and make 'System name' its standard context. Change CodyCam and PoorMan's app signatures to match the overall x-vnd.Haiku-App pattern. Some clean-up. Make SlideShowSaver build again. 2011-03-25 22:13:48 +00:00
AutoRaise.txt Initial changes to remove /boot/common 2013-10-03 21:52:25 +02:00
AutoRaiseApp.cpp AutoRaise: Properly load tray icon bitmap 2020-10-22 17:52:53 +00:00
AutoRaiseApp.h AutoRaise: Rename include guard 2019-11-05 12:50:41 +00:00
AutoRaiseIcon.cpp AutoRaise: Properly load tray icon bitmap 2020-10-22 17:52:53 +00:00
AutoRaiseIcon.h AutoRaise: Properly load tray icon bitmap 2020-10-22 17:52:53 +00:00
Jamfile Localize AutoRaise 2019-07-31 02:11:19 +00:00
common.h apps/autoraise Restore functionality 2019-02-03 18:03:50 +00:00
settings.cpp AutoRaise: Properly load tray icon bitmap 2020-10-22 17:52:53 +00:00
settings.h AutoRaise: Properly load tray icon bitmap 2020-10-22 17:52:53 +00:00