Commit Graph

35185 Commits

Author SHA1 Message Date
Matthias Clasen
8f9c3ed44a Stop using gtk_widget_destroyed
Replace all internal use of gtk_widget_destroyed
by g_object_add_weak_pointer.
2020-05-11 12:19:37 -04:00
Matthias Clasen
d061bcad52 treeview: Break reference cycles on unroot
It is a bad idea to have such cycles in the first place,
and there is no need to let them linger past unroot.

This stop the treeview depending on run_dispose to get
freed, a simple unparent will work now.
2020-05-11 10:30:03 -04:00
Matthias Clasen
329994291a Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

See merge request GNOME/gtk!1867
2020-05-11 14:24:45 +00:00
Matthias Clasen
9f3fb69dce Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #2729 and #2730

See merge request GNOME/gtk!1870
2020-05-11 12:51:08 +00:00
Matthias Clasen
0e18e52f00 menubutton: Cosmetics
Fix a few typos in the docs.
2020-05-11 08:15:56 -04:00
Matthias Clasen
4de4957aa3 applicationswindow: Make show-menubar FALSE by default
The fallback to the menubar is not a good sight,
we should not do that by default.
2020-05-11 08:15:56 -04:00
Matthias Clasen
d798527290 treeviewcolumn: Another case of box <> frame confusion
Don't call your boxes frames, folks!
2020-05-11 08:15:55 -04:00
Matthias Clasen
6140dafecf builderscope: Fix finalize <> dispose confusion
Don't chain up to dispose if you implement finalize.

This fix s courtesy of GOBJECT_DEBUG=objects.
2020-05-11 08:15:55 -04:00
Matthias Clasen
3a5cf61a4d print dialog: Fix frame <> box confusion
It is a bad idea to have a GtkBox called frame, event
if it started out its existence as a GtkFrame.
2020-05-11 08:15:55 -04:00
Matthias Clasen
a11119d317 treeview: Ensure search popover is properly inserted
The css tree and the widget tree are not in sync, so we need
to explicitly set the parent of the css node before inserting
the widget, or else we end up with critical warnings and a
non-working popover.

This can be seen in the print dialog, when moving the focus
to the printer list.
2020-05-11 08:15:55 -04:00
Matthias Clasen
6372a33838 Clarify docs around focus. 2020-05-11 00:29:41 -04:00
Matthias Clasen
b93631164f Remove lots of focus vfuncs
In many cases, the default widget vfuncs work just fine,
combined with setting focusable.
2020-05-11 00:11:37 -04:00
Matthias Clasen
46bad5d513 widget: Fix gtk_widget_focus_all for !focusable
This was a case that wasn't handle properly when
the focus is entering from the outside, in forward
direction.
2020-05-11 00:11:04 -04:00
Matthias Clasen
edc31a264c widget: Add a :focusable property
Add back a property that determines whether an individual
widget will accept focus or not. :can-focus prevents the
focus from ever entering the entire widget hierarchy
below a widget, and :focusable just determines if grabbing
the focus to the widget itself will succeed.

See #2686
2020-05-10 23:24:48 -04:00
Matthias Clasen
10921aa237 textview: Ensure popup menu is properly inserted
In the presence of attached children, the css tree and the
widget tree are not in sync, so we need to explicitly set
the parent of the css node before inserting the widget, or
else we end up with critical warnings and a non-working
menu.

This can be seen in testtextview.
2020-05-10 16:25:28 -04:00
Matthias Clasen
3f548327b5 textview: Give attached children a different css name
If we use "text" for the children that are attached to the
text view, they end up rendering the same background as the
main text content, causing that content to be covered up.

Fixes: #2729
2020-05-10 16:25:28 -04:00
Matthias Clasen
eae4a194b8 Merge branch 'wip/exalm/headerbar-dragging' into 'master'
Extract GtkWindow dragging and titlebar actions

Closes #2689

See merge request GNOME/gtk!1814
2020-05-10 18:15:57 +00:00
Timm Bäder
d015b1b29e scrolledwindow: Always keep the main child first
Otherwise we can't pick the scrollbars, which are allocated behind it.
2020-05-10 09:30:15 +02:00
Timm Bäder
343d294bfb stylecontext: Remove _save_named
Now unused.
2020-05-10 09:30:15 +02:00
Timm Bäder
6566fdc1e3 scrolledwindwo: Add a permanent junction node
Use that instead of save_named'ing a junction node.
2020-05-10 09:30:15 +02:00
Timm Bäder
bcdd6d5425 printunixdialog: Use two "paper" css nodes
Instead of save_named'ing to a temporary "paper" node.
2020-05-10 09:30:15 +02:00
Timm Bäder
cbbbf44dd4 cellrenderertoggle: Replace save_named with a css node 2020-05-10 09:30:13 +02:00
Timm Bäder
2455978c78 widget: Move {dis,}connect_frame_clock into their only caller
Makes sense to have these only in (un)realize.
2020-05-10 08:44:20 +02:00
Timm Bäder
343707e0a2 stylecontext: Remove some unused private API 2020-05-10 08:44:20 +02:00
Timm Bäder
1b10020b6e css: Make GtkStyleAnimation and subclasses non-objects
Making them GObjects is unnecessary. This enables further optimizations
down the road. The only place we use them in is gtkcssanimatedstyle.c
after all.
2020-05-10 08:44:20 +02:00
Timm Bäder
06460ea50c css: Drop a few dynamic type checks
We hit these code paths a lot
2020-05-10 08:44:20 +02:00
Timm Bäder
e12c9de5df csstransiton: Save finished state
Once a transtion is finished it can't change to unfinished again, so we
don't have to consult the progress tracker all the time.
2020-05-10 08:44:20 +02:00
Timm Bäder
f38bbb9bc2 gtkarray: memcpy() directly into the GPtrArray 2020-05-10 08:44:20 +02:00
Timm Bäder
75cfe3c6ae gtkarray: Create GPtrArray in insert() if we have to 2020-05-10 08:44:20 +02:00
Timm Bäder
24608d5c23 gtkarray: Fix a typo 2020-05-10 08:44:20 +02:00
Timm Bäder
b25f93e24c Make dimension values and calc values just number values 2020-05-10 08:44:20 +02:00
Timm Bäder
df08387e35 csscalcvalue: Avoid allocating memory in compute()
We already know how many values we're going to have, it's
value->n_terms.
2020-05-10 08:44:20 +02:00
Matthias Clasen
78343ef61a placesview: Don't do the same thing twice
When the schema is supported, we want to remove
the error style class, not add it again. Pointed
out by Rafał Mikrut.

