<html>
    <head>
      <base href="https://bugzilla.gnome.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Wayland] GDK doesn't remember unmaximized or unfullscreen size"
   href="https://bugzilla.gnome.org/show_bug.cgi?id=762713#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Wayland] GDK doesn't remember unmaximized or unfullscreen size"
   href="https://bugzilla.gnome.org/show_bug.cgi?id=762713">bug 762713</a>
              from <span class="vcard"><a href="page.cgi?id=describeuser.html&login=ofourdan%40redhat.com" title="Olivier Fourdan <ofourdan@redhat.com>"> <span class="fn">Olivier Fourdan</span></a>
</span></b>
        <pre>Created <span class=""><a href="attachment.cgi?id=322447" name="attach_322447" title="Simple reproducer for testing purpose.">attachment 322447</a> <a href="attachment.cgi?id=322447&action=edit" title="Simple reproducer for testing purpose.">[details]</a></span>
Simple reproducer for testing purpose.

Attaching a simple reproducer that I used for another bug.

You need to take into account the margins that change when fullscreen and
maximized.

Something like that in your gdk_wayland_window_remember_size() function:

  impl->saved_width = window->width - impl->margin_left - impl->margin_right;
  impl->saved_height = window->height - impl->margin_top - impl->margin_bottom;

That fixes the issue in my case.

I reckon that's because gtk+ does change its shadow width prior to change
states (can be observed by breaking on gdk_wayland_window_set_shadow_width).

That brings us to another issue, which is as to when to save sizes because gtk+
also resize the window to something as large as the screen prior to change its
state... So the saved sizes are wrong.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>