forked from len0rd/rockbox
plugins: properties: keep theme enabled
Launching a themed plugin can cause the screen to flash due to the theme being disabled, before it is re-enabled right away. For the Properties plugin in particular, this seems a bit annoying and unnecessary. Change-Id: Ifa0275b453369051cc63a3c626551f54120fdb41
This commit is contained in:
parent
cb7ae38fcd
commit
2f8cab9190
2 changed files with 15 additions and 11 deletions
|
|
@ -856,6 +856,10 @@ int plugin_load(const char* plugin, const void* parameter)
|
||||||
if (!plugin)
|
if (!plugin)
|
||||||
return PLUGIN_ERROR;
|
return PLUGIN_ERROR;
|
||||||
|
|
||||||
|
/* for some plugins, the SBS can be left enabled */
|
||||||
|
const char *sepch = strrchr(plugin, PATH_SEPCH);
|
||||||
|
bool theme_enabled = sepch && !strcmp("properties.rock", sepch + 1);
|
||||||
|
|
||||||
if (current_plugin_handle && pfn_tsr_exit)
|
if (current_plugin_handle && pfn_tsr_exit)
|
||||||
{ /* if we have a resident old plugin and a callback */
|
{ /* if we have a resident old plugin and a callback */
|
||||||
bool reenter = (strcmp(current_plugin, plugin) == 0);
|
bool reenter = (strcmp(current_plugin, plugin) == 0);
|
||||||
|
|
@ -923,6 +927,7 @@ int plugin_load(const char* plugin, const void* parameter)
|
||||||
|
|
||||||
*(p_hdr->api) = &rockbox_api;
|
*(p_hdr->api) = &rockbox_api;
|
||||||
lcd_set_viewport(NULL);
|
lcd_set_viewport(NULL);
|
||||||
|
if (!theme_enabled)
|
||||||
lcd_clear_display();
|
lcd_clear_display();
|
||||||
|
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
|
|
@ -938,6 +943,7 @@ int plugin_load(const char* plugin, const void* parameter)
|
||||||
* they should be fixed properly instead of this lock */
|
* they should be fixed properly instead of this lock */
|
||||||
tree_lock_cache(tree_get_context());
|
tree_lock_cache(tree_get_context());
|
||||||
|
|
||||||
|
if (!theme_enabled)
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
viewportmanager_theme_enable(i, false, NULL);
|
viewportmanager_theme_enable(i, false, NULL);
|
||||||
|
|
||||||
|
|
@ -1000,13 +1006,16 @@ int plugin_load(const char* plugin, const void* parameter)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lcd_clear_display();
|
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
lcd_remote_clear_display();
|
lcd_remote_clear_display();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!theme_enabled)
|
||||||
|
{
|
||||||
|
lcd_clear_display();
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
viewportmanager_theme_undo(i, true);
|
viewportmanager_theme_undo(i, true);
|
||||||
|
}
|
||||||
|
|
||||||
plugin_check_open_close__exit();
|
plugin_check_open_close__exit();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -321,8 +321,6 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
rb->action_userabort(TIMEOUT_BLOCK);
|
rb->action_userabort(TIMEOUT_BLOCK);
|
||||||
return PLUGIN_OK;
|
return PLUGIN_OK;
|
||||||
}
|
}
|
||||||
FOR_NB_SCREENS(i)
|
|
||||||
rb->viewportmanager_theme_enable(i, true, NULL);
|
|
||||||
|
|
||||||
if (props_type == PROPS_MUL_ID3)
|
if (props_type == PROPS_MUL_ID3)
|
||||||
ret = assemble_track_info(NULL, NULL);
|
ret = assemble_track_info(NULL, NULL);
|
||||||
|
|
@ -349,8 +347,5 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
rb->browse_id3(&id3, 0, 0, NULL, mul_id3_count) :
|
rb->browse_id3(&id3, 0, 0, NULL, mul_id3_count) :
|
||||||
(stats.canceled ? 0 : -1);
|
(stats.canceled ? 0 : -1);
|
||||||
|
|
||||||
FOR_NB_SCREENS(i)
|
|
||||||
rb->viewportmanager_theme_undo(i, false);
|
|
||||||
|
|
||||||
return ret == -1 ? PLUGIN_ERROR : ret == 1 ? PLUGIN_USB_CONNECTED : PLUGIN_OK;
|
return ret == -1 ? PLUGIN_ERROR : ret == 1 ? PLUGIN_USB_CONNECTED : PLUGIN_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue