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 6cd76b4b32507120847cd78ea7e7b60bd4244fe6
Author: Carsten Haitzler <ras...@rasterman.com>
AuthorDate: Sat Jul 12 13:14:28 2025 +0100

    ecore-x: add api call to know if display still there on io error
---
 src/lib/ecore_x/Ecore_X.h       |  1 +
 src/lib/ecore_x/ecore_x_error.c | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/src/lib/ecore_x/Ecore_X.h b/src/lib/ecore_x/Ecore_X.h
index 432e418663..0828a6eeef 100644
--- a/src/lib/ecore_x/Ecore_X.h
+++ b/src/lib/ecore_x/Ecore_X.h
@@ -1443,6 +1443,7 @@ EAPI Ecore_X_Time              ecore_x_current_time_get(void);
 
 EAPI void                      ecore_x_error_handler_set(void (*func)(void *data), const void *data);
 EAPI void                      ecore_x_io_error_handler_set(void (*func)(void *data), const void *data);
+EAPI Eina_Bool                 ecore_x_io_error_display_still_there_get(void);  /**< @since 1.29 */
 EAPI int                       ecore_x_error_request_get(void);
 EAPI int                       ecore_x_error_code_get(void);
 EAPI Ecore_X_ID                ecore_x_error_resource_id_get(void);
diff --git a/src/lib/ecore_x/ecore_x_error.c b/src/lib/ecore_x/ecore_x_error.c
index 9facf0733b..28fa92c0e6 100644
--- a/src/lib/ecore_x/ecore_x_error.c
+++ b/src/lib/ecore_x/ecore_x_error.c
@@ -166,6 +166,8 @@ skip:
    return 0;
 }
 
+static Eina_Bool _ecore_x_error_display_still_there = EINA_FALSE;
+
 static int
 _ecore_x_io_error_handle(Display *d)
 {
@@ -173,9 +175,22 @@ _ecore_x_io_error_handle(Display *d)
      {
         if (_io_error_func)
           {
+             char *dpname = DisplayString(_ecore_x_disp);
+
+             if (dpname) dpname = strdup(dpname);
+
              _ecore_x_disp = NULL;
              _ecore_x_shutdown();
+
+             _ecore_x_disp = XOpenDisplay(dpname);
+             if (_ecore_x_disp)
+               {
+                  _ecore_x_error_display_still_there = EINA_TRUE;
+                  XCloseDisplay(_ecore_x_disp);
+               }
+             free(dpname);
              _io_error_func(_io_error_data);
+             _ecore_x_error_display_still_there = EINA_FALSE;
           }
         else
           exit(-1);
@@ -184,3 +199,8 @@ _ecore_x_io_error_handle(Display *d)
    return 0;
 }
 
+EAPI Eina_Bool
+ecore_x_io_error_display_still_there_get(void)
+{
+  return _ecore_x_error_display_still_there;
+}

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

Reply via email to