GNOME Bugzilla – Bug 736742
wayland: Pass shadow width to compositor
Last modified: 2014-11-23 12:26:20 UTC
Without this, edge resistance applies 'outside' the shadow.
Created attachment 286290 [details] [review] wayland: Pass shadow width to compositor
As it is, this patch breaks menu positioning under wayland
I guess at the very least, we need to call set_window_geometry when width/height change, too
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.
Review of attachment 286290 [details] [review]: .
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.
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.
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.
Not sure why git bz didn't leave comment here, but pushed as 44c412ecc7f