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

git pushed a commit to branch master
in repository enlightenment.

View the commit online.

commit 5cf747d45dfd76598941b91e47a61e9da71b4d09
Author: Carsten Haitzler <ras...@rasterman.com>
AuthorDate: Fri May 13 20:35:34 2022 +0100

    wayland support - add watermark and bug message and pause
    
    this will clearly alert a user they are using e in wayland mode. this
    is needed as there seems to be far too much confusion if e is in
    wayland or not and when it is people having issues. this makes sure
    e's wayland session desktop also has the label in it so it's clear etc.
---
 data/images/meson.build                        |   3 ++-
 data/images/wayland.png                        | Bin 0 -> 8742 bytes
 data/session/meson.build                       |  19 ++--------------
 data/session/{ => wl}/enlightenment.desktop.in |  30 ++++++++++++-------------
 data/session/wl/meson.build                    |  12 ++++++++++
 data/session/{ => x}/enlightenment.desktop.in  |   0
 data/session/x/meson.build                     |  12 ++++++++++
 src/bin/e_start_main.c                         |  21 +++++++++++++++++
 src/modules/wl_drm/e_mod_main.c                |  20 +++++++++++++++++
 9 files changed, 84 insertions(+), 33 deletions(-)

diff --git a/data/images/meson.build b/data/images/meson.build
index 5cdafec8e..1ecd95e4b 100644
--- a/data/images/meson.build
+++ b/data/images/meson.build
@@ -2,7 +2,8 @@ install_data([ 'enlightenment.png',
                'test.png',
                'test.jpg',
                'test.edj',
-               'test.svg'
+               'test.svg',
+               'wayland.png'
              ],
              install_dir: join_paths(dir_data, 'enlightenment/data/images')
             )
diff --git a/data/images/wayland.png b/data/images/wayland.png
new file mode 100644
index 000000000..30b59d478
Binary files /dev/null and b/data/images/wayland.png differ
diff --git a/data/session/meson.build b/data/session/meson.build
index 8285b5bbd..1d5cf9255 100644
--- a/data/session/meson.build
+++ b/data/session/meson.build
@@ -1,17 +1,2 @@
-desktop_config = configuration_data()
-desktop_config.set('prefix', dir_prefix)
-desktop_config.set('VERSION', e_version_rev)
-e_desktop = configure_file(input        : 'enlightenment.desktop.in',
-               output       : 'enlightenment.desktop',
-               configuration: desktop_config
-              )
-
-if config_h.has('HAVE_WAYLAND') == true
-	install_data(e_desktop,
-		install_dir  : join_paths(dir_data, 'wayland-sessions'))
-endif
-
-if config_h.has('HAVE_WAYLAND_ONLY') == false
-	install_data(e_desktop,
-		install_dir  : join_paths(dir_data, 'xsessions'))
-endif
+subdir('x')
+subdir('wl')
diff --git a/data/session/enlightenment.desktop.in b/data/session/wl/enlightenment.desktop.in
similarity index 73%
copy from data/session/enlightenment.desktop.in
copy to data/session/wl/enlightenment.desktop.in
index ba664d1d6..75d85cc2a 100644
--- a/data/session/enlightenment.desktop.in
+++ b/data/session/wl/enlightenment.desktop.in
@@ -1,20 +1,20 @@
 [Desktop Entry]
 Type=Application
-Name=Enlightenment
-Name[ca]=Enlightenment
-Name[de]=Enlightenment
-Name[el]=Enlightenment
-Name[eo]=Enlightenment
-Name[fi]=Enlightenment
-Name[fr]=Enlightenment
-Name[gl]=Enlightenment
-Name[ja]=Enlightenment
-Name[ko]=Enlightenment
-Name[ms]=Enlightenment
-Name[pl]=Enlightenment
-Name[ru]=Enlightenment
-Name[sr]=Просвећење
-Name[tr]=Enlightenment
+Name=Enlightenment (Wayland)
+Name[ca]=Enlightenment (Wayland)
+Name[de]=Enlightenment (Wayland)
+Name[el]=Enlightenment (Wayland)
+Name[eo]=Enlightenment (Wayland)
+Name[fi]=Enlightenment (Wayland)
+Name[fr]=Enlightenment (Wayland)
+Name[gl]=Enlightenment (Wayland)
+Name[ja]=Enlightenment (Wayland)
+Name[ko]=Enlightenment (Wayland)
+Name[ms]=Enlightenment (Wayland)
+Name[pl]=Enlightenment (Wayland)
+Name[ru]=Enlightenment (Wayland)
+Name[sr]=Просвећење (Wayland)
+Name[tr]=Enlightenment (Wayland)
 Comment=Log in using Enlightenment (Version @VERSION@)
 Comment[ca]=Iniciar sessió amb Enlightenment (Versió @VERSION@)
 Comment[da]=Log ind med Enlightenment (Version @VERSION@)
