gtk4.git
5 years agostylecontext: Remove gtk_style_context_get_section()
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.

5 years agostylecontext: Remove GTK_STYLE_PROPERTY_* defines
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.

5 years agocss: Use the bloom filter for change matching
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.

5 years agoselector: Make :not() selectors not radical
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.

5 years agotestsuite: Improve diff_with_file() function
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.

5 years agocss: Add fast-path for parent selector matching
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.

5 years agocssnodedeclaration: C99-ify the code
Benjamin Otte [Sun, 26 Jan 2020 03:17:17 +0000 (04:17 +0100)]
cssnodedeclaration: C99-ify the code

zero-sized arrays are allowed now.

5 years agoselector: Hash differently
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.

5 years agocssnode: Convert name + id from interned string to GQuark
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.

5 years agocss: Get rid of GtkCssMatcher
Benjamin Otte [Thu, 23 Jan 2020 02:34:25 +0000 (03:34 +0100)]
css: Get rid of GtkCssMatcher

5 years agocss: Pass node through the lookup code
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.

5 years agocssnode: Remove init_matcher() vfunc
Benjamin Otte [Thu, 23 Jan 2020 01:28:46 +0000 (02:28 +0100)]
cssnode: Remove init_matcher() vfunc

It's unused.

5 years agocssnode: Remove ability to set GType as fallback name
Benjamin Otte [Thu, 23 Jan 2020 01:22:30 +0000 (02:22 +0100)]
cssnode: Remove ability to set GType as fallback name

5 years agoRemove GtkWidgetPath
Benjamin Otte [Wed, 22 Jan 2020 23:45:27 +0000 (00:45 +0100)]
Remove GtkWidgetPath

... and all associated demos and tests.

5 years agoRemove gtkwidgetpath.h include where no longer needed
Benjamin Otte [Wed, 22 Jan 2020 23:45:01 +0000 (00:45 +0100)]
Remove gtkwidgetpath.h include where no longer needed

5 years agoRevert "cssmatcher: Inline node values into matcher"
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.

5 years agocss: Move utility function
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.

5 years agotextutil: Stop using GtkStyleContext
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.

5 years agogskpango: Don't free rgba's we don't own
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.

5 years agofilechooser: Stop using gtk_style_context_get
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.

5 years agoUpdate Brazilian Portuguese translation
Rafael Fontenelle [Mon, 27 Jan 2020 17:09:32 +0000 (17:09 +0000)]
Update Brazilian Portuguese translation

5 years agopopover: Fix an oversight in gap coord computation
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.

5 years agocalendar: Use widgets for the header
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.

5 years agoUpdate Malay translation
Umarzuki Bin Mochlis Moktar [Mon, 27 Jan 2020 12:25:12 +0000 (12:25 +0000)]
Update Malay translation

5 years agoUpdate Malay translation
Umarzuki Bin Mochlis Moktar [Mon, 27 Jan 2020 12:22:47 +0000 (12:22 +0000)]
Update Malay translation

5 years agoUpdate Friulian translation
Fabio Tomat [Mon, 27 Jan 2020 08:56:42 +0000 (08:56 +0000)]
Update Friulian translation

5 years agoUpdate Slovak translation
Dušan Kazik [Mon, 27 Jan 2020 07:01:51 +0000 (07:01 +0000)]
Update Slovak translation

5 years agocss: Don't lose inset when computing shadows
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

5 years agogsk: Remove some unused defines
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.

5 years agocssdimensionvalue: Remove an outdated comment
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.

5 years agocssboxes: Try to avoid doing work for rectangular boxes
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.

5 years agodimensionvalue: Add gtk_css_{dimension,corner}_value_is_zero()
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.

5 years agowidget: Restructure pick() a bit
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.

5 years agorenderbackground: Avoid unnecessary work in snapshot_background()
Timm Bäder [Sat, 25 Jan 2020 15:21:00 +0000 (16:21 +0100)]
renderbackground: Avoid unnecessary work in snapshot_background()

5 years agoAdd pure and const annotations to various functions
Timm Bäder [Fri, 24 Jan 2020 12:17:09 +0000 (13:17 +0100)]
Add pure and const annotations to various functions

5 years agorender: Remove gtk_render_background_get_clip
Timm Bäder [Sat, 25 Jan 2020 15:20:00 +0000 (16:20 +0100)]
render: Remove gtk_render_background_get_clip

