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 37a3f9cd8e411628cda16130397fb97e876deea2
Author: Cedric BAIL <[email protected]>
AuthorDate: Mon Aug 17 20:58:09 2026 -0600

    e_comp_wl - tell a maximized client which edges it is flush against
    
    xdg_toplevel.configure carried only "maximized". tiled_* says "this edge meets
    something, so draw no border or shadow on it and do not expect to resize across
    it", and a maximized window satisfies that on every edge it has been stretched
    to. E computed those states for its tiling module and for half-screen
    maximizes, but never for an ordinary maximize.
    
    That is not cosmetic for a client that draws its own frame: the edges are how
    it knows which of its insets to drop, and one told only "maximized" has to
    guess. Chromium guesses wrong, and the guess outlives the state it was made in.
    Told maximized with no edges it keeps its 16px shadow in its own accounting;
    when it is restored it then reads the configure size as its whole surface and
    takes the shadow out of the inside, so it comes back 32px smaller in each axis.
    Every cycle. Measured: 972x716 -> maximize -> unmaximize -> 940x684, and again
    908x652 after that, until the window is unusable.
    
    Found by comparing against two other compositors, which is also what stopped
    two plausible wrong fixes:
    
      * weston sends configure(0, 0) on unmaximize and lets the client restore its
        own size, so Chromium is never given the chance to get it wrong. Copying
        that would have hidden this rather than fixed it.
      * kwin sends an explicit size, exactly as E does, and Chromium restores to
        the pixel - because kwin also sends maximized plus all four edges. That is
        the whole difference, and it is the one E was missing.
    
    Ruled out by measurement along the way: E's stale SERVER_SIDE decoration
    configure before honouring set_mode, and E sending xdg_toplevel.configure_bounds
    before every configure where kwin sends it once. Both are real differences from
    kwin, neither changes this.
    
    Direction matters and is honoured: a window maximized only horizontally still
    has a top and a bottom edge in open space, and claiming otherwise would take
    away the decorations it should draw there.
    
    Firefox and Brave were already correct here and stay correct.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01FtoiXoSKUmZb6Aix6U3GZS
---
 src/modules/wl_desktop_shell/xdg.c | 47 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 46 insertions(+), 1 deletion(-)

diff --git a/src/modules/wl_desktop_shell/xdg.c b/src/modules/wl_desktop_shell/xdg.c
index 47929d142..89f87eb40 100644
--- a/src/modules/wl_desktop_shell/xdg.c
+++ b/src/modules/wl_desktop_shell/xdg.c
@@ -544,6 +544,48 @@ _e_xdg_toplevel_configure_bounds_send(struct wl_resource *resource, E_Client *ec
    xdg_toplevel_send_configure_bounds(resource, zw, zh);
 }
 
+/* The edges a maximized window is flush against.
+ *
+ * tiled_* says "this edge meets something, so do not draw a border or a shadow
+ * on it and do not expect to be resizable across it", and a maximized window
+ * satisfies that on every edge it has been stretched to. Sending it is not
+ * decoration: a client that draws its own frame needs the edges to know which
+ * of its insets to drop, and one that is told only "maximized" has to guess.
+ *
+ * Chromium guesses wrong, and the guess survives the state it was made in. Told
+ * maximized with no edges it keeps its 16px shadow in its own accounting, and
+ * when it is later restored it reads the configure size as its whole surface
+ * and subtracts the shadow from the inside - so the window comes back 32px
+ * smaller in each axis, every cycle, until it is unusable. Told the edges, it
+ * restores to the pixel. Measured against kwin, which sends maximized plus all
+ * four edges and which Chromium restores correctly under; weston sends
+ * configure(0, 0) on unmaximize instead and never gives it the chance.
+ *
+ * Direction matters. A window maximized only horizontally still has a top and
+ * a bottom edge in open space, and telling it otherwise would take away the
+ * decorations it should be drawing there.
+ */
+static void
+_e_xdg_surface_maximized_edges_add(struct wl_resource *resource, struct wl_array *states, E_Client *ec)
+{
+   E_Maximize dir = ec->maximized & E_MAXIMIZE_DIRECTION;
+
+   /* A configure can be on its way out before ec->maximized has caught up -
+    * comp_data->max carries the intent. Plain maximize is both axes. */
+   if (!dir) dir = E_MAXIMIZE_BOTH;
+
+   if (dir & E_MAXIMIZE_HORIZONTAL)
+     {
+        _e_xdg_surface_state_add(resource, states, XDG_TOPLEVEL_STATE_TILED_LEFT);
+        _e_xdg_surface_state_add(resource, states, XDG_TOPLEVEL_STATE_TILED_RIGHT);
+     }
+   if (dir & E_MAXIMIZE_VERTICAL)
+     {
+        _e_xdg_surface_state_add(resource, states, XDG_TOPLEVEL_STATE_TILED_TOP);
+        _e_xdg_surface_state_add(resource, states, XDG_TOPLEVEL_STATE_TILED_BOTTOM);
+     }
+}
+
 static void
 _xdg_shell_surface_send_configure(struct wl_resource *resource, Eina_Bool fullscreen, Eina_Bool maximized, uint32_t edges, int32_t width, int32_t height)
 {
@@ -615,7 +657,10 @@ _xdg_shell_surface_send_configure(struct wl_resource *resource, Eina_Bool fullsc
    else if (tiled)
      _e_xdg_surface_tiled_states_add(resource, &states, ec);
    else if (maximized)
-     _e_xdg_surface_state_add(resource, &states, XDG_TOPLEVEL_STATE_MAXIMIZED);
+     {
+        _e_xdg_surface_state_add(resource, &states, XDG_TOPLEVEL_STATE_MAXIMIZED);
+        _e_xdg_surface_maximized_edges_add(resource, &states, ec);
+     }
    if (edges)
      _e_xdg_surface_state_add(resource, &states, XDG_TOPLEVEL_STATE_RESIZING);
    if (activated)

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

Reply via email to