Fix tasklist size when /force-all-external == TRUE
@ninetls
Submitted by Viktor Odintsev Assigned to Simon Steinbeiß @ochosi
Description
Created attachment 7320 Extend GtkSocket and GtkPlug in order to pass min and nat sizes
GtkSocket is designed so it can't get remote minimum and natural sizes, only minimum is gotten. GtkPlug is designed this way too. It provides only minimum size.
During GTK3 migration the property to control special behavior for tasklist was removed (I didn't remember its name) and replaced with min/nat sizes logic. This logic broke tasklist size in /force-all-external mode.
My approach to fix this problem:
- I noticed that WM hints can hold a lot of size hints: min size, base size, max size, etc. I decided to use these hints to pass the size.
- I extended GtkPlug and in the moment GdkWindow gets these hints I provide my own hints for min and base sizes.
- I extended GtkSocket so it will handle min and base size hints separately allowing to use first one as minimum size and the second one as natural size.
There is a single problem: each time window updates hints, application will get a message for this event. This is useful since I can cache these values and don't call X server to get these sizes every time they required. So GtkSocket does… GtkSocket uses GdkWindow event handler which doesn't allow other handlers to handle this event in the next. So I can't receive this event but I should get real sizes → I make a new X server call every time. This is more expensive. But in my experience there were no serious consequences. It seems that GtkSocket does this caching only for corner cases but our case is more specific.
Anyway, if somebody can find the solution of this problem, this patch will be a complete solution.
Patch 7320, "Extend GtkSocket and GtkPlug in order to pass min and nat sizes":
0001-Extend-GtkSocket-and-GtkPlug-in-order-to-pass-min-an.patch
Version: 4.13.1