5 years agoRemove gtkutils{.c,private.h}
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.

5 years agocssparser: make a few local variables const
Timm Bäder [Sat, 25 Jan 2020 07:40:40 +0000 (08:40 +0100)]
cssparser: make a few local variables const

5 years agocssprovider: Parse selectors without a GList
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.

5 years agoGtkCssImageUrl: Implement is_computed()
Timm Bäder [Fri, 24 Jan 2020 15:02:34 +0000 (16:02 +0100)]
GtkCssImageUrl: Implement is_computed()

5 years agogl renderer: Avoid some work when rendering border nodes
Timm Bäder [Fri, 24 Jan 2020 10:29:43 +0000 (11:29 +0100)]
gl renderer: Avoid some work when rendering border nodes

5 years agocssimage: Add gtk_css_image_to_string()
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

5 years agowindow: Replace GtkStyleContext use to get surface transform
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.

5 years agoRevert "lookup stats"
Matthias Clasen [Sun, 26 Jan 2020 04:49:33 +0000 (23:49 -0500)]
Revert "lookup stats"

This reverts commit 3d9e3390f167a220e8775d08356259f420e045ce.

5 years agoRevert "css: Split style into groups"
Matthias Clasen [Sun, 26 Jan 2020 04:49:17 +0000 (23:49 -0500)]
Revert "css: Split style into groups"

This reverts commit 0df0de0b5db87248ad1371ee1bfc8a733ec079e4.

5 years agocss: Split style into groups
Matthias Clasen [Sun, 26 Jan 2020 04:16:06 +0000 (23:16 -0500)]
css: Split style into groups

5 years agoAdwaita: take out an unnecessary rule
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.

5 years agoAdwaita: drop the *
Matthias Clasen [Sat, 25 Jan 2020 23:20:40 +0000 (18:20 -0500)]
Adwaita: drop the *

5 years agolookup stats
Matthias Clasen [Sat, 25 Jan 2020 23:20:26 +0000 (18:20 -0500)]
lookup stats

5 years agoFix a scrollbar sizing issue
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.

5 years agoRevert "Ensure icon themes are loaded with other themes"
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.

5 years agoMerge branch 'style-context-redux' into 'master'
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

5 years agopopover: Stop using style context getters
Matthias Clasen [Sat, 18 Jan 2020 16:48:30 +0000 (11:48 -0500)]
popover: Stop using style context getters

5 years agodrag icon: 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.

5 years agogskpango: Stop using style context getters
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.

5 years agowidget: Stop using style context internally
Matthias Clasen [Sat, 18 Jan 2020 08:12:01 +0000 (03:12 -0500)]
widget: Stop using style context internally

5 years agoAdd a profiler mark around renderer realization
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.

5 years agoAdwaita: Fix some entry styling
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.

5 years agoGtkSpinner: Pay attention to style changes
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.

5 years agoGtkPaned: Pay attention to style changes
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.

5 years agoGtkIcon: Pay attention to style changes
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.

5 years agocss: Update affects flags for icons
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.

5 years agoMerge branch 'wayland-cursors' into 'master'
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

5 years agoMake wayland load cursors on demand
Matthias Clasen [Fri, 24 Jan 2020 18:33:13 +0000 (13:33 -0500)]
Make wayland load cursors on demand

Copy just enough of libwayland-cursor to make our own
loading. This lets us drop the dependency on libwayland-cursor,
and changes the startup cost for cursor theme loading
from 25ms to 0.1ms.

At the same time, simplify the handling of scaled cursors -
instead of creating an array of theme objects, just make a
single theme object provide all scaled cursor sizes.

5 years agoRevert "css: Print selectors"
Matthias Clasen [Fri, 24 Jan 2020 16:51:18 +0000 (11:51 -0500)]
Revert "css: Print selectors"

This reverts commit da5d5243241941ba130fc0644e66986f967a2ef3.

And this one too. The commits are there, if people need this
kind of statistics again, they can just be cherry-picked.

5 years agoRevert "css: Print out relative costs of selectors"
Matthias Clasen [Fri, 24 Jan 2020 16:50:40 +0000 (11:50 -0500)]
Revert "css: Print out relative costs of selectors"

