GNOME Bugzilla – Bug 696001
need to know about tiling
Last modified: 2017-08-30 00:41:45 UTC
with csd, we switch off window borders when maximized, and we need to do the same when half-tiled, otherwise we get an odd translucent frame around the half-tiled window. This means that half-tiled needs to be represented in the window state somehow.
One of the most frequently asked questions about CSD is about tiling and how to support that. Typically it's a suggestion to have a flag to not draw decorations at all, but that's going back to the MWM approach of describing the appearance of the window. The idea has always been that instead the compositor will indicate to the application that its tiled on one of more sides. The application in response should not draw shadows on those sides and adjust the decoration to not have rounded corners on that side, if desired etc. More subtly, applications that adjust their compositor assigned size (eg, terminals that snap to grid size or window that preserve aspect ration), should disable these adjustments in any orientation where it's tiled of both sides. For example if an terminal is tiled top and bottom, the application should use all the vertical space assigned by the compositor (eg add padding and center the terminal contents) but can still adjust the space used to grid size while resizing horizontally.
Created attachment 241475 [details] [review] a patch Here is a quick sketch; it implements a GDK_WINDOW_STATE_TILED for the x11 backend. The implementation uses some implementation details of the current mutter tiling: it only does horizontal half-max tiling, and sets the vert-max state when it does so. The patch also adds a get_tiled_edges api to GdkWindow, but the csd code makes no use of it currently, it just treats tiled windows like maximized ones.
Review of attachment 241475 [details] [review]: ::: gtk/gtkwindow.c @@ +6376,3 @@ + priv->tiled = + (event->new_window_state & GDK_WINDOW_STATE_TILED) ? 1 : 0; + g_print ("tiled state changed, now: %d\n", priv->tiled); debug spew needs to go before merging
I've merged just the tiling state for now.
This will be obsoleted by the patches in Bug 783669, slated to land in 3.22.20