This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch up/rescale
in repository enlightenment.
View the commit online.
commit 12064b9e89076850897af3c1a835eca8648df4fd
Author: Cedric BAIL <[email protected]>
AuthorDate: Sat Nov 28 18:39:58 2026 -0600
e_comp_wl - send the fractional scale when an output's scale changes
wp_fractional_scale_v1's preferred_scale was sent when the client asked
for it and when its window moved to another zone. When the scale of the
window's output changed, the client was not told, and kept drawing for
the old scale.
The preferred scale is now worked out again wherever the window is
rescaled, so for both, and sent when it differs from the last one sent.
This replaces the zone handler the fractional scale had of its own.
wl-fractional-scale now also sets the scale of the window's output to 3
and waits for 360; it fails without this.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/bin/e_comp_wl.c | 1 +
src/bin/e_comp_wl.h | 3 +++
src/bin/e_comp_wl_extensions.c | 25 ++++++++++---------------
src/tests/wayland/test_fractional_scale.c | 7 ++++++-
4 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 1dd1fa02f..3f15cebf2 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -1639,6 +1639,7 @@ _e_comp_wl_client_rescale(E_Client *ec)
E_Client *sec;
Eina_List *l;
+ e_comp_wl_extension_fractional_scale_update(ec);
if (e_pixmap_usable_get(ec->pixmap))
{
memset(&state, 0, sizeof(state));
diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h
index c5df6a8d3..b7d5dd123 100644
--- a/src/bin/e_comp_wl.h
+++ b/src/bin/e_comp_wl.h
@@ -416,6 +416,8 @@ struct _E_Comp_Wl_Client_Data
* most one of each. */
struct wl_resource *viewport_resource;
struct wl_resource *fractional_scale_resource;
+ /* The preferred_scale last sent on it, in 120ths. */
+ int fractional_scale;
Eina_List *frames;
/* wp_presentation_feedback of the committed content, which is waiting
@@ -541,6 +543,7 @@ E_API Eina_Bool e_comp_wl_grab_client_mouse_move(const Ecore_Event_Mouse_Move *e
E_API Eina_Bool e_comp_wl_grab_client_mouse_button(const Ecore_Event_Mouse_Button *ev);
EINTERN void e_comp_wl_extension_xdg_output_update(E_Comp_Wl_Output *output);
+EINTERN void e_comp_wl_extension_fractional_scale_update(E_Client *ec);
/* Each wp_presentation_feedback ends with exactly one of presented or
* discarded. These take the list, leave it empty and destroy the
* resources. */
diff --git a/src/bin/e_comp_wl_extensions.c b/src/bin/e_comp_wl_extensions.c
index 1b4982ec0..2e86fe403 100644
--- a/src/bin/e_comp_wl_extensions.c
+++ b/src/bin/e_comp_wl_extensions.c
@@ -1812,8 +1812,17 @@ static void
_e_fractional_scale_send(E_Client *ec)
{
if (!ec->comp_data->fractional_scale_resource) return;
+ ec->comp_data->fractional_scale = e_comp_wl_client_scale_get(ec) * 120;
wp_fractional_scale_v1_send_preferred_scale(ec->comp_data->fractional_scale_resource,
- e_comp_wl_client_scale_get(ec) * 120);
+ ec->comp_data->fractional_scale);
+}
+
+/* The window's scale may have changed. */
+EINTERN void
+e_comp_wl_extension_fractional_scale_update(E_Client *ec)
+{
+ if (e_comp_wl_client_scale_get(ec) * 120 == ec->comp_data->fractional_scale) return;
+ _e_fractional_scale_send(ec);
}
static void
@@ -1874,19 +1883,6 @@ static const struct wp_fractional_scale_manager_v1_interface _e_wp_fractional_sc
_e_wp_fractional_scale_manager_v1_cb_get_fractional_scale,
};
-/* Another zone may be another output, with another scale. The comp_data
- * of an X window is not E_Comp_Wl_Client_Data. */
-static Eina_Bool
-_e_fractional_scale_cb_zone_set(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
-{
- E_Event_Client_Zone_Set *ev = event;
-
- if ((!e_object_is_del(E_OBJECT(ev->ec))) &&
- (e_pixmap_type_get(ev->ec->pixmap) == E_PIXMAP_TYPE_WL))
- _e_fractional_scale_send(ev->ec);
- return ECORE_CALLBACK_RENEW;
-}
-
/* wp_single_pixel_buffer_v1: a 1x1 wl_buffer of one colour, made by E
* and not shared with the client, which stretches it with a wp_viewport.
* Its user data is the pixel, premultiplied ARGB8888 like the shm buffers
@@ -2102,7 +2098,6 @@ e_comp_wl_extensions_init(void)
e_comp_wl_privileges_init();
ecore_event_handler_add(ECORE_WL2_EVENT_SYNC_DONE, _dmabuf_add, NULL);
- ecore_event_handler_add(E_EVENT_CLIENT_ZONE_SET, _e_fractional_scale_cb_zone_set, NULL);
e_client_hook_add(E_CLIENT_HOOK_MOVE_BEGIN, _e_comp_wl_extensions_client_move_begin, NULL);
e_client_hook_add(E_CLIENT_HOOK_MOVE_END, _e_comp_wl_extensions_client_move_end, NULL);
diff --git a/src/tests/wayland/test_fractional_scale.c b/src/tests/wayland/test_fractional_scale.c
index d98707a1f..4aa35271b 100644
--- a/src/tests/wayland/test_fractional_scale.c
+++ b/src/tests/wayland/test_fractional_scale.c
@@ -1,5 +1,6 @@
/* wp_fractional_scale_v1: a surface is told the scale of its output as
- * soon as it asks, and again when it moves to an output of another scale.
+ * soon as it asks, and again when it moves to an output of another scale
+ * or the scale of its output changes.
* A client that follows it draws its buffer at that scale and shows it
* through a viewport destination, one buffer pixel per screen pixel. */
#define _GNU_SOURCE 1
@@ -147,6 +148,10 @@ main(void)
wl_test_move_surface(tester, surface, 1200, 100);
_preferred_wait(&ctx, 120, "moved to an output of scale 1");
+ ctx.preferred = 0;
+ wl_test_output_scale_set(tester, 1, 3);
+ _preferred_wait(&ctx, 360, "its output now of scale 3");
+
wp_fractional_scale_manager_v1_get_fractional_scale(manager, surface);
if (tk_protocol_error(ctx.tk, NULL) !=
WP_FRACTIONAL_SCALE_MANAGER_V1_ERROR_FRACTIONAL_SCALE_EXISTS)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.