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

git pushed a commit to branch main
in repository equation.

View the commit online.

commit bee5a04bcf3ee31a45788483232437110e4f51be
Author: Alastair Poole <[email protected]>
AuthorDate: Sat Nov 21 16:25:09 2026 +0000

    theme: ensure we remove popup when resetting theme.
---
 src/fe-efl/equation_ui.c | 13 ++++++++++---
 tests/equation_ui_test.c | 10 +++-------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/src/fe-efl/equation_ui.c b/src/fe-efl/equation_ui.c
index e8739f5..869a1f2 100644
--- a/src/fe-efl/equation_ui.c
+++ b/src/fe-efl/equation_ui.c
@@ -50,7 +50,12 @@ equation_menu_close(void *data, Evas_Object *object EINA_UNUSED, void *event_inf
    Equation_Ui *ui = data;
    Evas_Object *menu = ui->menu;
    ui->menu = ui->theme_status = NULL;
-   if (menu) evas_object_del(menu);
+   if (menu)
+     {
+        elm_object_disabled_set(menu, EINA_TRUE);
+        evas_object_hide(menu);
+        evas_object_del(menu);
+     }
    if (ui->ready) elm_object_focus_set(ui->entry, EINA_TRUE);
 }
 
@@ -254,13 +259,16 @@ equation_theme_apply(Equation_Ui *ui, const char *name)
 {
    char path[PATH_MAX];
    if (!equation_theme_resolve(name, path, sizeof(path))) return;
+   snprintf(ui->config.theme, sizeof(ui->config.theme), "%s", name);
+   equation_preferences_save(ui);
+   if (!ui->config_failed) equation_menu_close(ui, NULL, NULL);
+
    if (strcmp(path, ui->theme_path))
      {
         elm_theme_overlay_add(ui->theme, path);
         elm_theme_overlay_del(ui->theme, ui->theme_path);
         snprintf(ui->theme_path, sizeof(ui->theme_path), "%s", path);
      }
-   snprintf(ui->config.theme, sizeof(ui->config.theme), "%s", name);
    equation_window_theme_set(ui->window, path);
    if (ui->about) equation_window_theme_set(ui->about, path);
    elm_object_part_content_unset(ui->display, "equation.copy");
@@ -277,7 +285,6 @@ equation_theme_apply(Equation_Ui *ui, const char *name)
    ui->motion_running = false;
    equation_motion_sync(ui);
    equation_theme_display_set(ui->display, ui->display_value);
-   equation_preferences_save(ui);
    equation_theme_choices_update(ui);
 }
 
diff --git a/tests/equation_ui_test.c b/tests/equation_ui_test.c
index 61a6590..f5df3ad 100644
--- a/tests/equation_ui_test.c
+++ b/tests/equation_ui_test.c
@@ -204,8 +204,8 @@ main(int argc, char **argv)
         Evas_Object *choice = evas_object_name_find(canvas, themes[i]);
         EQUATION_CHECK(choice);
         equation_click(choice);
-        equation_pump();
-        EQUATION_CHECK(!strcmp(ui->config.theme, themes[i]) && !ui->config_failed);
+        EQUATION_CHECK(!ui->menu && !strcmp(ui->config.theme, themes[i]) && !ui->config_failed);
+        EQUATION_CHECK(!equation_button_interactions(ui));
         Equation_Config loaded;
         equation_config_load(&loaded);
         EQUATION_CHECK(!strcmp(loaded.theme, themes[i]));
@@ -224,8 +224,6 @@ main(int argc, char **argv)
         elm_entry_entry_set(ui->entry, "sqrt(144)+30");
         evas_object_smart_callback_call(ui->entry, "activated", NULL);
         EQUATION_CHECK(!strcmp(ui->display_value, "42"));
-        evas_object_smart_callback_call(ui->menu, "block,clicked", NULL);
-        equation_pump();
         if (argc > 1)
           {
              char path[PATH_MAX];
@@ -235,7 +233,6 @@ main(int argc, char **argv)
              snprintf(path, sizeof(path), "%s/equation_%s.png", argv[1], themes[i]);
              EQUATION_CHECK(equation_capture(window, path));
           }
-        EQUATION_CHECK(!equation_button_interactions(ui));
         /* The popup and About are both recreated and themed after each switch. */
         equation_click(menu_button);
         if (argc > 1)
@@ -299,8 +296,7 @@ main(int argc, char **argv)
    EQUATION_CHECK(strstr(elm_object_text_get(ui->theme_status), "could not be saved"));
    snprintf(ui->config.path, sizeof(ui->config.path), "%s", config_path);
    equation_click(evas_object_name_find(canvas, "crazy_lab"));
-   EQUATION_CHECK(!ui->config_failed);
-   evas_object_smart_callback_call(ui->menu, "block,clicked", NULL);
+   EQUATION_CHECK(!ui->config_failed && !ui->menu);
    equation_click(evas_object_name_find(canvas, "equation_programmer"));
    EQUATION_CHECK(elm_radio_value_get(ui->mode) == 1 && ui->config.mode == 1);
    equation_click(ui->mode);

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

Reply via email to