Commit Graph

44280 Commits

Author SHA1 Message Date
Benjamin Otte
6866d1c06e widget: Make gtk_widget_queue_allocate() not resize
This commit toggles the big switch. We now don't run size_allocate()
from the toplevel up anymore in cases where we don't need to.

Things might be broken in subtle ways as a result of this commit. We'll
have to find them and fix them.
2015-10-28 19:44:28 +01:00
Benjamin Otte
299600a7d4 widget: Track if a child needs an allocation
This is not used so far.
2015-10-28 19:44:28 +01:00
Benjamin Otte
f706891dd3 widget: Refactor function
Turn it from a loop into tail-calling itself.
2015-10-28 19:44:28 +01:00
Benjamin Otte
ab7e901cfd widget: Move resize function into gtkwidget.c
There's no sizegroup specific code left in it, but lots of
widget-specifics.
2015-10-28 19:44:28 +01:00
Benjamin Otte
4fa74e68e9 sizegroup: Merge function into only caller 2015-10-28 19:44:28 +01:00
Benjamin Otte
b5dfe9b833 sizegroup: Simplify widget's size group invalidation
Since we do not queue resizes twice anymore, we can just walk the list
of groups without deduplication.
2015-10-28 19:44:28 +01:00
Benjamin Otte
a31123e9f0 sizegroup: Skip resizes on widgets that have resize queued
Widgets that already have a resize queued don't need to walk the whole
parent chain and queue another resize. It's enough to do it once per
resize.

This also means that sizegroups cannot use the shortcut of just
invalidating the first widget in the group anymore. That widget might
already have a resize queued while others don't.
2015-10-28 19:44:28 +01:00
Benjamin Otte
a4587ef4a0 widget: Warn on calls to queue_resize() during size_allocate()
This happens way too much, so it's disabled unless GTK_DEBUG=geometry is
on.

Also, we can't detect it in the call to queue_resize() yet, only during
size_allocate(), so the warning comes after the signal emission.
2015-10-28 19:44:28 +01:00
Benjamin Otte
4d631a9144 widget: Clear pending resizes after size_allocate()
This catches the cases where widgets call gtk_widget_queue_resize()
in their size_allocate() callback.
2015-10-28 19:44:28 +01:00
Benjamin Otte
3e3f17576e widget: Warn if size-unqueried widgets get allocated
Widgets should have gtk_widget_get_preferred_width/height() called
on them before gtk_widget_size_allocate() gets called.
Add a check for this.
2015-10-28 19:44:28 +01:00
Benjamin Otte
6cc2615b63 widget: Add a resize_needed flag
... and API to set and unset it.

It is set when gtk_widget_queue_resize() is called.
It is unset when gtk_widget_get_preferred_width/height() is called.

So far it is not used.
2015-10-28 19:44:28 +01:00
Benjamin Otte
3ff894c201 widget: Add a function that does actual resize
It's just shuffling code around.
2015-10-28 19:44:28 +01:00
Benjamin Otte
58d506fb11 sizegroup: Merge function into only caller
Both functions were running the same loop. Just running the loop once
seems advantageous.
2015-10-28 19:44:28 +01:00
Benjamin Otte
85ab8ad001 sizegroup: Don't invalidate over resize containers.
Before this commit, a widget tree like this:
  Window
    AnyContainer (part of SizeGroup1)
      GtkClutterEmbed
        SomeWidget
when calling gtk_widget_queue_resize(SomeWidget), would invalidate
SizeGroup1, when it should have stopped at the GtkClutterEmbed (which is
a RESIZE_IMMEDIATE child).
2015-10-28 19:44:28 +01:00
Benjamin Otte
1f2e21ab9a sizegroup: Refactor function
Get rid of continues in loop. This allows doing more complex things in
future commits.
2015-10-28 19:44:27 +01:00
Benjamin Otte
0721d964e4 sizegroup: Refactor function 2015-10-28 19:44:27 +01:00
Benjamin Otte
dd0e5cfce6 sizegroup: Remove special case before loop
The loop actually does the right thing already. There's no need to
complicate things.
2015-10-28 19:44:27 +01:00
Benjamin Otte
8fea3b02c9 sizegroup: refactor
The code looks a lot less dangerous if it doesn't look like we're
casting a random widget to a container.
2015-10-28 19:44:27 +01:00
Benjamin Otte
e19818359a sizegroup: Fold function into only caller 2015-10-28 19:44:27 +01:00
Benjamin Otte
690e015ed1 sizegroup: Move container function into its only caller 2015-10-28 19:44:27 +01:00
Benjamin Otte
0912a6c2f5 widget: Use gtk_widget_queue_allocate() when clip changes
There's no need to queue a full resize there.
2015-10-28 19:44:27 +01:00
Benjamin Otte
195397e87a API: widget: Add gtk_widget_queue_allocate()
This is so widgets can queue a rerun of their allocation logic, but
without triggering resizes everywhere.

