This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch up/x11-iconify-flake
in repository enlightenment.
View the commit online.
commit baf636ee6fb6bbdeb3257ca07e31b8cb1c1f4e17
Author: Cedric BAIL <[email protected]>
AuthorDate: Fri Nov 27 21:50:43 2026 -0600
wl_desktop_shell - send and take sizes in surface-local units
Configure sizes, popup positions and configure bounds are worked out
in canvas pixels and go to the client divided by its scale, in the one
function each shell sends a toplevel configure through, since maximize
and fullscreen call it directly. A zero size means "you choose" and
stays zero.
Window geometry belongs to one surface, so it is stored in canvas
pixels when it is set, which is what the frame geometry it drives is
in. An xdg_positioner can be shared by several popups and handed back
by xdg_popup.reposition, so it is scaled into a copy where it is
applied; scaling it in place would compound the factor on every use.
The offset of a wl_shell or xdg_shell v5 popup is in its parent's
units, and is scaled by the parent's scale where it is applied.
xdg, zxdg_shell_v6, xdg_shell v5 and wl_shell all do it, so no shell
is left where the conversion silently does not happen.
Still an identity: e_comp_wl_client_scale_get() returns 1.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/modules/wl_desktop_shell/wl_shell.c | 11 +++++++---
src/modules/wl_desktop_shell/xdg.c | 36 +++++++++++++++++++++++++++++----
src/modules/wl_desktop_shell/xdg5.c | 15 +++++++++++---
src/modules/wl_desktop_shell/xdg6.c | 31 ++++++++++++++++++++++++++--
4 files changed, 81 insertions(+), 12 deletions(-)
diff --git a/src/modules/wl_desktop_shell/wl_shell.c b/src/modules/wl_desktop_shell/wl_shell.c
index ca812c2ca..505e1e957 100644
--- a/src/modules/wl_desktop_shell/wl_shell.c
+++ b/src/modules/wl_desktop_shell/wl_shell.c
@@ -323,6 +323,7 @@ static void
_wl_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges, int32_t width, int32_t height)
{
E_Client *ec;
+ int scale;
if (!(ec = wl_resource_get_user_data(resource)))
{
@@ -333,7 +334,8 @@ _wl_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges, i
}
if (e_client_util_is_popup(ec)) return;
- wl_shell_surface_send_configure(resource, edges, width, height);
+ scale = e_comp_wl_client_scale_get(ec);
+ wl_shell_surface_send_configure(resource, edges, width / scale, height / scale);
}
static void
@@ -358,11 +360,14 @@ _wl_shell_surface_configure(struct wl_resource *resource, Evas_Coord x, Evas_Coo
{
if (e_client_util_is_popup(ec))
{
- x = E_CLAMP(ec->parent->client.x + ec->comp_data->popup.x,
+ /* In the parent's surface-local units. */
+ int scale = e_comp_wl_client_scale_get(ec->parent);
+
+ x = E_CLAMP(ec->parent->client.x + (ec->comp_data->popup.x * scale),
ec->parent->client.x,
ec->parent->client.x +
ec->parent->client.w);
- y = E_CLAMP(ec->parent->client.y + ec->comp_data->popup.y,
+ y = E_CLAMP(ec->parent->client.y + (ec->comp_data->popup.y * scale),
ec->parent->client.y,
ec->parent->client.y +
ec->parent->client.h);
diff --git a/src/modules/wl_desktop_shell/xdg.c b/src/modules/wl_desktop_shell/xdg.c
index d4acec002..f81247788 100644
--- a/src/modules/wl_desktop_shell/xdg.c
+++ b/src/modules/wl_desktop_shell/xdg.c
@@ -473,14 +473,15 @@ _e_xdg_toplevel_wm_capabilities_send(struct wl_resource *resource)
static void
_e_xdg_toplevel_configure_bounds_send(struct wl_resource *resource, E_Client *ec)
{
- int zw, zh;
+ int zw, zh, scale;
if (wl_resource_get_version(resource) < XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION)
return;
if (!ec->zone) return;
e_zone_useful_geometry_get(ec->zone, NULL, NULL, &zw, &zh);
- xdg_toplevel_send_configure_bounds(resource, zw, zh);
+ scale = e_comp_wl_client_scale_get(ec);
+ xdg_toplevel_send_configure_bounds(resource, zw / scale, zh / scale);
}
static void
@@ -501,6 +502,9 @@ _xdg_shell_surface_send_configure(struct wl_resource *resource, Eina_Bool fullsc
return;
}
if (e_client_util_is_popup(ec)) return;
+ /* Canvas pixels in, surface-local units out. */
+ width /= e_comp_wl_client_scale_get(ec);
+ height /= e_comp_wl_client_scale_get(ec);
focused = e_client_focused_get();
if (ec == focused)
activated = 1;
@@ -599,6 +603,7 @@ static void
_e_xdg_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges, int32_t width, int32_t height)
{
E_Client *ec;
+ int scale;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
@@ -609,6 +614,8 @@ _e_xdg_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges
return;
}
if (e_object_is_del(E_OBJECT(ec))) return;
+ /* Canvas pixels in, surface-local units out. */
+ scale = e_comp_wl_client_scale_get(ec);
if (e_client_util_is_popup(ec))
{
E_Shell_Data *shd;
@@ -616,7 +623,9 @@ _e_xdg_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges
shd = ec->comp_data->shell.data;
serial = wl_display_next_serial(e_comp_wl->wl.disp);
- xdg_popup_send_configure(resource, ec->x - ec->parent->x, ec->y - ec->parent->y, width ?: ec->w, height ?: ec->h);
+ xdg_popup_send_configure(resource,
+ (ec->x - ec->parent->x) / scale, (ec->y - ec->parent->y) / scale,
+ (width ?: ec->w) / scale, (height ?: ec->h) / scale);
xdg_surface_send_configure(shd->surface, serial);
ec->comp_data->need_xdg_configure = 0;
return;
@@ -825,6 +834,7 @@ static void
_e_xdg_surface_cb_window_geometry_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t x, int32_t y, int32_t w, int32_t h)
{
E_Client *ec;
+ int scale;
ec = wl_resource_get_user_data(resource);
if (!ec)
@@ -834,7 +844,10 @@ _e_xdg_surface_cb_window_geometry_set(struct wl_client *client EINA_UNUSED, stru
return;
}
if (e_object_is_del(E_OBJECT(ec))) return;
- EINA_RECTANGLE_SET(&ec->comp_data->shell.window, x, y, w, h);
+ /* Kept in canvas pixels, like the frame geometry it sets. */
+ scale = e_comp_wl_client_scale_get(ec);
+ EINA_RECTANGLE_SET(&ec->comp_data->shell.window,
+ x * scale, y * scale, w * scale, h * scale);
//DBG("XDG_SHELL: Window Geom Set: %d \t%d %d, %d %d", wl_resource_get_id(resource), x, y, w, h);
}
@@ -1160,6 +1173,21 @@ _apply_positioner(E_Client *ec, Positioner *p)
{
int x, y;
int zx, zy, zw, zh;
+ Positioner scaled;
+ int scale = e_comp_wl_client_scale_get(ec);
+
+ /* A positioner can be shared by several popups, so it is scaled into a
+ * copy. */
+ scaled = *p;
+ scaled.size.w *= scale;
+ scaled.size.h *= scale;
+ scaled.anchor_rect.x *= scale;
+ scaled.anchor_rect.y *= scale;
+ scaled.anchor_rect.w *= scale;
+ scaled.anchor_rect.h *= scale;
+ scaled.offset.x *= scale;
+ scaled.offset.y *= scale;
+ p = &scaled;
/* apply base geometry:
* coords are relative to parent
diff --git a/src/modules/wl_desktop_shell/xdg5.c b/src/modules/wl_desktop_shell/xdg5.c
index 7921783bd..14319b8f2 100644
--- a/src/modules/wl_desktop_shell/xdg5.c
+++ b/src/modules/wl_desktop_shell/xdg5.c
@@ -50,6 +50,9 @@ _xdg_shell_surface_send_configure(struct wl_resource *resource, Eina_Bool fullsc
return;
}
if (e_client_util_is_popup(ec)) return;
+ /* Canvas pixels in, surface-local units out. */
+ width /= e_comp_wl_client_scale_get(ec);
+ height /= e_comp_wl_client_scale_get(ec);
focused = e_client_focused_get();
if (ec == focused)
activated = 1;
@@ -373,6 +376,7 @@ static void
_e_xdg_shell_surface_cb_window_geometry_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t x, int32_t y, int32_t w, int32_t h)
{
E_Client *ec;
+ int scale;
ec = wl_resource_get_user_data(resource);
if (!ec)
@@ -382,7 +386,9 @@ _e_xdg_shell_surface_cb_window_geometry_set(struct wl_client *client EINA_UNUSED
return;
}
if (e_object_is_del(E_OBJECT(ec))) return;
- EINA_RECTANGLE_SET(&ec->comp_data->shell.window, x, y, w, h);
+ scale = e_comp_wl_client_scale_get(ec);
+ EINA_RECTANGLE_SET(&ec->comp_data->shell.window,
+ x * scale, y * scale, w * scale, h * scale);
//DBG("XDG_SHELL: Window Geom Set: %d \t%d %d, %d %d", wl_resource_get_id(resource), x, y, w, h);
}
@@ -552,8 +558,11 @@ _e_xdg_shell_surface_configure(struct wl_resource *resource, Evas_Coord x, Evas_
{
if (e_client_util_is_popup(ec))
{
- x = ec->parent->client.x + ec->comp_data->popup.x;
- y = ec->parent->client.y + ec->comp_data->popup.y;
+ /* In the parent's surface-local units. */
+ int scale = e_comp_wl_client_scale_get(ec->parent);
+
+ x = ec->parent->client.x + (ec->comp_data->popup.x * scale);
+ y = ec->parent->client.y + (ec->comp_data->popup.y * scale);
}
}
diff --git a/src/modules/wl_desktop_shell/xdg6.c b/src/modules/wl_desktop_shell/xdg6.c
index 038431d7d..c1a08a0e8 100644
--- a/src/modules/wl_desktop_shell/xdg6.c
+++ b/src/modules/wl_desktop_shell/xdg6.c
@@ -319,6 +319,9 @@ _xdg_shell_surface_send_configure(struct wl_resource *resource, Eina_Bool fullsc
return;
}
if (e_client_util_is_popup(ec)) return;
+ /* Canvas pixels in, surface-local units out. */
+ width /= e_comp_wl_client_scale_get(ec);
+ height /= e_comp_wl_client_scale_get(ec);
focused = e_client_focused_get();
if (ec == focused)
activated = 1;
@@ -394,6 +397,7 @@ static void
_e_xdg_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges, int32_t width, int32_t height)
{
E_Client *ec;
+ int scale;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
@@ -404,6 +408,8 @@ _e_xdg_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges
return;
}
if (e_object_is_del(E_OBJECT(ec))) return;
+ /* Canvas pixels in, surface-local units out. */
+ scale = e_comp_wl_client_scale_get(ec);
if (e_client_util_is_popup(ec))
{
E_Shell_Data *shd;
@@ -411,7 +417,9 @@ _e_xdg_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges
shd = ec->comp_data->shell.data;
serial = wl_display_next_serial(e_comp_wl->wl.disp);
- zxdg_popup_v6_send_configure(resource, ec->x - ec->parent->x, ec->y - ec->parent->y, width ?: ec->w, height ?: ec->h);
+ zxdg_popup_v6_send_configure(resource,
+ (ec->x - ec->parent->x) / scale, (ec->y - ec->parent->y) / scale,
+ (width ?: ec->w) / scale, (height ?: ec->h) / scale);
zxdg_surface_v6_send_configure(shd->surface, serial);
ec->comp_data->need_xdg_configure = 0;
return;
@@ -543,6 +551,7 @@ static void
_e_xdg_surface_cb_window_geometry_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t x, int32_t y, int32_t w, int32_t h)
{
E_Client *ec;
+ int scale;
ec = wl_resource_get_user_data(resource);
if (!ec)
@@ -552,7 +561,10 @@ _e_xdg_surface_cb_window_geometry_set(struct wl_client *client EINA_UNUSED, stru
return;
}
if (e_object_is_del(E_OBJECT(ec))) return;
- EINA_RECTANGLE_SET(&ec->comp_data->shell.window, x, y, w, h);
+ /* Kept in canvas pixels, like the frame geometry it sets. */
+ scale = e_comp_wl_client_scale_get(ec);
+ EINA_RECTANGLE_SET(&ec->comp_data->shell.window,
+ x * scale, y * scale, w * scale, h * scale);
//DBG("XDG_SHELL: Window Geom Set: %d \t%d %d, %d %d", wl_resource_get_id(resource), x, y, w, h);
}
@@ -819,6 +831,21 @@ _apply_positioner(E_Client *ec, Positioner *p)
{
int x, y;
int zx, zy, zw, zh;
+ Positioner scaled;
+ int scale = e_comp_wl_client_scale_get(ec);
+
+ /* A positioner can be shared by several popups, so it is scaled into a
+ * copy. */
+ scaled = *p;
+ scaled.size.w *= scale;
+ scaled.size.h *= scale;
+ scaled.anchor_rect.x *= scale;
+ scaled.anchor_rect.y *= scale;
+ scaled.anchor_rect.w *= scale;
+ scaled.anchor_rect.h *= scale;
+ scaled.offset.x *= scale;
+ scaled.offset.y *= scale;
+ p = &scaled;
/* apply base geometry:
* coords are relative to parent
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.