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

git pushed a commit to branch main
in repository entrance.

View the commit online.

commit 0ca16de43f935b9566a24d696ba89b2a57b30897
Author: Alastair Poole <[email protected]>
AuthorDate: Wed Dec 2 14:09:19 2026 +0000

    compositor: use compositor not elm within.
---
 README.md                           |  6 ++--
 meson.build                         | 14 ++++++----
 meson.options                       |  2 +-
 src/compositor/README.md            |  6 ++--
 src/compositor/bin/e_main.c         | 10 ++++++-
 src/compositor/bin/meson.build      |  2 +-
 src/greeter/entrance_greeter_cli.c  |  9 ++++++
 src/greeter/entrance_greeter_main.c | 55 ++++++++++++++++++++++++++++++++++---
 src/greeter/entrance_greeter_main.h |  3 ++
 src/greeter/meson.build             | 30 ++++++++++++++------
 10 files changed, 110 insertions(+), 27 deletions(-)

diff --git a/README.md b/README.md
index 6f1a881..414f8a9 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ Install Meson 1.1+, Ninja, pkg-config, Python 3, C11 and C++17 compilers,
 Qt 6 Core, and the development packages for libdbus, PAM, Fontconfig, and EFL 1.22+.
 The package lists below cover the Qt 6 build with systemd support. The full
 build enables the bundled Wayland compositor. For an Xorg-only build, add