Fixes: #2724
2020-05-09 19:41:30 -04:00
Matthias Clasen
0cd0ef2d26 widget: Don't leak a reference when reordering
When reordering a widget that is alrady under the
same parent, we must not take another reference.
2020-05-09 19:27:56 -04:00
Matthias Clasen
c4514e7eb4 window: Remove some dead code
We are not attaching windows anymore.
2020-05-09 19:27:56 -04:00
Matthias Clasen
61d39a09a5 Merge branch 'gbsneto/css-dequeue-fix' into 'master'
csswidgetnode: Don't check for container

See merge request GNOME/gtk!1861
2020-05-08 14:55:46 +00:00
Georges Basile Stavracas Neto
2cc6c4d2d1 csswidgetnode: Don't check for container
The conditions to queue and dequeue a CSS validation
are different; while queueing checks if the widget is
a root, dequeueing checks that AND if the widget is
a container.

GtkWindow is not a GtkContainer anymore, and that is
causing validations to be queued, but never dequeued.

Don't require the widget to be a GtkContainer for
dequeuing.
2020-05-08 10:57:41 -03:00
Matthias Clasen
6efdaa9ffd placeview: Hide the protocols grid when its empty
Seeing just the bold headings at the bottom of the
popover is confusing, so just hide the entire grid
in this case.
2020-05-08 09:20:02 -04:00
Matthias Clasen
d06cdf6318 droptarget: Fix confusion around ::leave signal
The leave signal should not take any arguments,
don't pass the GdkDrop. Update the documentation,
fix the emission and update users to match.

This was showing up as crash when dragging files
over the places sidebar.
2020-05-08 08:50:44 -04:00
Alexander Mikhaylenko
f4538839d4 window: Stop handling dragging and titlebar actions
Since GtkWindowHandle and GtkHeaderBar do it now, it can be removed from
GtkWindow, along with GTK_WINDOW_REGION_TITLE which at this point doesn't
differ from GTK_WINDOW_REGION_CONTENT.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/2689, since
GtkWindowHandle doesn't do that anymore.
2020-05-08 00:02:08 +05:00
Alexander Mikhaylenko
8ca1e0ddc3 headerbar: Include GtkWindowHandle
This allows it to continue being draggable when placed inside a window, and
will allow to remove the corresponding gestures from GtkWindow.
2020-05-07 23:58:16 +05:00
Alexander Mikhaylenko
4135276252 headerbar: Use GtkCenterBox internally
This will allow to easily wrap it into another widget in the next commits.
2020-05-07 23:58:16 +05:00
Alexander Mikhaylenko
8bd44cb3eb Add GtkWindowHandle
This will allow to move the titlebar handling logic out from GtkWindow.
2020-05-07 23:57:58 +05:00
Alexander Mikhaylenko
6c636642df widget: Pass parent to gtk_widget_consumes_motion()
Right now it assumes that the parent is a GtkWindow. This will break when
window dragging is handled by another widget.
2020-05-07 09:44:15 +05:00
Matthias Clasen
57d3719583 Fix an inspector crash
Fix the listmodel semantics of the controller model,
by making get_item return a reference.
This was broken in 4b9e5304cc.
2020-05-06 22:25:51 -04:00
Matthias Clasen
236fc57329 modelbutton: Unify activation code paths
Opening submenus by Enter or Space wasn't working,
because we had different code paths for activation
via keynav and via click. Unify them.
2020-05-06 20:27:04 -04:00
Emmanuele Bassi
56d3a79990 Annotate gtk_text_child_anchor_get_widgets() correctly
We switched from returning a list to returning a C array, which means we
need to update the introspection annotation and the documentation to
match the implementation.
2020-05-06 23:09:53 +01:00
Georges Basile Stavracas Neto
962de8f1ee Merge branch 'gbsneto/array-clear-func' into 'master'
icontheme: Don't free array element

Closes #2717

See merge request GNOME/gtk!1851
2020-05-06 22:02:17 +00:00
Matthias Clasen
2415c02bbd Merge branch 'wip/exalm/polish' into 'master'
Random polish

See merge request GNOME/gtk!1850
2020-05-06 21:47:47 +00:00
Georges Basile Stavracas Neto
6fc706f983 icontheme: Don't free array element
When setting a clear function on a GArray, unlike
most other places, this free func is expected to
*not* free the array element itself -- only its
contents.

Don't free the array element.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2717
2020-05-06 18:14:36 -03:00