The GTK_DISPLAY_DEBUG_CHECK macro will cleverly only call the function
if any of the display debug flags are set, so in the common case it
won't even be executed.
The inspector, and other tools introspecting the widget structure like
gtk-builder-tool and Glade, may very well want to access the default
layout manager used by a class, especially if there are layout
properties involved, without having a whitelist of widget/layout manager
associations.
Some widgets have a well-defined layout manager created alongside their
own instance; if they do, we can handle the layout manager creation at
the GtkWidget instantiation.
Display changes now happen exclusively through
the ::root and ::unroot vfuncs. Third parties
can observe display changes by listening
for notify::root.
Export gtk_widget_root/unroot privately,
make them work on roots, and use them in
gtk_window_set_display. This gets us to a
single way to listen for display changes,
the root property.
The default widget is mostly a dialog concept,
and does not really need this generic api.
If you need to mark a widget as default,
use gtk_window_set_default() directly.
We used to handle has-default specially in ui
files. It was awkward, so stop doing that. If you
need to influence the default widget in a window,
you can just set the default-widget property.
We used to handle has-focus in ui files specially.
It was awkward, so stop doing that. If you need
to influence the initial focus of a window, you
can just set the focus-widget property.
Added two new private GtkWidget API:
* gtk_widget_add_surface_transform_changed_callback()
* gtk_widget_remove_surface_transform_changed_callback()
The intention is to let the user know when a widget transform relative
to the surface changes. It works by calculating the surface relative
transform during allocation, and notifying the callbacks if it changed
since last time. Each widget adds itself as a listener to its parent
widget, thus will be triggered if a parents surface relative transform
changes.
This will be used to let the inspector and other users
pick insensitive widgets again. For now, update all
callers to pass no flags, preserving the current
behavior.
When a root is set on a widget, the style context may
already exist. We need to make sure that the style context
has the right display set.
This was showing up as "css spillover" in the inspector.
Closes: #https://gitlab.gnome.org/GNOME/gtk/issues/1817
The GtkWidget::parent-set signal was removed in ff6cd8f7.
Instead of removing GtkLayoutChild instances associated to a widget
using notifications when the widget's parent changes, we can have
gtk_widget_unparent() call a method on GtkLayoutManager to remove any
eventual GtkLayoutChild instances associated to the widget.
- Rename GtkLegacyLayout to GtkCustomLayout
- Use for() to iterate over children in GtkBinLayout
- Whitespace fixes for code imported from GtkBox
- Store the GtkLayoutChild instances inside LayoutManager
- Simplify the GtkLayoutManager API by dropping unnecessary arguments
- Fix the ownership model of GtkLayoutManager
If a widget has a LayoutManager instance, then we want to parse layout
properties in UI description files; the grammar is similar to packing
properties in GtkContainer:
<child>
<object ...>
<property name="...">...</property>
<layout>
<property name="pname">value</property>
</layout>
</object>
</child>
The properties are applied after a child has been added to its parent,
to the parent's layout manager property should be set.
We can use a constructor property for existing container widgets with
a layout policy, and move the layout policy implementation out of the
widget itself and into a LayoutManager subclass.
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.
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.