-`-Dcompositor=false` to the Meson setup command. [Compositor requirements](src/compositor/README.md#build-requirements)
+`-Dxorg=true -Dcompositor=false` to the Meson setup command. [Compositor requirements](src/compositor/README.md#build-requirements)
 
 ### Install dependencies
 
@@ -74,8 +74,8 @@ To migrate SDDM settings, review PAM service names and move the configuration to
 
 ### Wayland greeter
 
-Entrance defaults to Xorg when Xorg support is built. Use `-Dxorg=false` for a
-Wayland-only build, which defaults to Wayland and omits the Xorg fallback.
+Entrance builds with Wayland support by default. Pass `-Dxorg=true` to enable
+Xorg support. When enabled, Entrance defaults to Xorg.
 For a dual-backend build, follow the compositor setup instructions to select
 Wayland. You can choose your desktop session independently at
 sign-in. [Wayland setup and troubleshooting](src/compositor/README.md#wayland-greeter)
diff --git a/meson.build b/meson.build
index 667a824..4ee3e06 100644
--- a/meson.build
+++ b/meson.build
@@ -50,15 +50,9 @@ wayland_compositor_command = 'weston --shell=kiosk-shell.so'
 wayland_backend = 'external compositor (Weston by default)'
 compositor_backends = []
 if not greeter_only and get_option('compositor')
-  subdir('src/compositor')
   compositor_binary = libexecdir / 'entrance' / 'compositor' / 'entrance_compositor'
   wayland_compositor_command = '"' + compositor_binary + '"'
   wayland_backend = 'bundled compositor'
-  foreach backend, module : {'DRM/KMS': 'WL_DRM', 'Headless buffer': 'WL_BUFFER'}
-    if compositor_config.has('USE_MODULE_' + module)
-      compositor_backends += backend
-    endif
-  endforeach
 endif
 runtime = systemd.found() ? '/run/entrance' : localstatedir / 'run/entrance'
 power = systemd.found() ? '/usr/bin/systemctl' : '/usr/bin/loginctl'
@@ -116,6 +110,14 @@ if not greeter_only
 endif
 subdir('po')
 subdir('src/greeter')
+if not greeter_only and get_option('compositor')
+  subdir('src/compositor')
+  foreach backend, module : {'DRM/KMS': 'WL_DRM', 'Headless buffer': 'WL_BUFFER'}
+    if compositor_config.has('USE_MODULE_' + module)
+      compositor_backends += backend
+    endif
+  endforeach
+endif
 subdir('data')
 if not greeter_only
   subdir('services')
diff --git a/meson.options b/meson.options
index 50ecab4..cac991c 100644
--- a/meson.options
+++ b/meson.options
@@ -23,5 +23,5 @@ option('compositor_wl_buffer', type: 'boolean', value: true,
 option('compositor_wl_desktop_shell', type: 'boolean', value: true,
   description: 'Build the stable xdg-shell module for the bundled compositor')
 
-option('xorg', type: 'boolean', value: true,
+option('xorg', type: 'boolean', value: false,
   description: 'Enable Xorg greeters and X11 desktop sessions')
diff --git a/src/compositor/README.md b/src/compositor/README.md
index 8052982..7884e4c 100644
--- a/src/compositor/README.md
+++ b/src/compositor/README.md
@@ -23,9 +23,9 @@ The bundled compositor is enabled by default in a full Entrance build. It
 requires EFL 1.29.99 or later with Wayland and DRM support, Wayland 1.17 or
 later with `wayland-scanner`, wayland-protocols 1.34 or later, libdrm,
 libxkbcommon, and the `eet` tool. Add `-Dcompositor=false` to the Meson setup
-command to build Entrance without it. Add `-Dxorg=false` to build Entrance
-with Wayland greeters and desktop sessions only. The Wayland-only build omits
-the Xorg launcher and the greeter’s direct Ecore X integration.
+command to build Entrance without it. The default build supports Wayland
+greeters and desktop sessions. Add `-Dxorg=true` to enable the Xorg launcher
+and the greeter’s direct Ecore X integration.
 
 ## Wayland greeter
 
diff --git a/src/compositor/bin/e_main.c b/src/compositor/bin/e_main.c
index d793d18..4054bfa 100644
--- a/src/compositor/bin/e_main.c
+++ b/src/compositor/bin/e_main.c
@@ -1,4 +1,5 @@
 #include "e.h"
+#include "entrance_greeter_main.h"
 #ifdef __linux__
 # include <sys/prctl.h>
 #endif
@@ -774,7 +775,14 @@ main(int argc, char **argv)
    if (!setjmp(x_fatal_buff))
      {
         e_main_loop_running = EINA_TRUE;
-        ecore_main_loop_begin();
+        const char *canvas_preview = getenv("ENTRANCE_GREETER_CANVAS_PREVIEW");
+        if (canvas_preview && !strcmp(canvas_preview, "1"))
+          {
+             if (entrance_greeter_canvas_preview(e_comp->ee))
+               CRI("Could not start the embedded greeter preview");
+          }
+        else
+          ecore_main_loop_begin();
      }
    else
      CRI("FATAL: X Died. Connection gone. Abbreviated Shutdown\n");
diff --git a/src/compositor/bin/meson.build b/src/compositor/bin/meson.build
index 7dd0886..b541be9 100644
--- a/src/compositor/bin/meson.build
+++ b/src/compositor/bin/meson.build
@@ -109,7 +109,7 @@ endif
 
 executable('entrance_compositor', src,
            include_directories: include_directories('.', '..'),
-           dependencies       : deps_e,
+           dependencies       : deps_e + [greeter_ui_dep],
            c_args             : compositor_c_args + compositor_bin_c_args + ['-DE_LOGGING=1'],
            override_options   : ['c_std=gnu99'],
            link_args          : compositor_link_args + ['-rdynamic'],
diff --git a/src/greeter/entrance_greeter_cli.c b/src/greeter/entrance_greeter_cli.c
new file mode 100644
index 0000000..6457fcb
--- /dev/null
+++ b/src/greeter/entrance_greeter_cli.c
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "entrance_greeter_main.h"
+
+int
+main(int argc, char **argv)
+{
+   return entrance_greeter_cli_run(argc, argv);
+}
diff --git a/src/greeter/entrance_greeter_main.c b/src/greeter/entrance_greeter_main.c
index 3f5ad52..06cabca 100644
--- a/src/greeter/entrance_greeter_main.c
+++ b/src/greeter/entrance_greeter_main.c
@@ -490,12 +490,23 @@ _preview_close(void *data EINA_UNUSED, Evas_Object *window EINA_UNUSED, void *ev
    elm_exit();
 }
 
+static void
+_canvas_preview_resize(void *data, Evas *canvas, void *event_info EINA_UNUSED)
+{
+   int width, height;
+
+   evas_output_viewport_get(canvas, NULL, NULL, &width, &height);
+   evas_object_resize(data, width, height);
+}
+
 void
 entrance_greeter_main_loop(Evas_Object *window, Evas_Object *panel, Evas_Object **layout,
                            Evas_Object *menu, Evas_Object *button, Evas_Object *viewport,
                            Evas_Object *focus, Eina_Bool preview, Eina_Bool animations)
 {
    Ecore_Event_Handler *exit_handler;
+   Evas *canvas = evas_object_evas_get(window);
+   Eina_Bool embedded = evas_object_data_get(window, "entrance.canvas-preview") != NULL;
    Eina_Bool menu_follows_window = EINA_FALSE;
    Greeter_Screens screens = { .window = window, .panel = panel, .layout = layout,
                                .menu = menu, .animations = animations };
@@ -541,7 +552,13 @@ entrance_greeter_main_loop(Evas_Object *window, Evas_Object *panel, Evas_Object
      }
    evas_object_raise(menu);
 
-   if (preview)
+   if (embedded)
+     {
+        evas_event_callback_add(canvas, EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE,
+                                _canvas_preview_resize, window);
+        _canvas_preview_resize(window, canvas, NULL);
+     }
+   else if (preview)
      {
         evas_object_resize(window, 960, 640);
      }
@@ -572,7 +589,10 @@ entrance_greeter_main_loop(Evas_Object *window, Evas_Object *panel, Evas_Object
            elm_win_fullscreen_set(window, EINA_TRUE);
      }
    evas_object_show(window);
-   elm_win_activate(window);
+   if (embedded)
+      evas_object_focus_set(window, EINA_TRUE);
+   else
+      elm_win_activate(window);
    /* Settle the swallowed form's geometry before focus can scroll it into view. */
    evas_smart_objects_calculate(evas_object_evas_get(window));
    elm_object_focus_set(focus, EINA_TRUE);
@@ -580,7 +600,14 @@ entrance_greeter_main_loop(Evas_Object *window, Evas_Object *panel, Evas_Object
    elm_scroller_region_show(viewport, 0, 0, 1, 1);
 
    exit_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _exit_requested, NULL);
-   elm_run();
+   if (embedded)
+     {
+        ecore_main_loop_begin();
+        evas_event_callback_del_full(canvas, EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE,
+                                     _canvas_preview_resize, window);
+     }
+   else
+      elm_run();
    if (exit_handler)
       ecore_event_handler_del(exit_handler);
    if (menu_follows_window)
@@ -654,7 +681,7 @@ _retry_wayland_software(char **argv)
 }
 
 int
-main(int argc, char **argv)
+entrance_greeter_cli_run(int argc, char **argv)
 {
    Evas_Object *window;
    char *theme, *socket, *scale, *language, *keyboard_layout = NULL;
@@ -790,3 +817,23 @@ main(int argc, char **argv)
    if (retry_software) return _retry_wayland_software(argv);
    return retry_shm ? _retry_wayland_shm(argv) : result;
 }
+
+int
+entrance_greeter_canvas_preview(Ecore_Evas *canvas)
+{
+   Evas_Object *window;
+
+   if (!canvas)
+      return 1;
+   window = elm_win_fake_add(canvas);
+   if (!window)
+      return 1;
+
+   _register_theme_fonts(NULL);
+   entrance_greeter_i18n_init(EINA_TRUE);
+   evas_object_data_set(window, "entrance.canvas-preview", window);
+   int result = entrance_greeter_run(window, EINA_TRUE, NULL, NULL, EINA_TRUE, NULL,
+                                    ENTRANCE_IDLE_DEFAULT_STEPS);
+   entrance_greeter_i18n_shutdown();
+   return result;
+}
diff --git a/src/greeter/entrance_greeter_main.h b/src/greeter/entrance_greeter_main.h
index 27d93d4..9a0ada2 100644
--- a/src/greeter/entrance_greeter_main.h
+++ b/src/greeter/entrance_greeter_main.h
@@ -10,6 +10,9 @@
 extern "C" {
 #endif
 
+int entrance_greeter_cli_run(int argc, char **argv);
+int entrance_greeter_canvas_preview(Ecore_Evas *canvas);
+
 void entrance_greeter_cursor_hide(Evas_Object *window);
 
 /* Takes ownership of the window. */
diff --git a/src/greeter/meson.build b/src/greeter/meson.build
index 0498644..dd43ca6 100644
--- a/src/greeter/meson.build
+++ b/src/greeter/meson.build
@@ -51,14 +51,28 @@ greeter_sources = files([
 subdir('gadgets')
 subdir('screensaver')
 
-executable('entrance-greeter-efl', greeter_sources, desktop_entry_sources, config_file_sources, state_sources,
+greeter_c_args = [
+  '-D_POSIX_C_SOURCE=200809L',
+  '-DEDJE_COMPILER="' + edje_cc.full_path() + '"',
+  '-DGREETER_LOCALEDIR="' + (prefix / get_option('localedir')) + '"',
+  '-DGREETER_BUILD_LOCALEDIR="' + (meson.project_build_root() / 'po') + '"',
+] + greeter_backend_args
+
+greeter_ui = static_library('entrance-greeter-ui',
+  greeter_sources, desktop_entry_sources, config_file_sources, state_sources,
   dependencies: greeter_deps,
   include_directories: common_inc,
-  c_args: [
-    '-D_POSIX_C_SOURCE=200809L',
-    '-DEDJE_COMPILER="' + edje_cc.full_path() + '"',
-    '-DGREETER_LOCALEDIR="' + (prefix / get_option('localedir')) + '"',
-    '-DGREETER_BUILD_LOCALEDIR="' + (meson.project_build_root() / 'po') + '"',
-  ] + greeter_backend_args,
-  install: true
+  c_args: greeter_c_args,
+)
+
+greeter_ui_dep = declare_dependency(
+  link_with: greeter_ui,
+  dependencies: greeter_deps,
+  include_directories: include_directories('.'),
+)
+
+executable('entrance-greeter-efl', 'entrance_greeter_cli.c',
+  dependencies: greeter_ui_dep,
+  c_args: greeter_c_args,
+  install: true,
 )

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

Reply via email to