Commit Graph

62868 Commits

Author SHA1 Message Date
Timm Bäder
0c4dcd9d57 add GtkArray
Try to use stack space if we can and only fall back to the GPtrArray if
we must.
2020-05-05 08:20:10 +02:00
Timm Bäder
aaecb3d84b main: Save some type checks
We already have the typecheck-less versions of get_realized(),
get_parent() and is_sensitive() in gtkwidgetprivate.h, so use them here.
2020-05-05 08:20:10 +02:00
Timm Bäder
771b3ea6f3 eventcontroller: Remove some unnecessary casts
Instead of comparing two GtkWidget*s by casting the two GtkNative*s, we
can as well compare two GtkNative*s. Also if gtk_widget_get_native()
returns NULL, the code previously failed.
2020-05-05 08:20:10 +02:00
Timm Bäder
75e202f02b widget: Use an unchecked cast in _get_native()
This is either no chagne because we know for a fact that the returned
value is a GtkNative - after all thats's the type we pass to
gtk_widget_get_ancestor().

Or it is a bug fix since casting NULL to a GtkNative using GTK_NATIVE()
is not going to work, but the API contract of gtk_widget_get_native()
explicitly allows a NULL return value.
2020-05-05 08:20:10 +02:00
Timm Bäder
94d3fd84b5 window: Remove unused private function 2020-05-05 08:20:10 +02:00
Timm Bäder
a40abcf74d scalebutton: Shorten finalize() implementation 2020-05-05 08:20:09 +02:00
Timm Bäder
9f90eb41c8 scalebutton: Remove unused click_id member 2020-05-05 08:20:09 +02:00
Timm Bäder
4b9e5304cc widget: Save controllers list in a GPtrArray 2020-05-05 08:20:09 +02:00
Timm Bäder
ef623aaabc widget: Only do a IS_ROOT type check if the parent is unset
So we do less type checks
2020-05-05 08:20:09 +02:00
Timm Bäder
de40b0b061 placesview: Remove frame
We don't need a double border here.
2020-05-05 08:20:09 +02:00
Timm Bäder
356dea3349 cssselector: Avoid some GList allocations 2020-05-05 08:20:09 +02:00
Timm Bäder
63bbc79f48 icontheme: Save dir_mtimes in a GArray, not a GList 2020-05-05 08:20:09 +02:00
Timm Bäder
d80c130d7f GdkEvent: Save history in a GArray
Instead of a less efficient GList.
2020-05-05 08:20:09 +02:00
Timm Bäder
14b27446a3 stylecontext: Remove _list_classes() from public API
Applications can use gtk_widget_get_css_classes these days.
2020-05-05 08:20:09 +02:00
Timm Bäder
289b157e32 textchild: Return an array from get_widgets
Yay, one GList less.
2020-05-05 08:20:09 +02:00
Timm Bäder
85237c8665 gdkdisplay-wayland: Fix a possibly uninitialized out value 2020-05-05 08:20:09 +02:00
Timm Bäder
61195df7a3 widget: Use early-out style in gtk_widget_realize()
This is much more common in the current code base and reduces the
indentation level by one.
2020-05-05 08:20:09 +02:00
Timm Bäder
ce07c0559d shorthandproperty: Use alloca() when parsing properties 2020-05-05 08:20:09 +02:00
Timm Bäder
f4edbdfc1f shorthandproperty: Return unset/initial/inherit as-is
We don't even need an array value these days.
2020-05-05 08:20:09 +02:00
Timm Bäder
526187d36c shorthandproperty: Use alloc a for data array 2020-05-05 08:20:09 +02:00
Timm Bäder
96673d5106 popover: Remove an unused gtk_widget_get_allocation() call 2020-05-05 08:20:09 +02:00
Timm Bäder
88f5d4547c label: Remove a debug leftover 2020-05-05 08:20:09 +02:00
Timm Bäder
34976a791c gskpango: Make get_color a bit shorter
Don't copy from crenderer->fg_color just to override from the local
color again.
2020-05-05 08:20:09 +02:00
Timm Bäder
ad73afcd79 label: Unref style_attrs list 2020-05-05 08:20:09 +02:00
Matthias Clasen
4735d38e31 docs: Fixup for an uninitialized variable 2020-05-04 22:53:08 -04:00
Matthias Clasen
17c21513a8 testsuite: Update a testcase
Our testcase for flipping icons used media icons which
were recently changed to not do rtl flipping anymore.
2020-05-04 22:53:08 -04:00
Matthias Clasen
3c165b3b77 Drop GtkBin
It is no longer used anywhere.
2020-05-04 22:53:08 -04:00
Matthias Clasen
cac514f647 testtooltips: Derive demo from GtkWidget 2020-05-04 22:53:08 -04:00
Matthias Clasen
8d0773fad0 inspector: Derive recorder from GtkWidget 2020-05-04 22:53:08 -04:00
Matthias Clasen
fa848e94d2 gtk-demo: Port blur demo from GtkBin 2020-05-04 22:53:08 -04:00
Matthias Clasen
d8e47383cb Add a test for bin child conversion 2020-05-04 22:53:08 -04:00
Matthias Clasen
dec5707ca9 builder-tool: Convert former bin children
Convert from <child> elements to <property name="child">
for former GtkBin subclasses. Update test results
to match.
2020-05-04 22:53:08 -04:00
Matthias Clasen
0ec5a3f0d9 tooltipwindow: Derive from GtkWidget 2020-05-04 22:53:08 -04:00
Matthias Clasen
aae25c4fa0 combobox: Derive from GtkWidget
We want to remove GtkBin and GtkContainer as they don't
provide much useful functionality anymore.

