After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 736742 - wayland: Pass shadow width to compositor
wayland: Pass shadow width to compositor
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-09-16 12:17 UTC by Matthias Clasen
Modified: 2014-11-23 12:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: Pass shadow width to compositor (1.57 KB, patch)
2014-09-16 12:17 UTC, Matthias Clasen
needs-work Details | Review
wayland: Pass shadow with to the compositor (4.36 KB, patch)
2014-11-11 11:25 UTC, Carlos Garnacho
committed Details | Review

Description Matthias Clasen 2014-09-16 12:17:46 UTC
Without this, edge resistance applies 'outside' the shadow.
Comment 1 Matthias Clasen 2014-09-16 12:17:48 UTC
Created attachment 286290 [details] [review]
wayland: Pass shadow width to compositor
Comment 2 Matthias Clasen 2014-09-17 02:36:36 UTC
As it is, this patch breaks menu positioning under wayland
Comment 3 Matthias Clasen 2014-09-17 15:49:55 UTC
I guess at the very least, we need to call set_window_geometry when width/height change, too
Comment 4 Matthias Clasen 2014-09-17 15:53:44 UTC
As Jasper points out, this  can't work as-is. configure events are in window geometry, not in buffer geometry.

We need to sort this out to keep the geometries separate everywhere.
Comment 5 Matthias Clasen 2014-09-18 10:30:45 UTC
Review of attachment 286290 [details] [review]:

.
Comment 6 Carlos Garnacho 2014-11-11 11:25:05 UTC
Created attachment 290407 [details] [review]
wayland: Pass shadow with to the compositor

Use xdg_surface_set_window_geometry() to tell the compositor about the
shadow widths, this makes some gnome-shell/mutter features (edge resistance,
frames around windows in the overview, side maximization, ...) work alright
with GTK+.

In order to add this, some other places in gdkwindow-wayland had to gain
some knowledge about margins:

- xdg_surface_configure() now syncs the shadow after applying the state,
  and gdk_wayland_window_set_shadow_width() possibly reconfigures the
  window in order to preserve window geometry. This is necessary to keep
  shadows in sync with state/geometry changes, as this does not happen
  all at once.
- xdg_popups relative to an xdg_surface are shown relative to buffer
  coordinates, so the left/top margins must be added there.
Comment 7 Jasper St. Pierre (not reading bugmail) 2014-11-23 02:07:45 UTC
Review of attachment 290407 [details] [review]:

I'm not happy with this and I'm not 100% sure it's right in all cases, but if it works, let's just go with this.
Comment 8 Carlos Garnacho 2014-11-23 12:22:42 UTC
Not fully sure what makes you most unhappy with it, Gdk design issues aside. I can't help but think you're expecting window state/size and geometry to be committed at once, this is however a 2 step process in GTK+, the window state is changed, and the size/state change triggers a border update. It doesn't make sense to try to do this preemptively if the WM may not honor the request.

AFAICT the difference in behavior wrt X11 is mainly that maximized/fullscreen window sizes never extend beyond monitor bounds there (so unsetting the border afterwards comes out right), whereas on Wayland the window borders are still accounted for.

This patch mainly makes set_shadow_width() idempotent wrt window size, not most pretty maybe, but desirable IMO, given the 2 step process.
Comment 9 Carlos Garnacho 2014-11-23 12:26:20 UTC
Not sure why git bz didn't leave comment here, but pushed as 44c412ecc7f