This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository efl.

View the commit online.

commit e6b49a3e49f615fd0c99bf2a33270579564afcf7
Author: Cedric BAIL <[email protected]>
AuthorDate: Fri Nov 13 09:32:45 2026 -0600

    examples: bg_cxx_example_02 loads the image it was given
    
    argv[0] is the program itself, so the example took its own binary for
    the image and failed with "File is not a known format". The image is
    argv[1]. Without an argument it looked for performance/background.png,
    which exists nowhere; it now uses elementary's plant_01.jpg from the
    data directory, as bg_example_02 does.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 src/examples/elementary/bg_cxx_example_02.cc | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/examples/elementary/bg_cxx_example_02.cc b/src/examples/elementary/bg_cxx_example_02.cc
index d9f915934c..0ba00f552a 100644
--- a/src/examples/elementary/bg_cxx_example_02.cc
+++ b/src/examples/elementary/bg_cxx_example_02.cc
@@ -42,10 +42,17 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev)
    win.delete_request_event_cb_add([](){ win = nullptr; efl_exit(0); });
 
    std::string path;
-   if (eina_array_count(args->argv) > 0)
-     path = static_cast<const char *>(eina_array_data_get(args->argv, 0));
+   /* argv[0] is the program itself; the image, if any, is the next one. */
+   if (eina_array_count(args->argv) > 1)
+     path = static_cast<const char *>(eina_array_data_get(args->argv, 1));
    else
-     path = "performance/background.png";
+     {
+        /* Where the C example finds it: the installed (or in-tree) data of
+         * elementary. */
+        elm_app_info_set(reinterpret_cast<void *>(efl_main), "elementary",
+                         "images/plant_01.jpg");
+        path = std::string(elm_app_data_dir_get()) + "/images/plant_01.jpg";
+     }
 
    efl::ui::Bg bg(instantiate, win);
    bg.scale_method_set(EFL_GFX_IMAGE_SCALE_METHOD_FILL);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to