This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch wl/browser-all
in repository enlightenment.
View the commit online.
commit cee2a7dff715fa178d800bbfcae85df457c5610b
Author: Cedric BAIL <[email protected]>
AuthorDate: Sun Aug 16 12:19:08 2026 -0600
e_comp_wl - add zxdg_output_manager_v1
wl_output reports a mode in physical pixels with an integer scale beside it
and leaves the client to divide. xdg_output reports the rectangle a client
should lay itself out against directly, with the scale already taken out.
There is no other way to ask, which is why Chromium binds it - and why a
toolkit that wants to know how big the desktop is in the units it draws in
currently has to guess.
Advertised at version 3, which is what the protocol goes up to. The name event
arrived in 2 and the done event was deprecated in 3 in favour of
wl_output.done, so which "that is all of it" marker goes out depends on the
version the client bound; both are sent from the same place.
Logical geometry is the physical rectangle with the scale divided out, rather
than a second set of coordinates kept alongside, because E's canvas is in
physical pixels throughout. That is the whole answer only while every output
shares a scale. Getting a mixed-DPI arrangement right means placing zones in
logical space to begin with, which is a change to how E arranges screens and
is deliberately not papered over here.
Measured: XdgOutputV1Test.xdg_output_properties_set goes from skipped - the
global was not there to bind - to passing. Full suite 756 -> 757, failure set
unchanged. In-tree suite 9/9, with wl-globals updated to expect the new
global, which is the check that would have caught it being advertised at the
wrong version.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FtoiXoSKUmZb6Aix6U3GZS
---
src/bin/e_comp_wl.h | 4 ++
src/bin/e_comp_wl_extensions.c | 85 ++++++++++++++++++++++++++++++++++++++
src/bin/generated/meson.build | 1 +
src/tests/wayland/globals.expected | 1 +
4 files changed, 91 insertions(+)
diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h
index 1b383bb8a..a62967b50 100644
--- a/src/bin/e_comp_wl.h
+++ b/src/bin/e_comp_wl.h
@@ -182,6 +182,10 @@ typedef struct E_Comp_Wl_Extension_Data
{
struct wl_global *global;
} wp_viewporter;
+ struct
+ {
+ struct wl_global *global;
+ } zxdg_output_manager_v1;
/* end xdg-foreign */
struct
{
diff --git a/src/bin/e_comp_wl_extensions.c b/src/bin/e_comp_wl_extensions.c
index 58ae69e2f..17df3e1c1 100644
--- a/src/bin/e_comp_wl_extensions.c
+++ b/src/bin/e_comp_wl_extensions.c
@@ -9,6 +9,7 @@
#include "action_route-server-protocol.h"
#include "xdg-activation-v1-server-protocol.h"
#include "viewporter-server-protocol.h"
+#include "xdg-output-unstable-v1-server-protocol.h"
/* mutter uses 32, seems reasonable */
#define HANDLE_LEN 32
@@ -1350,6 +1351,88 @@ static const struct wp_viewporter_interface _e_wp_viewporter_interface =
.get_viewport = _e_wp_viewporter_cb_get_viewport,
};
+/* zxdg_output_manager_v1.
+ *
+ * wl_output reports a mode in physical pixels with an integer scale beside it
+ * and leaves the client to divide. xdg_output reports the rectangle a client
+ * should lay itself out against directly, with the scale already taken out,
+ * and it is the only way to ask - which is why Chromium binds it. */
+
+static void
+_e_zxdg_output_v1_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
+{
+ wl_resource_destroy(resource);
+}
+
+static const struct zxdg_output_v1_interface _e_zxdg_output_v1_interface =
+{
+ _e_zxdg_output_v1_cb_destroy,
+};
+
+static void
+_e_zxdg_output_manager_v1_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
+{
+ wl_resource_destroy(resource);
+}
+
+static void
+_e_zxdg_output_manager_v1_cb_xdg_output_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *output_resource)
+{
+ E_Comp_Wl_Output *output;
+ struct wl_resource *res;
+ uint32_t version;
+ int scale;
+
+ version = wl_resource_get_version(resource);
+ res = wl_resource_create(client, &zxdg_output_v1_interface, version, id);
+ if (!res)
+ {
+ wl_client_post_no_memory(client);
+ return;
+ }
+ wl_resource_set_implementation(res, &_e_zxdg_output_v1_interface, NULL, NULL);
+
+ /* A wl_output can outlive the E_Comp_Wl_Output behind it by a round trip,
+ * and the protocol gives no error for asking about one that has gone.
+ * Answer with an object that reports nothing rather than inventing a
+ * geometry; the client is about to be told the output is gone anyway. */
+ output = wl_resource_get_user_data(output_resource);
+ if (!output) return;
+
+ scale = (output->scale >= 1.0) ? (int)(output->scale + 0.5) : 1;
+
+ /* Logical geometry is the physical rectangle with the scale divided out.
+ * It is a division here rather than a second set of coordinates kept
+ * alongside because E's canvas is in physical pixels throughout.
+ *
+ * That is the whole answer only while every output shares a scale. Laying
+ * out mixed-DPI outputs properly means placing zones in logical space to
+ * begin with, which is a change to how E arranges screens and not
+ * something this file can paper over. */
+ zxdg_output_v1_send_logical_position(res, output->x / scale, output->y / scale);
+ zxdg_output_v1_send_logical_size(res, output->w / scale, output->h / scale);
+
+ if (version >= ZXDG_OUTPUT_V1_NAME_SINCE_VERSION)
+ zxdg_output_v1_send_name(res, output->name ?: output->id ?: "");
+ if ((version >= ZXDG_OUTPUT_V1_DESCRIPTION_SINCE_VERSION) && output->model)
+ zxdg_output_v1_send_description(res, output->model);
+
+ /* "For objects version 3 onwards, this event is deprecated. Compositors
+ * are not required to send it anymore and must send wl_output.done
+ * instead." Both mean "that is all of it"; which one the client waits on
+ * depends on the version it bound. */
+ if (version < 3)
+ zxdg_output_v1_send_done(res);
+ else if (wl_resource_get_version(output_resource) >= WL_OUTPUT_DONE_SINCE_VERSION)
+ wl_output_send_done(output_resource);
+}
+
+static const struct zxdg_output_manager_v1_interface _e_zxdg_output_manager_v1_interface =
+{
+ _e_zxdg_output_manager_v1_cb_destroy,
+ _e_zxdg_output_manager_v1_cb_xdg_output_get,
+};
+
#define GLOBAL_BIND_CB(NAME, IFACE, ...) \
static void \
_e_comp_wl_##NAME##_cb_bind(struct wl_client *client, void *data EINA_UNUSED, uint32_t version, uint32_t id) \
@@ -1374,6 +1457,7 @@ GLOBAL_BIND_CB(zxdg_importer_v1, zxdg_importer_v1_interface)
GLOBAL_BIND_CB(zwp_relative_pointer_manager_v1, zwp_relative_pointer_manager_v1_interface)
GLOBAL_BIND_CB(zwp_pointer_constraints_v1, zwp_pointer_constraints_v1_interface)
GLOBAL_BIND_CB(xdg_activation_v1, xdg_activation_v1_interface)
+GLOBAL_BIND_CB(zxdg_output_manager_v1, zxdg_output_manager_v1_interface)
GLOBAL_BIND_CB(action_route, action_route_interface,
e_binding_key_list_cb = _action_route_key_list_cb;
key_bindings = eina_hash_string_superfast_new(NULL);
@@ -1474,6 +1558,7 @@ e_comp_wl_extensions_init(void)
GLOBAL_CREATE_OR_RETURN(action_route, action_route_interface, 1);
GLOBAL_CREATE_OR_RETURN(xdg_activation_v1, xdg_activation_v1_interface, 1);
GLOBAL_CREATE_OR_RETURN(wp_viewporter, wp_viewporter_interface, 1);
+ GLOBAL_CREATE_OR_RETURN(zxdg_output_manager_v1, zxdg_output_manager_v1_interface, 3);
ecore_event_handler_add(ECORE_WL2_EVENT_SYNC_DONE, _dmabuf_add, NULL);
diff --git a/src/bin/generated/meson.build b/src/bin/generated/meson.build
index cdb120ae3..5b62da3ab 100644
--- a/src/bin/generated/meson.build
+++ b/src/bin/generated/meson.build
@@ -8,6 +8,7 @@ protos = [
'@0@/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml'.format(dir_wayland_protocols),
'@0@/staging/xdg-activation/xdg-activation-v1.xml'.format(dir_wayland_protocols),
'@0@/stable/viewporter/viewporter.xml'.format(dir_wayland_protocols),
+ '@0@/unstable/xdg-output/xdg-output-unstable-v1.xml'.format(dir_wayland_protocols),
]
proto_c = []
diff --git a/src/tests/wayland/globals.expected b/src/tests/wayland/globals.expected
index b1f538e0c..6197f36ab 100644
--- a/src/tests/wayland/globals.expected
+++ b/src/tests/wayland/globals.expected
@@ -15,4 +15,5 @@ zwp_pointer_constraints_v1 1
zwp_relative_pointer_manager_v1 1
zxdg_exporter_v1 1
zxdg_importer_v1 1
+zxdg_output_manager_v1 3
zxdg_shell_v6 1
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.