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 a9f3bb624242278181a8ac965b3fa7ffee215049
Author: Cedric BAIL <[email protected]>
AuthorDate: Sun Aug 16 23:06:19 2026 -0600
e_comp_wl - unmaximise has to ask for the window back, not for its old buffer
Maximise a browser and restore it, and it comes back bigger. Measured on
Firefox: 973x743 before, 1025x795 after. Do it again and it is 1077x847. The
difference is 52 pixels each way, which is Firefox's 26-pixel drop shadow on
each side.
ec->saved is recorded in content units - e_client_maximize stores
ec->client.w, the whole buffer, shadow included - and _e_comp_wl_evas_cb_
unmaximize_pre put it straight into ec->w, which is the frame. A configure
carries window geometry, so the client was told to make its *window* as big as
its last *buffer*, and did.
Converting between the two is not available at that moment either. The insets
come from the window geometry the client last set, and a maximised window has
no shadow - traced on Firefox, which commits window geometry 0x0 while
maximised and 852x652+26+23 after - so the conversion factor is zero exactly
when it is needed.
Window geometry is the one size that means the same thing at both ends, so
record it on the way in and ask for it back on the way out. Zero until the
window has been maximised once, which is also the "we have nothing better than
ec->saved" case.
The X path is untouched: ec->saved keeps its meaning, and the generic
e_client_unmaximize keeps using it.
test_browser.c asserts the round trip against Firefox, Chromium and Brave.
Firefox now restores to exactly the size it started at.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
---
src/bin/e_comp_wl.c | 6 ++++++
src/bin/e_comp_wl.h | 13 +++++++++++++
2 files changed, 19 insertions(+)
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 33134f56e..fb5955dc1 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -1108,6 +1108,8 @@ _e_comp_wl_evas_cb_unmaximize_pre(void *data, Evas_Object *obj EINA_UNUSED, void
e_client_unmaximize_geometry_get(ec, *max, NULL, NULL, &w, &h);
if (ec->internal)
e_comp_object_frame_wh_unadjust(ec->frame, w, h, &w, &h);
+ else if (ec->comp_data->unmax_w && ec->comp_data->unmax_h)
+ w = ec->comp_data->unmax_w, h = ec->comp_data->unmax_h;
ew = *ecw, eh = *ech;
*ecw = w, *ech = h;
}
@@ -1136,6 +1138,10 @@ _e_comp_wl_evas_cb_maximize_pre(void *data, Evas_Object *obj EINA_UNUSED, void *
int w, h, ew = 0, eh = 0, *ecw, *ech;
unsigned int pmax = ec->maximized;
ec->comp_data->max = *max;
+ /* Before anything changes: what the window was, in the units a
+ * configure speaks. See unmax_w in e_comp_wl.h. */
+ if (!(ec->maximized & E_MAXIMIZE_TYPE))
+ ec->comp_data->unmax_w = ec->w, ec->comp_data->unmax_h = ec->h;
if (ec->internal)
ecw = &ec->client.w, ech = &ec->client.h;
else
diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h
index d0a210b5c..c8fe7ddf4 100644
--- a/src/bin/e_comp_wl.h
+++ b/src/bin/e_comp_wl.h
@@ -429,6 +429,19 @@ struct _E_Comp_Wl_Client_Data
int buffer_scale;
int buffer_transform;
+ /* The window geometry this surface had before it was maximised, so that
+ * unmaximising can ask for it back.
+ *
+ * ec->saved is no good for this on a client that decorates itself. It is
+ * recorded in content units - ec->client, the whole buffer, shadow
+ * included - and a configure carries window geometry, so restoring from it
+ * asks the client to make its *window* as big as its old *buffer*. Worse,
+ * the shadow is not a constant: a maximised window has none, so the insets
+ * that would convert between the two are zero at exactly the moment the
+ * conversion is needed. Window geometry is the one size that means the
+ * same thing at both ends. Zero when the window has never been maximised. */
+ int unmax_w, unmax_h;
+
/* The surface size the previous commit worked out. Kept so that a commit
* which changes the size without attaching a buffer can be told from one
* that changes nothing - compared against the freshly computed size rather
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.