This reverts commit 5dcce0c0bdccf5b55a15ff45247b2fc06bf77f7f.

I forgot to ifdef a few things in here, so lets take this out
again.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Fri, 24 Jan 2020 16:20:42 +0000 (16:20 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!1348

5 years agoAdwaita: Drop selection mode
Matthias Clasen [Fri, 24 Jan 2020 05:12:05 +0000 (00:12 -0500)]
Adwaita: Drop selection mode

This is not really a feature that GTK has; and it lets
us drop a significant amount of css.

5 years agoAdwaita: Drop menu remnants
Matthias Clasen [Fri, 24 Jan 2020 05:08:46 +0000 (00:08 -0500)]
Adwaita: Drop menu remnants

Menus are gone.

5 years agocss: Print out relative costs of selectors
Matthias Clasen [Fri, 24 Jan 2020 04:12:29 +0000 (23:12 -0500)]
css: Print out relative costs of selectors

Count how often each tree node is visited, and print the number
at the end. This gives a good indication what selectors are costly
and should be avoided. #ifdefed out.

5 years agoAdwaita: Remove a wildcard rule for tooltips
Matthias Clasen [Fri, 24 Jan 2020 02:04:15 +0000 (21:04 -0500)]
Adwaita: Remove a wildcard rule for tooltips

These rules are expensive, and don't seem to make
any difference for typical tooltip content.

5 years agoAdwaita: Drop menuitem support
Matthias Clasen [Fri, 24 Jan 2020 02:00:40 +0000 (21:00 -0500)]
Adwaita: Drop menuitem support

menuitems don't exist anymore.

5 years agocss: Print selectors
Matthias Clasen [Thu, 23 Jan 2020 23:51:42 +0000 (18:51 -0500)]
css: Print selectors

Add code that prints all the selectors when a theme
is loaded. #ifdefed out.

5 years agowidget: Use gsk_transform_transform_point() in gtk_widget_pick()
Timm Bäder [Fri, 24 Jan 2020 05:18:03 +0000 (06:18 +0100)]
widget: Use gsk_transform_transform_point() in gtk_widget_pick()

This also covers the 2D_AFFINE case.

5 years agogl renderer: handle cross-fade nodes with invisible children
Timm Bäder [Wed, 22 Jan 2020 07:38:55 +0000 (08:38 +0100)]
gl renderer: handle cross-fade nodes with invisible children

5 years agogl renderer: Handle blur nodes with invisible children
Timm Bäder [Wed, 22 Jan 2020 07:38:41 +0000 (08:38 +0100)]
gl renderer: Handle blur nodes with invisible children

5 years agogl renderer: Make render_rounded_clip_node clearer
Timm Bäder [Wed, 22 Jan 2020 07:32:11 +0000 (08:32 +0100)]
gl renderer: Make render_rounded_clip_node clearer

5 years agotestsuite: Add test cases for last commit
Timm Bäder [Tue, 21 Jan 2020 09:01:18 +0000 (10:01 +0100)]
testsuite: Add test cases for last commit

Easy enough to test

5 years agogl renderer: Add builder offset correctly for non-affine modelviews
Timm Bäder [Tue, 21 Jan 2020 09:00:51 +0000 (10:00 +0100)]
gl renderer: Add builder offset correctly for non-affine modelviews

5 years agoGskTransform: Add gsk_transform_transform_point()
Timm Bäder [Tue, 21 Jan 2020 08:41:54 +0000 (09:41 +0100)]
GskTransform: Add gsk_transform_transform_point()

Equivalent of gsk_transform_transform_bounds() and
graphene_matrix_transform_point() respectively.

5 years agogl renderer: Shorten shaders a bit
Timm Bäder [Mon, 20 Jan 2020 10:21:52 +0000 (11:21 +0100)]
gl renderer: Shorten shaders a bit

5 years agocssimageicontheme: Avoid copying colors
Timm Bäder [Mon, 20 Jan 2020 10:06:56 +0000 (11:06 +0100)]
cssimageicontheme: Avoid copying colors

5 years agocssimagepaintable: Implement is_computed()
Timm Bäder [Mon, 20 Jan 2020 09:20:26 +0000 (10:20 +0100)]
cssimagepaintable: Implement is_computed()

5 years agocssimagescaled: Implement is_computed()
Timm Bäder [Mon, 20 Jan 2020 08:26:08 +0000 (09:26 +0100)]
cssimagescaled: Implement is_computed()

5 years agocssimagerecolor: Implement is_computed()
Timm Bäder [Mon, 20 Jan 2020 08:22:02 +0000 (09:22 +0100)]
cssimagerecolor: Implement is_computed()

5 years agogl renderer: Move rect transformation to the vertex shader
Timm Bäder [Sun, 19 Jan 2020 19:08:23 +0000 (20:08 +0100)]
gl renderer: Move rect transformation to the vertex shader

No need to do this for every fragment.

5 years agogl renderer: Transform rounded rect on the GPU
Timm Bäder [Sun, 19 Jan 2020 16:11:57 +0000 (17:11 +0100)]
gl renderer: Transform rounded rect on the GPU

Change the RoundedRect struct we use in our shaders so we can transform
it using (affine) matrices.

5 years agocolorbutton: Use a css name
Matthias Clasen [Fri, 24 Jan 2020 04:11:49 +0000 (23:11 -0500)]
colorbutton: Use a css name

This was the sole widget to show up as 'widget' in
the css tree.

5 years agotestsuite: Update mark names
Matthias Clasen [Fri, 24 Jan 2020 01:21:08 +0000 (20:21 -0500)]
testsuite: Update mark names

We've changed some of the profiler mark names to
be clearer and more unique. Update the tests that
look for those marks to use the new names.

5 years agoAdwaita: Use child selectors in many more places
Matthias Clasen [Thu, 23 Jan 2020 23:50:39 +0000 (18:50 -0500)]
Adwaita: Use child selectors in many more places

These are much cheaper to match than descendent
selectors, so use them whenever we know the element
is a direct child.

5 years agotext: Don't compute invisible char in init
Matthias Clasen [Thu, 23 Jan 2020 20:12:38 +0000 (15:12 -0500)]
text: Don't compute invisible char in init

This causes us to create a pango layout and
validate the css style, a high-overhead
operation. Just do it when the entry is set
to be invisible.

5 years agoFix Emoji completion
Matthias Clasen [Thu, 23 Jan 2020 18:27:56 +0000 (13:27 -0500)]
Fix Emoji completion

This was broken in various ways; Tabbing between pages
was causing segfaults, and using the hover state like
this does not work anymore, with hover now being completely
managed by GTK. Use focus instead, and also fix up the
style.

5 years agoReplace .emoji with emoji for css
Matthias Clasen [Thu, 23 Jan 2020 16:26:52 +0000 (11:26 -0500)]
Replace .emoji with emoji for css

5 years agoAdwaita: Drop .context-menu
Matthias Clasen [Thu, 23 Jan 2020 16:17:52 +0000 (11:17 -0500)]
Adwaita: Drop .context-menu

We are not using it anymore, and yet fonts on a bold
textview are fine. So no need for this.

5 years agoAdwaita: Just use .menu, instead of .appmenu
Matthias Clasen [Thu, 23 Jan 2020 16:15:51 +0000 (11:15 -0500)]
Adwaita: Just use .menu, instead of .appmenu

No need for this one-off class, there's no other menus
that could show up here.

5 years agoMerge branch 'fix-avahi_service_resolver_cb-crash-master' into 'master'
Emmanuele Bassi [Thu, 23 Jan 2020 17:50:47 +0000 (17:50 +0000)]
Merge branch 'fix-avahi_service_resolver_cb-crash-master' into 'master'

printing: Fix crash in avahi_service_resolver_cb (master)

See merge request GNOME/gtk!1347

5 years agoprinting: Fix crash in avahi_service_resolver_cb
WGH [Thu, 23 Jan 2020 15:27:41 +0000 (18:27 +0300)]
printing: Fix crash in avahi_service_resolver_cb

printer_name_compressed_strv is NULL-terminated array
of gchar*, which means N+1 memory should be allocated.

Otherwise, if the printer name has no empty components
(which is usually the case), printer_name_compressed_strv[N],
which should contain the NULL sentinel, will actually lie
just outside of allocated memory, which is UB.

In my case, it led to crashes inside g_strjoinv
when Print... dialog is opened in evince.

    #0  0x00007fad2ce1bad7 in __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:96
    #1  0x00007fad2d04d88d in g_strjoinv (separator=separator@entry=0x7fad0c9bc508 "-", str_array=str_array@entry=0x556b017f0200) at ../glib-2.60.7/glib/gstrfuncs.c:2585
    #2  0x00007fad0c9b8a89 in avahi_service_resolver_cb (source_object=<optimized out>, res=<optimized out>, user_data=0x7fad08020ee0) at /var/tmp/portage/x11-libs/gtk+-3.24.13/work/gtk+-3.24.13/modules/printbackends/cups/gtkprintbackendcups.c:3223
    #3  0x00007fad2d1f8ed3 in g_task_return_now (task=0x556b017a8b00 [GTask]) at ../glib-2.60.7/gio/gtask.c:1209
    #4  0x00007fad2d1f987d in g_task_return (task=0x556b017a8b00 [GTask], type=<optimized out>) at ../glib-2.60.7/gio/gtask.c:1278
    #5  0x00007fad2d1f9dec in g_task_return (type=G_TASK_RETURN_SUCCESS, task=<optimized out>) at ../glib-2.60.7/gio/gtask.c:1678
    #6  0x00007fad2d1f9dec in g_task_return_pointer (task=<optimized out>, result=<optimized out>, result_destroy=<optimized out>) at ../glib-2.60.7/gio/gtask.c:1683
    #7  0x00007fad2d24b6af in g_dbus_connection_call_done (source=<optimized out>, result=0x556b017a8bc0, user_data=0x556b017a8b00) at ../glib-2.60.7/gio/gdbusconnection.c:5747
    #8  0x00007fad2d1f8ed3 in g_task_return_now (task=0x556b017a8bc0 [GTask]) at ../glib-2.60.7/gio/gtask.c:1209
    #9  0x00007fad2d1f8f09 in complete_in_idle_cb (task=0x556b017a8bc0) at ../glib-2.60.7/gio/gtask.c:1223
    #10 0x00007fad2d02d2c0 in g_main_dispatch (context=0x556b00eee090) at ../glib-2.60.7/glib/gmain.c:3189
    #11 0x00007fad2d02d2c0 in g_main_context_dispatch (context=context@entry=0x556b00eee090) at ../glib-2.60.7/glib/gmain.c:3854
    #12 0x00007fad2d02d658 in g_main_context_iterate (context=context@entry=0x556b00eee090, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib-2.60.7/glib/gmain.c:3927
    #13 0x00007fad2d02d6df in g_main_context_iteration (context=context@entry=0x556b00eee090, may_block=may_block@entry=1) at ../glib-2.60.7/glib/gmain.c:3988
    #14 0x00007fad2d22248d in g_application_run (application=0x556b0116f130 [EvApplication], argc=<optimized out>, argv=<optimized out>) at ../glib-2.60.7/gio/gapplication.c:2519
    #15 0x0000556b002e55a1 in  ()
    #16 0x00007fad2ccd6f1b in __libc_start_main (main=0x556b002e50d0, argc=2, argv=0x7ffe1057fa88, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe1057fa78) at ../csu/libc-start.c:308
    #17 0x0000556b002e567a in  ()

    (gdb) p printer_name_compressed_strv[0]
    $4 = (gchar *) 0x556d4a4be430 "Brother"
    (gdb) p printer_name_compressed_strv[1]
    $5 = (gchar *) 0x7f9dbc011090 "MFC"
    (gdb) p printer_name_compressed_strv[2]
    $6 = (gchar *) 0x556d4a51ba50 "7860DW"
    (gdb) p printer_name_compressed_strv[3]
    $7 = (gchar *) 0x401 <error: Cannot access memory at address 0x401>

5 years agoAdd profiler marks around css selector tree building
Matthias Clasen [Thu, 23 Jan 2020 15:29:22 +0000 (10:29 -0500)]
Add profiler marks around css selector tree building

This is a big part of theme loading, and worth
showing in traces.

5 years agoAdwaita: Remove .entry-tag class
Matthias Clasen [Thu, 23 Jan 2020 05:14:49 +0000 (00:14 -0500)]
Adwaita: Remove .entry-tag class

Not used in GTK.

5 years agoAdwaita: Remove .rubberband class
Matthias Clasen [Thu, 23 Jan 2020 05:11:10 +0000 (00:11 -0500)]
Adwaita: Remove .rubberband class

All GTK widget are using a rubberband element now.