bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=e7781b4b8945e759d42e4bb0875cda284c0a1b1f

commit e7781b4b8945e759d42e4bb0875cda284c0a1b1f
Author: Marcel Hollerbach <mar...@osg.samsung.com>
Date:   Fri Jun 11 17:03:51 2021 +0200

    e_comp_x: do not display this error a million times
    
    once is enough.
---
 src/bin/e_comp_x_randr.c | 40 ++++++++++++++++++++++++++++++++--------
 1 file changed, 32 insertions(+), 8 deletions(-)

diff --git a/src/bin/e_comp_x_randr.c b/src/bin/e_comp_x_randr.c
index f0070fabe..5cbf91245 100644
--- a/src/bin/e_comp_x_randr.c
+++ b/src/bin/e_comp_x_randr.c
@@ -433,17 +433,41 @@ _mode_screen_find(Ecore_X_Window root, E_Randr2_Screen 
*s, Ecore_X_Randr_Output
    return mode;
 }
 
+static E_Dialog *screen_error_dialog = NULL;
+
+static void
+_screen_error_remove_cb(void *data EINA_UNUSED, E_Dialog *dia EINA_UNUSED)
+{
+   screen_error_dialog = NULL;
+   e_object_del(E_OBJECT(dia));
+}
+
 static Eina_Bool
 _cb_no_outputs_timer(void *data EINA_UNUSED)
 {
-   e_util_dialog_show(_("Screen setup Error"),
-                      _("You seem to have no screens configured to<br>"
-                        "be on given the outputs you have. This should<br>"
-                        "be fixed by going to:<br>"
-                        "<br>"
-                        "<b>Settings -> Screen -> Screen Setup</><br>"
-                        "<br>"
-                        "And configure at least one screen to be on."));
+   if (!screen_error_dialog)
+     {
+        screen_error_dialog = e_dialog_new(NULL, "E", "_error_dialog");
+
+        e_dialog_title_set(screen_error_dialog, _("Screen setup Error"));
+        e_dialog_text_set(screen_error_dialog, _("You seem to have no screens 
configured to<br>"
+                                 "be on given the outputs you have. This 
should<br>"
+                                 "be fixed by going to:<br>"
+                                 "<br>"
+                                 "<b>Settings -> Screen -> Screen Setup</><br>"
+                                 "<br>"
+                                 "And configure at least one screen to be 
on."));
+       e_dialog_icon_set(screen_error_dialog, "dialog-error", 64);
+       e_dialog_button_add(screen_error_dialog, _("OK"), NULL, 
_screen_error_remove_cb, NULL);
+       e_dialog_button_focus_num(screen_error_dialog, 0);
+       elm_win_center(screen_error_dialog->win, 1, 1);
+       e_dialog_show(screen_error_dialog);
+     }
+   else
+     {
+       elm_win_raise(screen_error_dialog->win);
+     }
+
    return EINA_FALSE;
 }
 

-- 


Reply via email to