Matthias Clasen [Wed, 29 Jan 2020 13:02:30 +0000 (14:02 +0100)]
animatedstyle: Fix the debug build
This wasn't caught by our ci.
Carlos Garnacho [Wed, 29 Jan 2020 11:22:11 +0000 (11:22 +0000)]
Merge branch 'gtk-4-im-wayland-controller-focus-in' into 'master'
imwayland: Connect gtk_im_context_focus_in/out to GtkEventControllerKey
See merge request GNOME/gtk!1349
Matthias Clasen [Wed, 29 Jan 2020 10:44:42 +0000 (10:44 +0000)]
Merge branch 'gdk-device-leak-fix' into 'master'
GdkDevice leak fix
See merge request GNOME/gtk!1358
Matthias Clasen [Wed, 29 Jan 2020 10:39:43 +0000 (10:39 +0000)]
Merge branch 'css-style-split-2' into 'master'
css: Split styles into groups
See merge request GNOME/gtk!1362
Matthias Clasen [Wed, 29 Jan 2020 10:39:22 +0000 (10:39 +0000)]
Merge branch 'reset-with-click' into 'master'
Always emit reset for IM preedit with mouse click
Closes #1534
See merge request GNOME/gtk!460
Matthias Clasen [Wed, 29 Jan 2020 10:25:40 +0000 (10:25 +0000)]
Merge branch 'robertroth/shortcuts-overlay-accel' into 'master'
Application: Do not reuse Ctrl+F1 for help-overlay
See merge request GNOME/gtk!307
Matthias Clasen [Tue, 28 Jan 2020 07:38:25 +0000 (07:38 +0000)]
Use style values directly
Replace uses of gtk_css_style_get_value with direct access,
throughout the tree. We don't replace all uses, just those
where we are dealing with a fixed property. Be careful to
handle the currentColor special case for color properties.
Matthias Clasen [Tue, 28 Jan 2020 17:13:37 +0000 (18:13 +0100)]
Compute style change based on values structs
We can save some time here by comparing struct by
struct and avoiding individual values comparisons
as much as possible.
Matthias Clasen [Sun, 26 Jan 2020 04:16:06 +0000 (23:16 -0500)]
css: Split styles into groups
Introduce refcounted structs for groups of related css properties,
and use them to store the style values. Both GtkCssStaticStyle and
GtkCssAnimatedStyle fill in the structs in GtkCssStyle, and we
can avoid vfuncs for value access, which should be much faster.
We can even start accessing style->core->color directly.
Matthias Clasen [Wed, 29 Jan 2020 10:05:24 +0000 (11:05 +0100)]
performance test: Produce better numbers
Try to isolate the test runs from each other in the
eyes of the kernel scheduler, by sleeping a bit. And
ignore the first run, to avoid cache effects.
Matthias Clasen [Wed, 29 Jan 2020 09:46:36 +0000 (09:46 +0000)]
Merge branch 'wip/baedert/widget-add-style-class' into 'master'
widget: Add style class API
See merge request GNOME/gtk!1366
Matthias Clasen [Wed, 29 Jan 2020 09:44:25 +0000 (10:44 +0100)]
Silence a compiler warning
Emmanuele Bassi [Wed, 29 Jan 2020 09:11:15 +0000 (09:11 +0000)]
Merge branch 'gtk-doc-ci' into 'master'
Publish the API reference
See merge request GNOME/gtk!1367
Emmanuele Bassi [Wed, 29 Jan 2020 09:02:02 +0000 (10:02 +0100)]
Remove reftests from expected-fail list
With an updated version of the base CI image it seems some tests that
were failing have started to pass again.
Emmanuele Bassi [Wed, 29 Jan 2020 08:16:57 +0000 (09:16 +0100)]
ci: Deploy the API reference on our GitLab pages
Now that we can build gtk-doc as a sub-project, we can go back to
publishing the API reference for the master branch every time we
build it.
Emmanuele Bassi [Tue, 28 Jan 2020 15:52:42 +0000 (16:52 +0100)]
ci: Update the version of Meson in the CI image
We need at least 0.52.1 to be able to use gtk-doc as a sub-project.
Emmanuele Bassi [Tue, 28 Jan 2020 15:50:53 +0000 (16:50 +0100)]
Add gtk-doc as a subproject
We rely on a specific minimum version of gtk-doc to be able to build the
GTK API reference for the new API. In order to be able to use gtk-doc as
a subproject, though, we need to use a recent version of Meson.
Timm Bäder [Wed, 29 Jan 2020 07:33:41 +0000 (08:33 +0100)]
widget: Add style class API
Add GtkWidget API for adding and removing style classes, as well as
checking whether a widget has a style class applied.
Everyone has to go through GtkStyleContext for this these days but with
GtkStyleContext eventually going away, it makse sense for GtkWidget to
have API for this.
Timm Bäder [Wed, 29 Jan 2020 07:49:13 +0000 (07:49 +0000)]
Merge branch 'fix-doc-typo' into 'master'
Fix a doc typo
See merge request GNOME/gtk!1364
Benjamin Otte [Wed, 29 Jan 2020 04:35:56 +0000 (04:35 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master
See merge request GNOME/gtk!1365
Benjamin Otte [Wed, 29 Jan 2020 03:20:47 +0000 (04:20 +0100)]
cssselector: Rework how we handle the bloom filter
Instead of foreaching through all the previous selectors every time we
bloom-filter, just bloom-filter the current element and return a special
value if that filter fails (FALSE). If that happens, don't try
filter-matching more nodes in the caller as we know it's an abort.
Luca Bacci [Tue, 28 Jan 2020 20:42:03 +0000 (20:42 +0000)]
Fix a doc typo
Benjamin Otte [Tue, 28 Jan 2020 17:28:32 +0000 (18:28 +0100)]
cssselector: Reorder functions
This just changes the order of functions in the source code in
preparation for the next commit.
Benjamin Otte [Tue, 28 Jan 2020 16:49:37 +0000 (17:49 +0100)]
css: Don't do the "all set" test
We have so many properties that it is basically impossible that all of
them are set and the time spent checking is higher than the time saved
if it does indeed happen.
Benjamin Otte [Tue, 28 Jan 2020 16:43:33 +0000 (16:43 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
popover: Do not validate the css node on show()
See merge request GNOME/gtk!1363
Benjamin Otte [Tue, 28 Jan 2020 16:15:04 +0000 (17:15 +0100)]
popover: Do not validate the css node on show()
This was a good idea back in GTK3 when popovers were toplevels, but now
they're regular child widgets, so they should behave that way.
Also, with the introduction of the bloom filter, gtk_css_node_validate()
now assumes it's only called on root nodes, so assert that that is the
case.
Takao Fujiwara [Tue, 28 Jan 2020 14:47:16 +0000 (23:47 +0900)]
imwayland: Connect gtk_im_context_focus_in/out to GtkEventControllerKey
GtkEventControllerKey can handle GDK_FOCUS_CHANGE and call
gtk_im_context_focus_in/out directly.
https://gitlab.gnome.org/GNOME/gtk/issues/2390
Benjamin Otte [Tue, 28 Jan 2020 03:56:49 +0000 (03:56 +0000)]
Merge branch 'wip/otte/css' into 'master'
selector: Rework iterating over subnodes
See merge request GNOME/gtk!1361
Benjamin Otte [Tue, 28 Jan 2020 02:53:48 +0000 (03:53 +0100)]
selector: Rework iterating over subnodes
Instead of a foreach() function, introduce an iterator, so that the
caller can drive the iteration.
This allows doing stuff inbetween callbacks and avoids closures when
more than one data object should be passed.
As a side effect I even get a small, but noticeable performance
improvement in the 2-10% range depending on benchmark, I guess that's
because there's no function pointer passing going on anymore.
Benjamin Otte [Tue, 28 Jan 2020 02:47:25 +0000 (02:47 +0000)]
Merge branch 'wip/otte/css' into 'master'
CSS improvements
See merge request GNOME/gtk!1360
Benjamin Otte [Mon, 27 Jan 2020 23:46:43 +0000 (00:46 +0100)]
styleproperty: Remove ability to query properties
With gtk_style_context_get() gone, this is no longer used.
Benjamin Otte [Mon, 27 Jan 2020 23:27:36 +0000 (00:27 +0100)]
stylecontext: Get rid of gtk_style_context_get()
... and replace all the calls to it with
gtk_style_context_peek_property().
All the calls are hacks that need to go away btw.
Benjamin Otte [Mon, 27 Jan 2020 22:04:15 +0000 (23:04 +0100)]
testcalendar: Don't do dumb stuff with font sizes.
If you want to test font stuff, it's 2020 and we have an inspector.
Benjamin Otte [Mon, 27 Jan 2020 21:58:15 +0000 (22:58 +0100)]
filechooser: Remove default size machinery
The FileChooser ToolKit (fctk) had its own machinery to handle default
sizes which was completely busted and trying to marshal random numbers
through the widget hierarchy that maybe made sense in 2012 but don't do
now.
Get rid of it, just keep the dialog's GSetting - which funnily enough
used to be written by the dialog but written by the widget.
But that's fctk for you.
Benjamin Otte [Mon, 27 Jan 2020 16:13:04 +0000 (17:13 +0100)]
cellrenderertoggle: size based on -gtk-icon-size
Instead of hardcoding 16px.
Benjamin Otte [Mon, 27 Jan 2020 15:13:25 +0000 (16:13 +0100)]
stylecontext: Remove gtk_style_context_get_section()
The inspectors gets values differently these days.
Benjamin Otte [Mon, 27 Jan 2020 14:07:37 +0000 (15:07 +0100)]
stylecontext: Remove GTK_STYLE_PROPERTY_* defines
They shouldn't be (and aren't) used anymore.
Benjamin Otte [Mon, 27 Jan 2020 02:26:39 +0000 (03:26 +0100)]
css: Use the bloom filter for change matching
Instead of just doing radical change matching on the node itself, also
consider the parent nodes via the bloom filter.
This means a radical change is now also one where the parent
name/id/classes change, but since that's considered a radical change on
the parent already, those things are slow anyway.
Improves the benchmark times for CSS validation during backdrop
transitions in widget-factory from 45ms to 35ms on my machine.
Benjamin Otte [Mon, 27 Jan 2020 01:49:36 +0000 (02:49 +0100)]
selector: Make :not() selectors not radical
:not() selectors cannot be radical because the bloomfilter only knows if
a value is set in any of the nodes, but cannot determine the opposite
(if a value is not set in at least one node), but that would be required
for:not() selectors.
However, this is very unlikely to happen in the real world, so it's not
worth optimizing.
Unfortunately, change tracking could know this, so by excluding the
:not() selectors from radical changes, the change tracking will now pick
them up. If that turns out to be a performance problem, we need to add a
special category for radical not filters, so change tracking and bloom
filters can deal with them.
The testcase demonstrating the problem in widget-factory has been
extrated and added.
Benjamin Otte [Mon, 27 Jan 2020 01:15:06 +0000 (02:15 +0100)]
testsuite: Improve diff_with_file() function
Properly handle diff(1) failing.
In this particular case, the test passed a NULL input file to the diff
(that was fixed, too) and then diff only found one input file and
aborted.
But without this fix, we'd also not catch other abortion reasons for
diff() - as long as it exited in any way, we were happy.
Benjamin Otte [Sun, 26 Jan 2020 03:37:17 +0000 (04:37 +0100)]
css: Add fast-path for parent selector matching
Add a fast path for parent selector matching that uses a bloom filter to
quickly discard selectors that can't possibly match.
Keep in mind that we match using a bloom filter, so we might
accidentally include too many selectors when hash/bucket collisions
occur.
That's not a correctness problem though, because we'll do a real check
afterwards.
The idea for this change is taken from browsers, in particular WebKit.
Benjamin Otte [Sun, 26 Jan 2020 03:17:17 +0000 (04:17 +0100)]
cssnodedeclaration: C99-ify the code
zero-sized arrays are allowed now.
Benjamin Otte [Fri, 24 Jan 2020 16:56:53 +0000 (17:56 +0100)]
selector: Hash differently
This will be relevant for a bloom filter. And bloom filters want 12bit
hashes, so we try to produce hash values < 4096.
Benjamin Otte [Thu, 23 Jan 2020 23:43:26 +0000 (00:43 +0100)]
cssnode: Convert name + id from interned string to GQuark
The reason for this is simply that I want to get hash functions that
have their values close together, so they can fit in a smaller range
(the goal here is 12 bits). By using GQuark, we get consecutive numbers
starting with 1 (and applications have <1000 quarks usually), whereas
interned strings can be all over the place.
As a side effect we also save 64 bytes per declaration.
Benjamin Otte [Thu, 23 Jan 2020 02:34:25 +0000 (03:34 +0100)]
css: Get rid of GtkCssMatcher
Benjamin Otte [Thu, 23 Jan 2020 01:42:01 +0000 (02:42 +0100)]
css: Pass node through the lookup code
... instead of passing a matcher.
The matcher code is now local to the CssProvider/CssSelector machinery.
Benjamin Otte [Thu, 23 Jan 2020 01:28:46 +0000 (02:28 +0100)]
cssnode: Remove init_matcher() vfunc
It's unused.
Benjamin Otte [Thu, 23 Jan 2020 01:22:30 +0000 (02:22 +0100)]
cssnode: Remove ability to set GType as fallback name
Benjamin Otte [Wed, 22 Jan 2020 23:45:27 +0000 (00:45 +0100)]
Remove GtkWidgetPath
... and all associated demos and tests.
Benjamin Otte [Wed, 22 Jan 2020 23:45:01 +0000 (00:45 +0100)]
Remove gtkwidgetpath.h include where no longer needed
Benjamin Otte [Wed, 22 Jan 2020 21:49:27 +0000 (22:49 +0100)]
Revert "cssmatcher: Inline node values into matcher"
This reverts commit
a75529f3c00736856fa20f19e920614be5a48fbb.
It just complicates code and there are no performance numbers that would
warrant such a commit.
Benjamin Otte [Mon, 27 Jan 2020 02:44:05 +0000 (03:44 +0100)]
css: Move utility function
The function was not selector-specific, so putting it with all the other
utility functions makes more sense.
Also use the utility function in the node declaration printing.
Sebastian Keller [Mon, 27 Jan 2020 00:02:29 +0000 (01:02 +0100)]
gdk/x11: Properly unref removed device in XI2 device manager
When a device is added, there are two references to it by the device
manager, the initial one and the one used for the id_table. Removing a
device only removed the reference added by the id_table resulting in the
GdkDevice being leaked.
https://gitlab.gnome.org/GNOME/gtk/merge_requests/1358
Matthias Clasen [Mon, 27 Jan 2020 14:35:09 +0000 (09:35 -0500)]
textutil: Stop using GtkStyleContext
We can just use the css style directly.
Matthias Clasen [Mon, 27 Jan 2020 18:34:21 +0000 (13:34 -0500)]
gskpango: Don't free rgba's we don't own
We don't copy them anymore, so don't free them.
Matthias Clasen [Mon, 27 Jan 2020 14:10:47 +0000 (09:10 -0500)]
filechooser: Stop using gtk_style_context_get
Just go to the css style directly.
Rafael Fontenelle [Mon, 27 Jan 2020 17:09:32 +0000 (17:09 +0000)]
Update Brazilian Portuguese translation
Timm Bäder [Mon, 27 Jan 2020 12:01:37 +0000 (13:01 +0100)]
popover: Fix an oversight in gap coord computation
This caused a border to show up between the popover arrow and the
contents.
Timm Bäder [Mon, 27 Jan 2020 09:28:42 +0000 (10:28 +0100)]
calendar: Use widgets for the header
This is not meant to be a full GtkCalendar conversion to use widgets
instead of custom drawing, but we lost the arrows in the calendar header
when builtin icons were removed. Using proper button for the year/month
buttons brings them back.
Umarzuki Bin Mochlis Moktar [Mon, 27 Jan 2020 12:25:12 +0000 (12:25 +0000)]
Update Malay translation
Umarzuki Bin Mochlis Moktar [Mon, 27 Jan 2020 12:22:47 +0000 (12:22 +0000)]
Update Malay translation
Fabio Tomat [Mon, 27 Jan 2020 08:56:42 +0000 (08:56 +0000)]
Update Friulian translation
Dušan Kazik [Mon, 27 Jan 2020 07:01:51 +0000 (07:01 +0000)]
Update Slovak translation
Matthias Clasen [Mon, 27 Jan 2020 01:16:16 +0000 (20:16 -0500)]
css: Don't lose inset when computing shadows
This was showing up as reftest failures,
sporadically
Sebastian Keller [Sun, 26 Jan 2020 23:59:56 +0000 (00:59 +0100)]
gdkseatdefault: Unref removed slave devices
Adding a slave device adds a ref, but removing it does not unref it.
https://gitlab.gnome.org/GNOME/gtk/merge_requests/1358
Timm Bäder [Sun, 26 Jan 2020 16:39:26 +0000 (17:39 +0100)]
gsk: Remove some unused defines
These are from the GVariant days of render nodes.
Timm Bäder [Sat, 25 Jan 2020 18:59:12 +0000 (19:59 +0100)]
cssdimensionvalue: Remove an outdated comment
It's actually implemented in gtkcssdimensionvalue.c these days.
Timm Bäder [Sat, 25 Jan 2020 18:40:54 +0000 (19:40 +0100)]
cssboxes: Try to avoid doing work for rectangular boxes
Use the new gtk_css_dimension_value_is_zero() to check if we really need
to e.g. apply a border radius at all.
We compute css boxes a lot so this makes sense here, it especially shows
up during pick(), where we need the border box.
Timm Bäder [Sat, 25 Jan 2020 18:40:13 +0000 (19:40 +0100)]
dimensionvalue: Add gtk_css_{dimension,corner}_value_is_zero()
We can usually omit computations when the dimension value ends up being
zero anyway.
Timm Bäder [Sat, 25 Jan 2020 18:39:28 +0000 (19:39 +0100)]
widget: Restructure pick() a bit
Don't even invert transforms if we can do it easily ourselves. This also
fixes a small GtkTransform memory leak.
Timm Bäder [Sat, 25 Jan 2020 15:21:00 +0000 (16:21 +0100)]
renderbackground: Avoid unnecessary work in snapshot_background()
Timm Bäder [Fri, 24 Jan 2020 12:17:09 +0000 (13:17 +0100)]
Add pure and const annotations to various functions
Timm Bäder [Sat, 25 Jan 2020 15:20:00 +0000 (16:20 +0100)]
render: Remove gtk_render_background_get_clip
Timm Bäder [Sat, 25 Jan 2020 14:40:53 +0000 (15:40 +0100)]
Remove gtkutils{.c,private.h}
All but one functions are unused. Move the remaining one into
gtkmodules.c, its only caller.
Timm Bäder [Sat, 25 Jan 2020 07:40:40 +0000 (08:40 +0100)]
cssparser: make a few local variables const
Timm Bäder [Sat, 25 Jan 2020 07:33:51 +0000 (08:33 +0100)]
cssprovider: Parse selectors without a GList
The maximum length of this list in Adwaita is 18, so use a generous
maximum length of 64 for the selector list of a ruleset.
Timm Bäder [Fri, 24 Jan 2020 15:02:34 +0000 (16:02 +0100)]
GtkCssImageUrl: Implement is_computed()
Timm Bäder [Fri, 24 Jan 2020 10:29:43 +0000 (11:29 +0100)]
gl renderer: Avoid some work when rendering border nodes
Timm Bäder [Fri, 24 Jan 2020 10:21:38 +0000 (11:21 +0100)]
cssimage: Add gtk_css_image_to_string()
In line with all the other _to_string() implementations
Timm Bäder [Fri, 24 Jan 2020 06:55:17 +0000 (07:55 +0100)]
window: Replace GtkStyleContext use to get surface transform
We have GtkCssBoxes for this these days.
Matthias Clasen [Sun, 26 Jan 2020 04:49:33 +0000 (23:49 -0500)]
Revert "lookup stats"
This reverts commit
3d9e3390f167a220e8775d08356259f420e045ce.
Matthias Clasen [Sun, 26 Jan 2020 04:49:17 +0000 (23:49 -0500)]
Revert "css: Split style into groups"
This reverts commit
0df0de0b5db87248ad1371ee1bfc8a733ec079e4.
Matthias Clasen [Sun, 26 Jan 2020 04:16:06 +0000 (23:16 -0500)]
css: Split style into groups
Matthias Clasen [Sat, 25 Jan 2020 23:38:42 +0000 (18:38 -0500)]
Adwaita: take out an unnecessary rule
The comment says setting caret-color to currentColor
shouldn't be necessary, and it is right.
Matthias Clasen [Sat, 25 Jan 2020 23:20:40 +0000 (18:20 -0500)]
Adwaita: drop the *
Matthias Clasen [Sat, 25 Jan 2020 23:20:26 +0000 (18:20 -0500)]
lookup stats
Matthias Clasen [Sat, 25 Jan 2020 20:05:14 +0000 (15:05 -0500)]
Fix a scrollbar sizing issue
The recent Adwaita changes inadvertendly made scrollbars
resize on hover. Fix that, by reinstating some lost rules.
Matthias Clasen [Sat, 25 Jan 2020 19:30:25 +0000 (14:30 -0500)]
Revert "Ensure icon themes are loaded with other themes"
This reverts commit
88d26b75491c9a329a836c0d91a8f85ee3bc77d1.
This change caused GtkShortcutWindow to not work anymore,
and we are fixing icon themes differently, anyway.
Matthias Clasen [Sat, 25 Jan 2020 19:29:20 +0000 (19:29 +0000)]
Merge branch 'style-context-redux' into 'master'
Stop using GtkStyleContext internally
See merge request GNOME/gtk!1353
Matthias Clasen [Sat, 18 Jan 2020 16:48:30 +0000 (11:48 -0500)]
popover: Stop using style context getters
Matthias Clasen [Sat, 18 Jan 2020 14:57:13 +0000 (09:57 -0500)]
drag icon: Stop using style context getters
Just go to the css node directly.
Matthias Clasen [Sat, 18 Jan 2020 14:50:04 +0000 (09:50 -0500)]
gskpango: Stop using style context getters
Just go to the css nodes directly.
Matthias Clasen [Sat, 18 Jan 2020 08:12:01 +0000 (03:12 -0500)]
widget: Stop using style context internally
Matthias Clasen [Sat, 25 Jan 2020 06:28:24 +0000 (01:28 -0500)]
Add a profiler mark around renderer realization
This takes time that is worth calling out.
Matthias Clasen [Sat, 25 Jan 2020 02:01:42 +0000 (21:01 -0500)]
Adwaita: Fix some entry styling
This was accidentally broken when parent selectors
were introduced here.
Matthias Clasen [Sat, 25 Jan 2020 01:54:50 +0000 (20:54 -0500)]
GtkSpinner: Pay attention to style changes
Make GtkIcon redraw and resize when style changes
require it.
Matthias Clasen [Sat, 25 Jan 2020 01:54:01 +0000 (20:54 -0500)]
GtkPaned: Pay attention to style changes
Make GtkPaned redraw and resize when style change
require it.
Matthias Clasen [Sat, 25 Jan 2020 01:53:16 +0000 (20:53 -0500)]
GtkIcon: Pay attention to style changes
Make GtkIcon redraw and resize when style changes
require it.
Matthias Clasen [Sat, 25 Jan 2020 00:57:45 +0000 (19:57 -0500)]
css: Update affects flags for icons
We want to differentiate what requires recreating the
texture and what doesn't. In particular, the current
flags are not handling symbolic icons right.
Matthias Clasen [Fri, 24 Jan 2020 23:03:56 +0000 (23:03 +0000)]
Merge branch 'wayland-cursors' into 'master'
Make wayland load cursors on demand
See merge request GNOME/gtk!1350