summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2024-07-26 23:25:23 +0200
committerChristian Soffke <christian.soffke@gmail.com>2024-07-30 22:08:18 +0200
commit2f8cab91903fd14f475a40be7c819585568fa5ef (patch)
treeb31218f961d8938c091fdf72aaaa34e6ed74cba1 /apps
parentcb7ae38fcd051b95fcc6513f91e861902ead76a7 (diff)
downloadrockbox-2f8cab91903fd14f475a40be7c819585568fa5ef.tar.gz
rockbox-2f8cab91903fd14f475a40be7c819585568fa5ef.zip
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
Diffstat (limited to 'apps')
-rw-r--r--apps/plugin.c21
-rw-r--r--apps/plugins/properties.c5
2 files changed, 15 insertions, 11 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index b45b25f7ff..adf207da79 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -856,6 +856,10 @@ int plugin_load(const char* plugin, const void* parameter)
856 if (!plugin) 856 if (!plugin)
857 return PLUGIN_ERROR; 857 return PLUGIN_ERROR;
858 858
859 /* for some plugins, the SBS can be left enabled */
860 const char *sepch = strrchr(plugin, PATH_SEPCH);
861 bool theme_enabled = sepch && !strcmp("properties.rock", sepch + 1);
862
859 if (current_plugin_handle && pfn_tsr_exit) 863 if (current_plugin_handle && pfn_tsr_exit)
860 { /* if we have a resident old plugin and a callback */ 864 { /* if we have a resident old plugin and a callback */
861 bool reenter = (strcmp(current_plugin, plugin) == 0); 865 bool reenter = (strcmp(current_plugin, plugin) == 0);
@@ -923,7 +927,8 @@ int plugin_load(const char* plugin, const void* parameter)
923 927
924 *(p_hdr->api) = &rockbox_api; 928 *(p_hdr->api) = &rockbox_api;
925 lcd_set_viewport(NULL); 929 lcd_set_viewport(NULL);
926 lcd_clear_display(); 930 if (!theme_enabled)
931 lcd_clear_display();
927 932
928#ifdef HAVE_REMOTE_LCD 933#ifdef HAVE_REMOTE_LCD
929 lcd_remote_set_viewport(NULL); 934 lcd_remote_set_viewport(NULL);
@@ -938,8 +943,9 @@ int plugin_load(const char* plugin, const void* parameter)
938 * they should be fixed properly instead of this lock */ 943 * they should be fixed properly instead of this lock */
939 tree_lock_cache(tree_get_context()); 944 tree_lock_cache(tree_get_context());
940 945
941 FOR_NB_SCREENS(i) 946 if (!theme_enabled)
942 viewportmanager_theme_enable(i, false, NULL); 947 FOR_NB_SCREENS(i)
948 viewportmanager_theme_enable(i, false, NULL);
943 949
944#ifdef HAVE_TOUCHSCREEN 950#ifdef HAVE_TOUCHSCREEN
945 touchscreen_set_mode(TOUCHSCREEN_BUTTON); 951 touchscreen_set_mode(TOUCHSCREEN_BUTTON);
@@ -1000,13 +1006,16 @@ int plugin_load(const char* plugin, const void* parameter)
1000#endif 1006#endif
1001#endif 1007#endif
1002 1008
1003 lcd_clear_display();
1004#ifdef HAVE_REMOTE_LCD 1009#ifdef HAVE_REMOTE_LCD
1005 lcd_remote_clear_display(); 1010 lcd_remote_clear_display();
1006#endif 1011#endif
1007 1012
1008 FOR_NB_SCREENS(i) 1013 if (!theme_enabled)
1009 viewportmanager_theme_undo(i, true); 1014 {
1015 lcd_clear_display();
1016 FOR_NB_SCREENS(i)
1017 viewportmanager_theme_undo(i, true);
1018 }
1010 1019
1011 plugin_check_open_close__exit(); 1020 plugin_check_open_close__exit();
1012 1021
diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c
index d3fac59bde..dcd3d89edf 100644
--- a/apps/plugins/properties.c
+++ b/apps/plugins/properties.c
@@ -321,8 +321,6 @@ enum plugin_status plugin_start(const void* parameter)
321 rb->action_userabort(TIMEOUT_BLOCK); 321 rb->action_userabort(TIMEOUT_BLOCK);
322 return PLUGIN_OK; 322 return PLUGIN_OK;
323 } 323 }
324 FOR_NB_SCREENS(i)
325 rb->viewportmanager_theme_enable(i, true, NULL);
326 324
327 if (props_type == PROPS_MUL_ID3) 325 if (props_type == PROPS_MUL_ID3)
328 ret = assemble_track_info(NULL, NULL); 326 ret = assemble_track_info(NULL, NULL);
@@ -349,8 +347,5 @@ enum plugin_status plugin_start(const void* parameter)
349 rb->browse_id3(&id3, 0, 0, NULL, mul_id3_count) : 347 rb->browse_id3(&id3, 0, 0, NULL, mul_id3_count) :
350 (stats.canceled ? 0 : -1); 348 (stats.canceled ? 0 : -1);
351 349
352 FOR_NB_SCREENS(i)
353 rb->viewportmanager_theme_undo(i, false);
354
355 return ret == -1 ? PLUGIN_ERROR : ret == 1 ? PLUGIN_USB_CONNECTED : PLUGIN_OK; 350 return ret == -1 ? PLUGIN_ERROR : ret == 1 ? PLUGIN_USB_CONNECTED : PLUGIN_OK;
356} 351}