shell: Replace set_margin with set_window_geometry
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 2 May 2014 14:21:38 +0000 (10:21 -0400)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 17 Jul 2014 20:59:01 +0000 (13:59 -0700)
commitccf48fb4f9923e59e82911a2c03dda9bc70541a0
tree74fd61fddacf0cc9d78929f267519a799ade7aa0
parentbd65e508753b8c1eeadcaa1c223bace2a3477083
shell: Replace set_margin with set_window_geometry

Currently, there is a fun flicker when toggling maximization or
fullscreen on a window in mutter or more sophisicated compositors
and WMs.

What happens is that the client want so go maximized, so we
calculate the size that we want the window to resize to (640x480),
and then add on its margins to find the buffer size (+10 = 660x500),
and then send out a configure event for that size. The client
renders to that size, realizes that it's maximized, and then
says "oh hey, my margins are actually 0 now!", and so the compositor
has to send out another configure event.

In order to fix this, make the the configure request correspond to
the window geometry we'd like the window to be at. At the same time,
replace set_margin with set_window_geometry, where we specify a rect
rather than a border around the window.
clients/window.c
desktop-shell/shell.c
protocol/xdg-shell.xml
src/compositor.h
xwayland/window-manager.c