We delegate the size request mode, the measuring, and the allocation of
a widget through a GtkLayoutManager instance, if one has been attached
to the widget; otherwise, we fall back to the widget's own implementation.
A base abstract class for layout manager delegate objects.
Layout managers are associated to a single widget, like event
controllers, and are responsible for measuring and allocating the
children of the widget they are bound to.
Otherwise we're getting warnings about allocating a widget we haven't
measured first, which is fair. The contents gizmo itself will later take
care about whether or not the real popover child is NULL.
We were not paying enough attention to detail when updating
hover and focus state while generating crossing events. The
invariant that we need to preserve here is that when a widget
has focus or hover, its parent does too.
We basically don't have child surfaces anymore (the last
use in popovers is on the way out). This really needs
to be done in terms of widgets, not surfaces. For now,
just stop walking parent surfaces.
ImmIsIME() doesn't work (always returns TRUE) since Vista.
Use ITfActiveLanguageProfileNotifySink to detect TSF changes,
which are equal to IME changes for us.
Also make sure that IMMultiContext re-loads the IM when keyboard layout
changes, otherwise there's a subtle bug that could happen:
* Run GTK application with non-IME layout (US, for example)
* Focus on an editable widget (GtkEntry, for example)
* IM Context is initialized to use the simple IM
* Switch to an IME layout (such as Korean)
* Start typing
* Since IME module is not loaded yet, keypresses are handled
by a default MS IME handler
* Once IME commits a character, GDK will get a WM_KEYDOWN,
which will trigger a GdkKeyEvent, which will be handled by
an event filter in IM Context, which will finally re-evaluate
its status and load IME, and only after that GTK will get
to handle IME by itself - but by that point input would
already be broken.
To avoid this we can emit a dummy event (with Void keyval),
which will cause IM Context to load the appropriate module
immediately.
When the window gets active / inactive, we
don't propagate events, but just send focus-in / -out
to the current focus_widget. Improve this by updating
its state flags as well.
We were walking the parent chain here, which now
always needs to consider whether it should stop
at roots. Like this one should.
The symptom was that a label with a popup attached to
it would end up with an unintentional focus ring that
would not go away.
Refactor the child allocation machinery, so that the complex allocation
paths are only run when the animation is running.
And in particular, ensure that when no animation is running, the
identity transform is allocated.
When dealing with subclasses of GtkEntry, we were not
getting the property offset that is stored on the GtkEntry
type.
This was showing up as criticals when trying to set
::width-chars on a GtkFileChooserEntry.
This is named gdkconstructor.h to avoid any possible conflicts. This fixes
the current usages of G_HAS_CONSTRUCTORS, as that header is not installed
by glib.