diff --git a/data/session/wl/meson.build b/data/session/wl/meson.build
new file mode 100644
index 000000000..b52ff38a9
--- /dev/null
+++ b/data/session/wl/meson.build
@@ -0,0 +1,12 @@
+desktop_config = configuration_data()
+desktop_config.set('prefix', dir_prefix)
+desktop_config.set('VERSION', e_version_rev)
+e_desktop = configure_file(
+  input         : 'enlightenment.desktop.in',
+  output        : 'enlightenment.desktop',
+  configuration : desktop_config)
+
+if config_h.has('HAVE_WAYLAND') == true
+  install_data(e_desktop,
+    install_dir : join_paths(dir_data, 'wayland-sessions'))
+endif
diff --git a/data/session/enlightenment.desktop.in b/data/session/x/enlightenment.desktop.in
similarity index 100%
rename from data/session/enlightenment.desktop.in
rename to data/session/x/enlightenment.desktop.in
diff --git a/data/session/x/meson.build b/data/session/x/meson.build
new file mode 100644
index 000000000..a73278605
--- /dev/null
+++ b/data/session/x/meson.build
@@ -0,0 +1,12 @@
+desktop_config = configuration_data()
+desktop_config.set('prefix', dir_prefix)
+desktop_config.set('VERSION', e_version_rev)
+e_desktop = configure_file(
+  input         : 'enlightenment.desktop.in',
+  output        : 'enlightenment.desktop',
+  configuration : desktop_config)
+
+if config_h.has('HAVE_WAYLAND_ONLY') == false
+  install_data(e_desktop,
+    install_dir : join_paths(dir_data, 'xsessions'))
+endif
diff --git a/src/bin/e_start_main.c b/src/bin/e_start_main.c
index 722063339..d0edb9ef4 100644
--- a/src/bin/e_start_main.c
+++ b/src/bin/e_start_main.c
@@ -566,6 +566,27 @@ main(int argc, char **argv)
    env_set("E_START", argv[0]);
    putenv("E_START_MANAGER=1");
 
+   if ((!getenv("DISPLAY")) && (!getenv("E_WL_FORCE")))
+     {
+        printf("***************************************************************\n");
+        printf("*  You are probably starting Enlightenment in wayland DRM/KMS *\n");
+        printf("***************************************************************\n");
+        printf("                                                               \n");
+        printf("  Wayland support is experimental. It may work for you.        \n");
+        printf("  It may not. If you wish you help out then please do, but     \n");
+        printf("  for a proper experience use Enlightenment in X11.            \n");
+        printf("                                                               \n");
+        printf("  If you do not want this pause and message, please set        \n");
+        printf("  the following environment variable:                          \n");
+        printf("                                                               \n");
+        printf("    E_WL_FORCE=drm                                             \n");
+        printf("                                                               \n");
+        printf("  Example:                                                     \n");
+        printf("                                                               \n");
+        printf("    E_WL_FORCE=drm enlightenment_start                         \n");
+        printf("                                                               \n");
+        sleep(10);
+     }
    for (i = 1; i < argc; i++)
      {
         if ((!strcmp(argv[i], "-h")) || (!strcmp(argv[i], "-help")) ||
diff --git a/src/modules/wl_drm/e_mod_main.c b/src/modules/wl_drm/e_mod_main.c
index 61807a698..f9302fd09 100644
--- a/src/modules/wl_drm/e_mod_main.c
+++ b/src/modules/wl_drm/e_mod_main.c
@@ -738,6 +738,12 @@ _drm2_randr_apply(void)
    if (nh > maxh) nh = maxh;
    if (nw < minw) nw = minw;
    if (nh < minh) nh = minh;
+
+     {
+        Evas *e = ecore_evas_get(e_comp->ee);
+        Evas_Object *o = evas_object_name_find(e, "__e_wl_watermark");
+        if (o) evas_object_move(o, nw - 40 - 16, 16);
+     }
    printf("RRR: set vsize: %ix%i, rot=%i\n", nw, nh, ecore_evas_rotation_get(e_comp->ee));
    ecore_drm2_device_calibrate(dev, nw, nh);
    rot = ecore_evas_rotation_get(e_comp->ee);
@@ -986,6 +992,20 @@ e_modapi_init(E_Module *m)
    efl_event_callback_array_priority_add(e_comp->evas, arr,
                                          EFL_CALLBACK_PRIORITY_BEFORE, NULL);
 
+     {
+        Evas_Object *o;
+        char buf[PATH_MAX];
+
+        o = evas_object_image_filled_add(ecore_evas_get(e_comp->ee));
+        evas_object_name_set(o, "__e_wl_watermark");
+        e_prefix_data_concat_static(buf, "data/images/wayland.png");
+        evas_object_image_file_set(o, buf, NULL);
+        evas_object_move(o, w - 40 - 16, 16);
+        evas_object_resize(o, 40, 40);
+        evas_object_pass_events_set(o, EINA_TRUE);
+        evas_object_layer_set(o, EVAS_LAYER_MAX);
+        evas_object_show(o);
+     }
    return m;
 }
 

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

Reply via email to