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

git pushed a commit to branch improve-macos-support
in repository terminology.

View the commit online.

commit 19e2231a18885bc2a7c45b894e2400c539a39572
Author: Cedric BAIL <[email protected]>
AuthorDate: Wed Mar 25 10:31:06 2026 -0600

    feat(cocoa): handle macOS application reopen events
    
    Register _cb_reopen handler via ecore_cocoa_reopen_cb_set() during startup.
    When the user re-launches Terminology from Spotlight or clicks the Dock icon
    while the application is already running, the callback creates a new terminal
    window using the same machinery as IPC-based new window creation (win_new,
    term_new, win_term_set).
    
    This resolves unresponsiveness on macOS when attempting to open new windows
    via the Dock or Spotlight while the application is minimized or in the
    background.
---
 meson.build    |  5 +++++
 src/bin/main.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)

diff --git a/meson.build b/meson.build
index 780e94c7..8aac1afe 100644
--- a/meson.build
+++ b/meson.build
@@ -86,6 +86,11 @@ foreach efl_dep: efl_deps
   endif
 endforeach
 
+if host_os == 'darwin'
+  ecore_cocoa_dep = dependency('ecore-cocoa', required: true)
+  terminology_dependencies += [ecore_cocoa_dep]
+endif
+
 if cc.has_function('mkstemps')
   config_data.set('HAVE_MKSTEMPS', 1)
 endif
diff --git a/src/bin/main.c b/src/bin/main.c
index 255c5712..9858ee32 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -20,6 +20,10 @@
 #include "gravatar.h"
 #include "keyin.h"
 
+#ifdef __APPLE__
+# include <Ecore_Cocoa.h>
+#endif
+
 int terminology_starting_up;
 int _log_domain = -1;
 Eina_Bool multisense_available = EINA_TRUE;
@@ -185,6 +189,42 @@ main_config_get(void)
    return _main_config;
 }
 
+#ifdef __APPLE__
+static Eina_Bool
+_cb_reopen(Eina_Bool has_visible EINA_UNUSED)
+{
+   Win *wn;
+   Term *term;
+
+   wn = win_new(NULL, NULL, NULL, NULL, _main_config,
+                EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE);
+   if (!wn)
+     {
+        CRITICAL(_("Could not create window on reopen"));
+        return EINA_FALSE;
+     }
+
+   term = term_new(wn, win_config_get(wn), NULL, EINA_FALSE,
+                   NULL, 80, 24, EINA_FALSE, NULL);
+   if (!term)
+     {
+        CRITICAL(_("Could not create terminal on reopen"));
+        win_free(wn);
+        return EINA_FALSE;
+     }
+
+   if (win_term_set(wn, term) < 0)
+     {
+        return EINA_FALSE;
+     }
+
+   win_sizing_handle(wn);
+   evas_object_show(win_evas_object_get(wn));
+
+   return EINA_TRUE;
+}
+#endif
+
 static void
 main_ipc_new(Ipc_Instance *inst)
 {
@@ -916,6 +956,10 @@ elm_main(int argc, char **argv)
 
    ipc_init();
 
+#ifdef __APPLE__
+   ecore_cocoa_reopen_cb_set(_cb_reopen);
+#endif
+
    instance.config = config_fork(_main_config);
 
    args = ecore_getopt_parse(&options, values, argc, argv);

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

Reply via email to