See #2681
2020-05-04 22:53:08 -04:00
Matthias Clasen
ec394e805b Use gtk_combo_box_set_child throughout 2020-05-04 22:53:08 -04:00
Matthias Clasen
5d26af06e4 combobox: Add a child property 2020-05-04 22:53:08 -04:00
Matthias Clasen
44f9a51827 testkineticscrolling: Make this work again
There was an errant g_free here, and lots of
redundant gtk_widget_show.
2020-05-04 22:53:08 -04:00
Matthias Clasen
e2781af16f testgtk: Fix g_object_new use
This is the kind of thing that happens with varargs apis.
2020-05-04 22:53:08 -04:00
Matthias Clasen
b96d7b62d1 Add gtk_overlay_remove_overlay
Now that GtkOverlay is not a container anymore,
gtk_container_remove can't be used for this anymore,
so add a separate api.
2020-05-04 22:53:08 -04:00
Matthias Clasen
edd5d36159 overlay: Derive from GtkWidget
We want to remove GtkBin and GtkContainer as they don't
provide much useful functionality anymore.

See #2681
2020-05-04 22:53:08 -04:00
Matthias Clasen
77af8e303d Use gtk_overlay_set_child throughout
Replace all uses of gtk_container_add on overlays
by gtk_overlay_set_child.
2020-05-04 22:53:08 -04:00
Matthias Clasen
53f9737dcf overlay: Add a child property 2020-05-04 22:53:08 -04:00
Matthias Clasen
3a9883b3ca searchbar: Derive from GtkWidget
We want to remove GtkBin and GtkContainer as they don't
provide much useful functionality anymore.

We have to implement GtkBuildable, in order to keep
the <child> element in ui files working for search bars.

See #2681
2020-05-04 22:53:08 -04:00
Matthias Clasen
99ef14b59f Use gtk_search_bar_set_child throughout 2020-05-04 22:53:08 -04:00
Matthias Clasen
e2abe6dd29 searchbar: Add a child property 2020-05-04 22:53:08 -04:00
Matthias Clasen
12ecbd1508 listboxrow: Derive from GtkWidget
We want to remove GtkBin and GtkContainer as they don't
provide much useful functionality anymore.

See #2681
2020-05-04 22:53:08 -04:00
Matthias Clasen
b8d1a9eb0d flowboxchild: Derive from GtkWidget
We want to remove GtkBin and GtkContainer as they don't
provide much useful functionality anymore.

See #2681
2020-05-04 22:53:08 -04:00
Matthias Clasen
41322e2a7a revealer: Derive from GtkWidget
We want to remove GtkBin and GtkContainer as they don't
provide much useful functionality anymore. This requires
us to move get_request_mode and compute_expand down.

See #2681
2020-05-04 22:53:08 -04:00
Matthias Clasen
649ae635a7 Use gtk_revealer_set_child throughout
Replace all uses of gtk_container_add on revealers
with gtk_revealer_set_child.
2020-05-04 22:53:08 -04:00
Matthias Clasen
686be577d5 revealer: Add a child property 2020-05-04 22:53:08 -04:00