Commit Graph

15 Commits

Author SHA1 Message Date
Benjamin Otte
5cbbc62026 widget: Pass a GtkCssStyleChange instead of a bitmask 2015-12-13 04:11:58 +01:00
Benjamin Otte
ec57c6c10b csspathnode: Handle context going away
Sometimes path nodes can survive longer than the style context that
created them. Don't crash in those cases.

Fixes startup of mutter.

Testcase included.

https://bugzilla.gnome.org/show_bug.cgi?id=746407
2015-03-18 18:24:45 +01:00
Benjamin Otte
6dd19306eb cssnode: Create animated styles by default
... and hardcode transient and path nodes to never create animated
styles.
2015-03-18 15:23:32 +01:00
Benjamin Otte
16b8972bee cssnode: Change get_style_provider() vfunc
Instead of always returning a provider, allow the vfunc to return NULL
to mane "use same provider as parent". This allows a bunch of
optimizations.
2015-03-18 15:23:32 +01:00
Benjamin Otte
b827725ace csspathnode: Call gtk_style_context_validate()
Don't call gtk_style_context_invalidate(), that function does too much
work.
2015-03-18 15:23:31 +01:00
Benjamin Otte
ee6d081ed9 cssnode: Remove now unused arg from vfunc 2015-03-18 15:23:31 +01:00
Benjamin Otte
76ca9a9181 cssnode: Make path node create matcher without copying
... the WidgetPath. This uses the functionality introduced in the
previous commits.
2015-03-18 15:23:30 +01:00
Benjamin Otte
cdd964a3af cssnode: Change way invalidation is handled
Have a queue_validate() vfunc and a dequeue_validate() vfunc that are
called only on root nodes so they can queue a validation on their frame
clocks.
2015-03-18 15:23:30 +01:00
Benjamin Otte
5f19f09ac3 cssnode: Refactor gtk_css_widget_node_validate()
Makes it clearer what actually happens in that function.
2015-03-18 15:23:30 +01:00
Benjamin Otte
219e52f7e1 cssnode: Automatically recreate style on get_style() call
When the style is invalid, redo it.

Make this a vfunc, so the widget nodes can opt out.
2015-03-18 15:23:30 +01:00
Benjamin Otte
03ac5f310b cssnode: Add gtk_style_context_get_style_provider()
... and use it when looking up properties.
2015-03-18 15:23:29 +01:00
Benjamin Otte
55e68bc2ea cssnode: Track invalid flag
Remove it from GtkStyleContext.
2015-03-18 15:23:29 +01:00
Benjamin Otte
7bafb63ec3 cssnode: Handle invalidation
Handle invalidation of node inside the CssNode code, don't do it in the
stylecontext.
2015-03-18 15:23:29 +01:00
Benjamin Otte
d79a44c1af stylecontext: Get rid of create_query_path()
Move that functionality into GtkCssNode.
2015-03-18 15:23:29 +01:00
Benjamin Otte
e2f6d4db43 cssnode: Split into 3 objects
- GtkCssWidgetNode
  for style contexts owned by a widget
- GtkCssPathNode
  for style contexts using a GtkWidgetPath
- GtkCssTransientNode
  for nodes created with gtk_style_context_save()/restore()
2015-03-18 15:23:29 +01:00