If we encounter a node or texture the 1st time and they are going
to be used again, give them a name.
Then, when encountering them again, print them by name instead
of duplicating them.
We extend the syntax for nodes from:
<node-type> { ... }
to
<node-type> { ... }
<node-type> <string> { ... }
<string>;
where the first is the same as before, the 2nd defines a named node and
the last references a previously defined node.
Or to give an example:
color "node" {
bounds: 0 0 10 10;
color: red;
}
transform {
bounds: 20 0 10 10;
child: "node";
}
This will draw the red box twice, once at (0,0) and once at
(20,0).
The intended use for this is both shortening generated node files as
well as allowing to write tests that reuse nodes, in particular when
dealing with caches.
We extend the syntax for textures from just:
<url>
to
[<string>] <url>
<string>
where the first defines a named texture while the second references a
texture.
Or to give an example:
texture {
bounds: 0 0 10 10;
texture: "foo" url("foo.png");
}
texture {
bounds: 20 0 10 10;
texture: "foo";
}
This will draw the texture "foo.png" twice, once at (0,0) and once at
(20,0).
The intended use for this is both shortening generated node files as
well as allowing to write tests that reuse textures, in particular when
mixing them in texture and texture-scale nodes.
Since Wayland 1.15, it is now possible to use absolute paths in
"WAYLAND_DISPLAY".
In that scenario, having a valid "XDG_RUNTIME_DIR" is not a requirement
anymore.
For this reason we remove the "XDG_RUNTIME_DIR" check and we let
`wl_display_connect()` decide if our environment is correct.
Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
An inert gridview is a gridview that does not use the factory. This
allows faster updates because no calls into user code need to happen.
A gridview is inert when either:
- It is not rooted.
- It is not visible.
- No factory is set (that one is obvious)
The gridview does not need to be inert without a model, as that case is
handled by the item manager.
This should allow Nautilus to keep both the gridview and the columnview
around, and just gtk_widget_hide() the unused widget.
The code for now does not disable the item manager, as some
functionality of the item manager is required to allow setting scroll
positions and such.
But that is a place where more gains could be found if profiling showed
that was useful to do.
An inert listview is a listview that does not use the factory. This
allows faster updates because no calls into user code need to happen.
A listview is inert when either:
- It is not rooted.
- It is not visible.
- No factory is set (that one is obvious)
The listview does not need to be inert without a model, as that case is
handled by the item manager.
This should allow Nautilus to keep both the gridview and the columnview
around, and just gtk_widget_hide() the unused widget.
The code for now does not disable the item manager, as some
functionality of the item manager is required to allow setting scroll
positions and such.
But that is a place where more gains could be found if profiling showed
that was useful to do.
The widget would teardown the factory on unroot to avoid unnecessary
work when it isn't shown.
However, recycling may reposition widgets, and repositioning widgets
does a unroot/root.
We don't want to recycle widgets then.
The implementation lives (as always) in GtkListBase.
This is a feature request from the Nautilus developers, who currently do
some hacks to emulate that behavior and it apparently only breaks
sometimes.
We connect gtk_scrolled_window_update_use_indicators
as signal handler in realize(), but we were disconnecting
gtk_scrolled_window_sync_use_indicators in unrealize.
Spotted by Milan Crha.
Fixes: #5684
Just like GdkToplevel::compute-size, the size argument of the signal is
given to the handlers by GDK; it's not an out argument meant to be
allocated by the caller.
The size argument is passed to the signal by the GDK surface machinery,
as is: it's not going to be allocated by the caller (since it's a
signal), and it's not an out argument.
The cursor-theme-size setting is documented as
'0 means the default size'. Make it so by using
size 24 if we see a 0. Its better than crashing.
Fixes: #5700
The function is going away, and the computation
here was wrong anyway. Instead, add a helper that
properly computes the pointing-to rect in surface
coordinates and use it everywhere.