For now, it just calls gtk_widget_queue_resize().
2015-10-28 19:44:27 +01:00
Benjamin Otte
798a288405 container: Use correct allocation for calling size_allocate() 2015-10-28 19:44:27 +01:00
Benjamin Otte
d3d9f52365 API: widget: Add gtk_widget_get_allocated_size()
See docs for what this is.
2015-10-28 19:44:27 +01:00
Benjamin Otte
ab2d236d3d sizegroup: Remove GtkQueueResizeFlags
They were only used with geometry widgets.
2015-10-28 19:44:27 +01:00
Benjamin Otte
5dd2087d19 widget: Remove _gtk_widget_override_size_request()
The function was only used by the geometry widget.
2015-10-28 19:44:27 +01:00
Benjamin Otte
08974a1e9a window: Ignore geometry widget
Ignore the geometry widget passed to gtk_window_set_geometry_hints().
Usind the widget itself was a hack that complicates the size request
machinery.

It is also incorrect in that it doesn't respect height-for-width.

Last but not least, it was only used by gnome-terminal and that
application can easily work without it.
2015-10-28 19:44:27 +01:00
Benjamin Otte
e422ccefe1 container: Don't randomly call gtk_widget_set_allocation()
gtk_widget_size_allocate() does that already.
2015-10-28 19:44:27 +01:00
Benjamin Otte
624fb8b360 entry: Always render like with is_cellrenderer
And remove the API to set that variable.
If you want the entry to not fill its whole allocated area,
  gtk_widget_set_valign (entry, GTK_ALIGN_FILL);
will give you the old behavior.
2015-10-28 19:44:26 +01:00
Benjamin Otte
8ec2362d81 icontheme: Clarify GENERIC_FALLBACK flag handling
- Add docs explaining that it doesn't work everywhere
- g_warn_if_fail() in the APIs where it doesn't work
2015-10-28 19:44:26 +01:00
Benjamin Otte
5cffbed165 iconhelper: Don't pass GENERIC_FALLBACK flag
It's not used when looking up with a GIcon.
2015-10-28 19:44:26 +01:00
Benjamin Otte
a58d8bdcbc cssprovider: Have a section when parsing style properties
Signal handlers expect a section to be present, so provide them with
one.

New testcase included.

https://bugzilla.gnome.org/show_bug.cgi?id=757240
2015-10-28 19:37:27 +01:00
Matthias Clasen
c4eb14eb01 Revert "tooltip: Use an element name"
This reverts commit efc8dc63e3.

This change broke tooltip positioning in a way that I don't
fully understand, so take it back for now.
2015-10-28 11:53:36 -04:00
Matthias Clasen
854c7d1f0f Revert "HighContrast: Update tooltip styling"
This reverts commit 93d80380ee.
2015-10-28 11:53:33 -04:00
Matthias Clasen
cab40f0743 Revert "Adwaita: Update tooltip theming"
This reverts commit d974610741.
2015-10-28 11:48:52 -04:00
Matthias Clasen
b4d49c36ce Fix key themes for GtkEntry -> entry
This was pointed out in

https://bugzilla.gnome.org/show_bug.cgi?id=757252
2015-10-28 10:19:00 -04:00
Matthias Clasen
20e46ce8ae shortcuts: Redo the stack switcher theming
Use style classes on the button instead of the stack switcher,
this makes it easier to reuse elsewhere.
2015-10-28 10:19:00 -04:00
Matthias Clasen
62ec4a2415 shortcuts label: Redo the keycap theming
Use a style class directly on the frame. This is easier to reuse.
2015-10-28 10:19:00 -04:00
Matthias Clasen
4e950da4d1 Adwaita: Update shortcuts window theming
Use the newly added element name.
2015-10-28 10:19:00 -04:00
Matthias Clasen
0dffc8c9d3 shortcuts: Use predefined style classes
Lets use the defines we have.
2015-10-28 07:10:55 -04:00
Matthias Clasen
b3619f9050 HighContrast: Update calendar theming
Use the newly introduced element name instead of hardcoding the type.
2015-10-28 06:45:37 -04:00
Matthias Clasen
085edf0212 Adwaita: Update calendar theming
Use the newly introduced element name instead of hardcoding the type.
2015-10-28 06:45:25 -04:00
Matthias Clasen
2c2fd5c8c5 calendar: Add an element name
This will allow us to drop hardcoded type names in the theme.
2015-10-28 06:35:33 -04:00
Olivier Fourdan
3058c3e6a9 wayland: configure clients that resize themselves
Make sure the wayland backend sets a new geometry when the client
resizes itself, otherwise the compositor won't be notified and may
revert to the old size on state changes.

Thanks to Jasper St. Pierre <jstpierre@mecheye.net> who pointed out the
problem in gtk+.

bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=755051
2015-10-28 08:41:17 +01:00
Matthias Clasen
37eb5c08a4 inspector: Cosmetic changes to the hierarchy tab
Put the interfaces below GInterface.
2015-10-28 00:41:13 -04:00
Matthias Clasen
3869bdbc2b inspector: Add css node style properties
Add a per-cssnode view of style properties.
2015-10-28 00:33:14 -04:00
Matthias Clasen
0d8444d067 Drop some no-longer existing headers 2015-10-27 20:29:43 -04:00
Matthias Clasen
85a6f3c13e 3.19.1 2015-10-27 20:06:24 -04:00
Matthias Clasen
339cb1fe6b Fix reftests
Multiple reftests were damaged by the element name transition.
Repair them. The region reftests are no longer needed, since
we no longer do regions.
2015-10-27 20:06:24 -04:00
Matthias Clasen
93d80380ee HighContrast: Update tooltip styling
Use the newly added element name instead of hardcoding the type.
2015-10-27 20:06:24 -04:00