Benjamin Otte
93cf76b068
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.
2020-01-28 02:17:03 +01:00
Benjamin Otte
170130f1d9
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.
2020-01-28 02:17:03 +01:00
Benjamin Otte
6aac56e144
cssnodedeclaration: C99-ify the code
...
zero-sized arrays are allowed now.
2020-01-28 02:17:03 +01:00
Benjamin Otte
2d5a8974b3
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.
2020-01-28 02:17:03 +01:00
Benjamin Otte
146b921246
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.
2020-01-28 02:17:03 +01:00
Benjamin Otte
8b93ea9238
css: Get rid of GtkCssMatcher
2020-01-28 02:17:02 +01:00
Benjamin Otte
aa7c5e96a6
css: Pass node through the lookup code
...
... instead of passing a matcher.
The matcher code is now local to the CssProvider/CssSelector machinery.
2020-01-28 02:17:02 +01:00
Benjamin Otte
1953bc92bc
cssnode: Remove init_matcher() vfunc
...
It's unused.
2020-01-28 02:17:02 +01:00
Benjamin Otte
98eeee5bce
cssnode: Remove ability to set GType as fallback name
2020-01-28 02:17:02 +01:00
Benjamin Otte
49b47c9133
Remove GtkWidgetPath
...
... and all associated demos and tests.
2020-01-28 02:17:02 +01:00
Benjamin Otte
af6128b3ab
Remove gtkwidgetpath.h include where no longer needed
2020-01-28 02:17:02 +01:00
Benjamin Otte
496f3c17bd
Revert "cssmatcher: Inline node values into matcher"
...
This reverts commit a75529f3c0
.
It just complicates code and there are no performance numbers that would
warrant such a commit.
2020-01-28 02:17:02 +01:00
Benjamin Otte
c2d69643a8
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.
2020-01-28 02:17:02 +01:00
Sebastian Keller
9c6669be48
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
2020-01-27 21:42:34 +01:00
Matthias Clasen
d0aa79b5a1
textutil: Stop using GtkStyleContext
...
We can just use the css style directly.
2020-01-27 13:35:04 -05:00
Matthias Clasen
4b63523b1f
gskpango: Don't free rgba's we don't own
...
We don't copy them anymore, so don't free them.
2020-01-27 13:35:04 -05:00
Matthias Clasen
997186f640
filechooser: Stop using gtk_style_context_get
...
Just go to the css style directly.
2020-01-27 12:52:24 -05:00
Rafael Fontenelle
3940482820
Update Brazilian Portuguese translation
2020-01-27 17:09:32 +00:00
Timm Bäder
616a83fb53
popover: Fix an oversight in gap coord computation
...
This caused a border to show up between the popover arrow and the
contents.
2020-01-27 13:37:50 +01:00
Timm Bäder
baeadea342
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.
2020-01-27 13:37:50 +01:00
Umarzuki Bin Mochlis Moktar
04beedfef0
Update Malay translation
2020-01-27 12:25:12 +00:00
Umarzuki Bin Mochlis Moktar
da73394abd
Update Malay translation
2020-01-27 12:22:47 +00:00
Fabio Tomat
d0f69794a5
Update Friulian translation
2020-01-27 08:56:42 +00:00
Dušan Kazik
185ef214fa
Update Slovak translation
2020-01-27 07:01:51 +00:00
Matthias Clasen
3cdde3fc4b
css: Don't lose inset when computing shadows
...
This was showing up as reftest failures,
sporadically
2020-01-26 20:18:23 -05:00
Sebastian Keller
5040d81e03
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
2020-01-27 01:37:14 +01:00
Timm Bäder
05b9a99661
gsk: Remove some unused defines
...
These are from the GVariant days of render nodes.
2020-01-26 18:21:07 +01:00
Timm Bäder
a16e1cbf18
cssdimensionvalue: Remove an outdated comment
...
It's actually implemented in gtkcssdimensionvalue.c these days.
2020-01-26 18:21:07 +01:00
Timm Bäder
c7ea83cd82
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.
2020-01-26 18:21:07 +01:00
Timm Bäder
352c9ba42a
dimensionvalue: Add gtk_css_{dimension,corner}_value_is_zero()
...
We can usually omit computations when the dimension value ends up being
zero anyway.
2020-01-26 18:21:07 +01:00
Timm Bäder
30b37dd7c5
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.
2020-01-26 18:21:07 +01:00
Timm Bäder
2e256986c3
renderbackground: Avoid unnecessary work in snapshot_background()
2020-01-26 18:21:07 +01:00
Timm Bäder
77e0d360ed
Add pure and const annotations to various functions
2020-01-26 18:21:07 +01:00
Timm Bäder
942a93250a
render: Remove gtk_render_background_get_clip
2020-01-26 18:21:07 +01:00
Timm Bäder
7ccd6597c3
Remove gtkutils{.c,private.h}
...
All but one functions are unused. Move the remaining one into
gtkmodules.c, its only caller.
2020-01-26 18:21:07 +01:00
Timm Bäder
355a417dba
cssparser: make a few local variables const
2020-01-26 18:21:07 +01:00
Timm Bäder
36e3f4d902
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.
2020-01-26 18:21:07 +01:00
Timm Bäder
69fe705d0d
GtkCssImageUrl: Implement is_computed()
2020-01-26 18:21:07 +01:00
Timm Bäder
f62535affc
gl renderer: Avoid some work when rendering border nodes
2020-01-26 18:21:07 +01:00
Timm Bäder
1a56a10fc1
cssimage: Add gtk_css_image_to_string()
...
In line with all the other _to_string() implementations
2020-01-26 18:21:07 +01:00
Timm Bäder
4287f0def4
window: Replace GtkStyleContext use to get surface transform
...
We have GtkCssBoxes for this these days.
2020-01-26 18:21:07 +01:00
Matthias Clasen
7bebc3e2b2
Revert "lookup stats"
...
This reverts commit 3d9e3390f1
.
2020-01-25 23:49:33 -05:00
Matthias Clasen
b4e2df8fca
Revert "css: Split style into groups"
...
This reverts commit 0df0de0b5d
.
2020-01-25 23:49:17 -05:00
Matthias Clasen
0df0de0b5d
css: Split style into groups
2020-01-25 23:47:02 -05:00
Matthias Clasen
53c22bf833
Adwaita: take out an unnecessary rule
...
The comment says setting caret-color to currentColor
shouldn't be necessary, and it is right.
2020-01-25 18:38:42 -05:00
Matthias Clasen
d8144ec497
Adwaita: drop the *
2020-01-25 18:20:40 -05:00
Matthias Clasen
3d9e3390f1
lookup stats
2020-01-25 18:20:26 -05:00
Matthias Clasen
03595f9567
Fix a scrollbar sizing issue
...
The recent Adwaita changes inadvertendly made scrollbars
resize on hover. Fix that, by reinstating some lost rules.
2020-01-25 15:05:14 -05:00
Matthias Clasen
64e026d0a9
Revert "Ensure icon themes are loaded with other themes"
...
This reverts commit 88d26b7549
.
This change caused GtkShortcutWindow to not work anymore,
and we are fixing icon themes differently, anyway.
2020-01-25 14:32:01 -05:00
Matthias Clasen
0623b00512
Merge branch 'style-context-redux' into 'master'
...
Stop using GtkStyleContext internally
See merge request GNOME/gtk!1353
2020-01-25 19:29:20 +00:00