[PATCH weston v4] toytoolkit: Don't draw shadows for maximized windows.
Bill Spitzak
spitzak at gmail.com
Fri Sep 28 13:30:36 PDT 2012
Also need to handle maximized-vertically and maximized-horizontally.
I know it isn't liked but I want to push my recommendation again:
The shell knows how thick the "edges" are of a window. This is the
shadows and *also* the part that you are removing for your "maximized
decorations" (please look carefully at how most X window managers do
"maximize" and you will see it is more than the "shadow"). The client
would tell the shell this information the same way it says the opaque
and input areas.
When a window is maximized the shell tells the client to make it
*larger* than the screen such that the area inside the "edges" fills the
screen. It then clips this to the screen (ie the edges and shadows do
not appear on an adjacent output).
This will handle clients that force the size to be smaller than
maximized, and allow maximize horizontally/vertically to work. It will
also allow "snap to the inside edge" on output sides and windows to each
other, which allows more efficient screen usage, and is supported by
some X window managers. Also allows the 3-edge-removed display that
Windows 7 does when you half-screen-maximize a window. And it will work
with really stupid clients, as long as they report the edges.
However the client should be able to know that the edges are clipped,
for a few reasons:
1. So it does not waste time rendering them
2. So it can avoid using image buffer memory for them
3. So it does not draw any controls out there that it assumes the user
can see.
4. It can produce better graphics than a simple clip. For instance if
there is some shading in the corner to make it look round, this can be
disabled if one edge is clipped.
5. It may want to disable resizing on the clipped edges, though I
believe the way Wayland is being done this can be entirely decided by
the shell.
6. This information, if provided even when not clipped, can be used to
position pop-up menus so they do not go off-screen. This is necessary if
you don't want an xy position of windows sent to clients.
Therefore the shell can tell a client "I want you to act like you are
this size but only this area is needed" in the resize request.
Conversely in the resize notify, the client can say "act like the
surface is this size, but this sub-rectangle is what the image buffer
actually is.
This is not compatible, but the shell can detect "old" clients because
they do not specify the edges and alter the requests.
My feeling is that fullscreen is such a special case that it should
remain a flag like it is now. The alternative of the client saying what
the "contents" area (ie without the titlebar) and the shell resizing it
larger, would be consistent, but does not look necessary to me.
Scott Moreau wrote:
> Add THEME_FRAME_MAXIMIZED flag so the theming system can know not to draw
> shadows for maximized windows. This allows maximized surfaces' content to be
> sized and placed in a more expectable fashion.
More information about the wayland-devel
mailing list