Commit Graph

35413 Commits

Author SHA1 Message Date
Matthias Clasen
33011ccdff flowbox: Avoid a crash in measure()
When the children request a height of zero, the
flowbox measure() function was happily dividing
by that zero, leading to badness.
2020-05-13 21:47:11 -04:00
Matthias Clasen
7915e998e2 listbox: Make Shift-Tab work again
The previous fix broke the case where we're Shift-Tabbing
from a listboxrow child to the row itself. This was causing
the widget-factory2.tab-backward test to fail. Fix it, by
grabbing the focus to the row explicitly.
2020-05-13 21:45:49 -04:00
Matthias Clasen
7ef51da1c1 listbox: Don't steal focus-on-click
If a row has content that is focus-on-click, and is set
to focus-on-click itself, then the row steals the focus
fromt he content, since it uses focus-on-click on button
release, as opposed to button press. Avoid that by
refusing to take focus if it is already on some
descendent of the row.

This was showing up in the widget-factory listbox on
page 2, where clicking on the spinbutton would briefly
put the focus on the spinbutton, only to lose it to
the row.
2020-05-13 19:43:04 -04:00
Matthias Clasen
4c8688b846 inspector: Disable recursive inspection
We can't inspect the inspector, it doesn't work.
Therefore, disable the keybindings in the
inspector window.
2020-05-13 18:56:25 -04:00
Matthias Clasen
cea66139ae flowbox: Make the children focusable again
This broke when the :focusable property was introduced.
The symptom was that keynav in the Emoji chooser did
not work anymore.
2020-05-13 18:27:18 -04:00
Matthias Clasen
10be40a8b1 scrolledwindow: Fix swapping out child
This was not working in the case that the existing child
is not a scrollable. It showed up as crashes of the
scrolling benchmark in gtk4-demo when switching examples.
2020-05-13 17:10:36 -04:00
Matthias Clasen
d1134e7616 Merge branch 'usable-scales' into 'master'
Usable scales

See merge request GNOME/gtk!1893
2020-05-13 20:06:51 +00:00
Matthias Clasen
aae0770b82 scale: Make the area around the trough clickable
The narrow trough is too hard to hit as a click target.
Make the entire scale clickable.
2020-05-13 15:27:35 -04:00
Jakub Steiner
69ee1e1b86 Adwaita: use thinner arrows for navigation
- go-next go-previous instead of pan-end pan-start

See https://gitlab.gnome.org/GNOME/gtk/-/issues/2675
2020-05-13 17:18:45 +00:00
Matthias Clasen
fa784aaa06 Cosmetics 2020-05-13 08:11:50 -04:00
Timm Bäder
9149c79f25 window: Restructure gtk_window_destroy()
The previous code was unreffing the window twice, which caused problems
during dialog destruction. Move to g_list_store_find instead of
iterating manually.

ref() the window before and unref() after. g_list_store_remove will
actually unref() the window, since the toplevel_list owns its own
reference.

Fixes #2741
Fixes #2742
2020-05-13 12:18:09 +02:00
Timm Bäder
a50bf27cf2 main: Inline propagate_{down,up} in propagate_internal()
Don't have to worry about anyone calling the up/down variants on their
own this way.
2020-05-13 11:52:22 +02:00
Timm Bäder
ddaf50dfcc window: Create constraint solver on demand 2020-05-13 11:52:16 +02:00
Timm Bäder
8a7fb4b133 widget: Make 1 if out of 2 ifs 2020-05-13 11:52:07 +02:00
Timm Bäder
9e0bf35941 paned: Fix up the docs once more 2020-05-13 09:42:51 +02:00
Timm Bäder
f78c167476 cssvalue: Add class check to transition
In b25f93e24c we removed the code
comparing the transition functions, but we didn't add any other check
back.

Fixes #2740
2020-05-13 08:07:55 +02:00
Timm Bäder
167c6119eb widget: Move adjusted size calculation below early-out goto 2020-05-13 08:07:55 +02:00
Timm Bäder
ef2af521b1 widget: Remove size allocate signal enum member 2020-05-13 08:07:55 +02:00
Timm Bäder
aedc956f6c renderboder: Ignore transparent outlines 2020-05-13 08:07:55 +02:00
Benjamin Otte
d9c0d98871 inspector: Use the monitor list to list monitors 2020-05-13 07:49:56 +02:00
Matthias Clasen
b230ea2140 paned: Don't ignore the type attribute
We were meaning to only handle <child> here for
compatibility, not <child type="somethingelse">.
2020-05-12 16:27:25 -04:00
Matthias Clasen
a37dc29850 paned: Drop the Private struct 2020-05-12 16:25:58 -04:00
Matthias Clasen
c916221f59 Merge branch 'matthiasc/for-master' into 'master'
printoperation-unix: Fix a use-after-free

See merge request GNOME/gtk!1883
2020-05-12 18:54:59 +00:00
Matthias Clasen
09ea880a43 printoperation-unix: Fix a use-after-free
It turns out that finish_print destroys the
PrintResponseData, so we can't access it afterwards.
2020-05-12 14:09:51 -04:00
Emmanuele Bassi
58774eea72 docs: Add annotations for GtkPaned new getters
Which means also adding gtk-doc stanzas.
2020-05-12 18:52:45 +01:00
Carlos Garnacho
3b9a8194a5 Merge branch 'wip/carlosg/broken-grabs' into 'master'
Fixes to broken grabs

Closes #2665

See merge request GNOME/gtk!1879
2020-05-12 16:14:47 +00:00
Matthias Clasen
fdc9bfa2e9 Merge branch 'matthiasc/for-master' into 'master'
window: Hide windows on destroy

See merge request GNOME/gtk!1881
2020-05-12 15:58:10 +00:00
Carlos Garnacho
9103fd6687 gtkmain: Release the active state on GDK_GRAB_BROKEN
This is handled internally here, but misses broken grabs. The active
state should be dropped just as if the button were released.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2665
2020-05-12 17:39:54 +02:00
Matthias Clasen
ffcffcd773 window: Hide windows on destroy
I thought I could get away with just unrealizing the
window, but it turns out that gtk_window_hide() is the
place where we remove grabs when a modal dialog goes
away, so we ended up with stuck grabs.
2020-05-12 11:10:36 -04:00
Matthias Clasen
450879b1da Merge branch 'matthiasc/for-master' into 'master'
Documentation work

See merge request GNOME/gtk!1880
2020-05-12 14:52:01 +00:00
Emmanuele Bassi
717d4abebb Do not release the GFile prematurely
Otherwise we won't be able to access it to get the URI for the
GtkPrinterOption.

This fixes a regression introduced in commit 5f070ff233.
2020-05-12 13:45:15 +01:00
Emmanuele Bassi
d54b7dec94 Remove gtk_dialog_run()
Nested main loops are bad, as they introduce layers of complexity caused
by the potential re-entrancy in the case of multiple event sources, like
IPC, threads, etc. Additionally, the programming model they provide—stop
the world while spinning a new loop—does not conform to the event-driven
model employed by GTK.
2020-05-12 13:45:15 +01:00
Emmanuele Bassi
0a6848d70b Remove gtk_dialog_run() from GtkPrintUnixDialog
Replace it with an explicit nested main loop, as we need to block the
signal handler currently being emitted depending on the response of the
overwrite confirmation dialog.

This is a bit of a hack, and the only reason we need it is that the
print dialog will load the last used path as the output file name, when
printing to a file; this means that, in theory, it would be possible to
press Print without selecting a file, and accidentally overwriting an
existing file.

It would be much simpler if we did not store the last used path, and
always explicitly asked the user to select a file; this would avoid
destructive actions, and would allow us to rely on the overwrite
confirmation dialog right inside the file chooser.
2020-05-12 13:45:15 +01:00
Emmanuele Bassi
b8988be4b5 Remove unnecessary deprecation pragmas
The gtk_window_present() function is not deprecated.
2020-05-12 13:45:15 +01:00
Emmanuele Bassi
45eec06500 Drop gtk_dialog_run() from GtkPrintOperationUnix
We still provide a blocking API, but we should strongly reconsider it.
2020-05-12 13:45:15 +01:00
Emmanuele Bassi
96856527e6 Drop gtk_dialog_run() from GtkFileChooserWidget
The various dialogs we use inside the file chooser are modal already,
and do no need a nested loop.
2020-05-12 13:22:09 +01:00
Emmanuele Bassi
f81e6042be docs: Remove use of gtk_dialog_run()
Direct people to use GTK_DIALOG_MODAL and the "response" signal instead
of nested main loops.
2020-05-12 13:18:38 +01:00
Emmanuele Bassi
5d272a12cb Remove gtk_native_dialog_run()
Nested main loops are bad, as they introduce layers of complexity caused
by the potential re-entrancy in the case of multiple event sources, like
IPC, threads, etc. Additionally, the programming model they provide—stop
the world while spinning a new loop—does not conform to the event-driven
model employed by GTK.
2020-05-12 13:15:19 +01:00
Emmanuele Bassi
3212b07cf1 docs: Remove use of gtk_native_dialog_run() from examples
Use the "response" signal instead.
2020-05-12 13:15:19 +01:00
Emmanuele Bassi
f573a1f3f2 Remove gtk_dialog_run() from GtkMountOperation 2020-05-12 13:15:16 +01:00
Carlos Garnacho
fbd0c8dc34 gtkmain: Propagate GDK_GRAB_BROKEN events to/from current focus
Let keyboard/pointer paths handle their own events, and find the
current focus. The event will be propagated through instead of
being just emitted on the toplevel.

This makes it handled throughout all the gestures that want to
know about it.
2020-05-12 14:14:39 +02:00
Carlos Garnacho
5e765eaac4 gtktexthandle: Set css name on GtkWidgetClass
Handles are their own widget, special names are not necessary
anymore.
2020-05-12 14:14:39 +02:00
Matthias Clasen
d8db984890 docs: Tweaks
Replace some occurrences of GTK+ by GTK.
2020-05-12 07:50:12 -04:00
Matthias Clasen
7ef173aa34 dialog: Firm up handling of action widgets
It is unreliable to use the widget dom api to locate
action widgets. For example in a headerbar, they might
be deeper in the hierarchy, with boxes in between.
Therefore, make GtkDialog keep a list of action widgets,
and use that when operating on action widgets.
2020-05-11 22:38:21 -04:00
Matthias Clasen
f72d672434 dialog: Remove an unused struct 2020-05-11 22:38:21 -04:00
Matthias Clasen
5ebd42d402 Drop GtkContainer and its accessible implementation
It is no longer used.
2020-05-11 22:38:21 -04:00
Matthias Clasen
5573a3465c Drop gtkcontainer.h includes
These includes are unused.
2020-05-11 22:38:21 -04:00
Matthias Clasen
5f642f8096 box: Derive from GtkWidget 2020-05-11 22:38:21 -04:00
Matthias Clasen
6bc4446e3e assistant: Remove code that doesn't work anymore
When GtkContainer goes away, we don't have
an "add" signal anymore.
2020-05-11 22:38:21 -04:00
Matthias Clasen
6c78eeebe4 dialog: Remove code that doesn't work anymore
When GtkContainer goes away, we don't have an
"add" signal anymore.
2020-05-11 22:38:21 -04:00
Matthias Clasen
58a88a88b8 shortcutssection: Drop container bits
When GtkBox stops being a container, GtkShortcutsSection
will also no longer be a container. So, stop overriding
container vfuncs, and instead add a buildable implementation
that does the right thing.
2020-05-11 22:38:21 -04:00
Matthias Clasen
537d21155f shortcutsgroup: Drop container bits
When GtkBox stops being a container, GtkShortcutsGroup
will also no longer be a container. So, stop overriding
container vfuncs, and instead add a buildable implementation
that does the right thing.
2020-05-11 22:38:21 -04:00
Matthias Clasen
2a24b8c653 Replace most remaining uses of container api
These are all on GtkBox or enumerating children.
2020-05-11 22:38:21 -04:00
Matthias Clasen
665edcba53 box: Add gtk_box_append/prepend/remove
Add replacement api for gtk_container_add/remove.
2020-05-11 22:38:21 -04:00
Matthias Clasen
a0437628e3 notebook: Derive from GtkWidget 2020-05-11 22:38:21 -04:00
Matthias Clasen
0daa1f3daa Stop using container api on GtkNotebook 2020-05-11 22:38:21 -04:00
Matthias Clasen
c7b7d78ae1 headerbar: Derive from GtkWidget 2020-05-11 22:38:21 -04:00
Matthias Clasen
abfa4d4a5c Stop using container api on GtkHeaderBar 2020-05-11 22:21:39 -04:00
Matthias Clasen
d59d9d4bd5 headerbar: Add gtk_header_bar_remove
This is a replacement for gtk_container_remove.
2020-05-11 22:21:39 -04:00
Matthias Clasen
3d100abea8 listbox: Derive from GtkWidget 2020-05-11 22:21:39 -04:00
Matthias Clasen
88141103cd Don't use container api on GtkListBox 2020-05-11 22:21:39 -04:00
Matthias Clasen
ff91ce9eb4 listbox: Add gtk_list_box_remove
This is a gtk_container_remove replacement.
2020-05-11 22:21:39 -04:00
Matthias Clasen
7af15ae277 buildable: Cosmetics
Don't refer to GtkContainer in the docs.
2020-05-11 22:21:39 -04:00
Matthias Clasen
001d62381a customlayout: Cosmetics
Don't refer to GtkContainer in the docs.
2020-05-11 22:21:39 -04:00
Matthias Clasen
47139bc506 textviewchild: Derive from GtkWidget
GtkContainer is going away.
2020-05-11 22:21:39 -04:00
Matthias Clasen
bf543e0367 text: Fix popover use
There were some leftover gtk_container_add calls here
on popovers on buttons, but these are no longer containers.
2020-05-11 22:21:39 -04:00
Matthias Clasen
5c34b30819 textview: Fix popover use
There were some leftover gtk_container_add calls here
on popovers on buttons, but these are no longer containers.
2020-05-11 22:21:39 -04:00
Matthias Clasen
ddcc9db568 flowbox: Derive from GtkWidget 2020-05-11 22:21:39 -04:00
Matthias Clasen
3bff7d3a37 Stop using container api on GtkFlowBox
GtkContainer is going away.
2020-05-11 22:21:39 -04:00
Matthias Clasen
2f7f6e6a37 flowbox: Add gtk_flow_box_remove
This is the replacement for gtk_container_remove.
2020-05-11 22:21:39 -04:00
Matthias Clasen
5907ecebfc stack: Derive from GtkWidget 2020-05-11 22:21:39 -04:00
Matthias Clasen
a7769c9c88 treepopover: Stop using container api 2020-05-11 22:21:39 -04:00
Matthias Clasen
b490800949 shortcutswindow: Stop using container api 2020-05-11 22:21:39 -04:00
Matthias Clasen
ee5587d516 shortcutssection: Stop using container api 2020-05-11 22:21:39 -04:00
Matthias Clasen
01c3e2ce0d Don't use container api on GtkStack 2020-05-11 22:21:39 -04:00
Matthias Clasen
5e0c1e6a86 stack: Add gtk_stack_remove
This is a replacement for gtk_container_remove.
2020-05-11 22:21:39 -04:00
Matthias Clasen
741a9cb320 fixed: Derive from GtkWidget 2020-05-11 22:21:39 -04:00
Matthias Clasen
96d707444d fixed: Add gtk_fixed_remove
This is the replacement for gtk_container_reomve.
2020-05-11 22:21:39 -04:00
Matthias Clasen
3852661865 grid: Derive from GtkWidget
GtkContainer is going away.
2020-05-11 22:21:39 -04:00
Matthias Clasen
932aa58237 Avoid container api on grids
GtkContainer is going away.
2020-05-11 22:21:39 -04:00
Matthias Clasen
5cda824784 grid: Add gtk_grid_remove
This is a replacement for gtk_container_remove.
2020-05-11 22:21:39 -04:00
Matthias Clasen
1a33278703 infobar: Derive from GtkWidget
GtkContainer is going away.
2020-05-11 22:21:39 -04:00
Matthias Clasen
12ca08c382 infobar: Add gtk_info_bar_add/remove_child
This is a replacement for container api that is going away.
2020-05-11 22:21:39 -04:00
Matthias Clasen
78d20b9301 infobar: Add gtk_info_bar_remove_action_widget
This is mainly for completeness, since gtk_container_remove
will not work for those anymore.
2020-05-11 22:21:39 -04:00
Matthias Clasen
bc6643f3c2 paned: Redo the api
This commit is porting GtkPaned to be derived
from GtkWidget instead of GtkContainer, while adding
start-child and end-child properties. The existing
properties are renamed to follow the start/end naming
scheme, and we add proper getters and setters.

Update all users.

See #2719
2020-05-11 22:21:33 -04:00
Matthias Clasen
fc9873e9ef paned: Drop some dead code 2020-05-11 22:21:14 -04:00
Matthias Clasen
253a39c6e9 iconview: Derive from GtkWidget
GtkIconView is not a container.
2020-05-11 22:21:14 -04:00
Matthias Clasen
825e98dcca expander: 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 #2719
2020-05-11 22:21:14 -04:00
Matthias Clasen
6b80d90db5 expander: Add a child property 2020-05-11 22:21:14 -04:00
Matthias Clasen
e2b23e8fde actionbar: Derive from GtkWidget
GtkContainer is going away.
2020-05-11 22:21:09 -04:00
Matthias Clasen
c0f090627a actionbar: Add gtk_action_bar_remove
This is a replacement for gtk_container_remove.
2020-05-11 20:33:23 -04:00
Matthias Clasen
3697c57e56 treeview: Derive from GtkWidget
Drop the GtkContainer vfuncs.
2020-05-11 20:33:23 -04:00
Matthias Clasen
52b1a347d8 treeview: Stop using container api 2020-05-11 20:33:23 -04:00
Matthias Clasen
aeef59fda9 textview: Derive from GtkWidget
Drop the GtkContainer vfuncs. As a replacement for
gtk_container_remove, make gtk_text_view_remove public.
2020-05-11 20:33:23 -04:00
Matthias Clasen
84632b0901 dragicon: drop gtkcontainer.h include
We don't need it anymore here.
2020-05-11 20:33:23 -04:00
Matthias Clasen
e516616cca textviewchild: Don't leak children
Like everybody else, GtkTextViewChild must
unparent its children in dispose.
2020-05-11 20:33:23 -04:00
Matthias Clasen
501eda2956 window: Fix accessible implementation
Now that GtkWindow is no longer a container,
update the accessible implementation to match.
2020-05-11 15:42:52 -04:00
Matthias Clasen
7fac7c2d28 statusbar: Fix accessible implementation
Now that GtkStatusBar is no longer a container,
update the accessible implementation to match.
2020-05-11 15:42:52 -04:00
Matthias Clasen
295c5594ce scrolledwindow: Fix accessible implementation
Now that GtkScrolledWindow is no longer a container,
update the accessible implementation to match.
2020-05-11 15:42:52 -04:00
Matthias Clasen
a65f70ac23 popover: Fix accessible implementation
Now that GtkPopover is no longer a container,
update the accessible implementation to match.
2020-05-11 15:42:52 -04:00
Matthias Clasen
2e615d8c20 frame: Fix accessible implementation
Now that GtkFrame is no longer a container,
update the accessible implementation to match.
2020-05-11 15:42:52 -04:00
Matthias Clasen
ce5b51b017 flowboxchild: Fix accessible implementation
Now that GtkFlowBoxChild is no longer a container,
update the accessible implementation to match.
2020-05-11 15:42:51 -04:00
Matthias Clasen
cca73c436d combobox: Fix accessible implementation
Now that GtkComboBox is no longer a container,
update the accessible implementation to match.
2020-05-11 15:42:51 -04:00
Matthias Clasen
840a5e35f4 listboxrow: Fix the accessible implementation
GtkListBoxRow is no longer a container, update
the accessible implementation to match.
2020-05-11 15:42:51 -04:00
Matthias Clasen
af19c7275b button: Fix accessible implementation
Now that GtkButton is no longer a container,
update the accessible implementation to match.
2020-05-11 15:42:51 -04:00
Matthias Clasen
d7b1ecdf52 Cosmetics: Replace GtkContainer in an error message
GtkWidget is not that much better here, unfortunately.

Adapt the testsuite to match.
2020-05-11 15:42:51 -04:00
Matthias Clasen
ba0579c670 Merge branch 'matthiasc/for-master' into 'master'
print-editor: Bring back the menubar

See merge request GNOME/gtk!1875
2020-05-11 19:08:53 +00:00
Matthias Clasen
cc28a7b0ef Merge branch 'wip/tintou/doc-fixes' into 'master'
docs: Fix several missing references in the documentation

See merge request GNOME/gtk!1874
2020-05-11 18:40:34 +00:00
Matthias Clasen
58fd969b2d printeroptionwidget: Avoid a critical
The new_location can be NULL, as we clearly
knew earlier in the function. We've forgotten
about that by the time we unref it :(
2020-05-11 14:26:31 -04:00
Matthias Clasen
495b9caf63 headerbar: Don't clean up other widget children
The parent of the title_widget is the center box,
it needs to call gtk_widget_unparent on it.
2020-05-11 14:25:57 -04:00
Matthias Clasen
ea53b445a8 filechooserdialog: Be more careful with widgets
We were stepping on our own toes, by first setting
up a save entry and telling the filechooserwidget
about it, and then nuking it by setting a title
on the headerbar. The filechooserwidget wasn't
ready for the entry to die without anybody telling
it.

This fixes a crash when using the filechooser for
print-to-file in the print dialog.
2020-05-11 14:23:58 -04:00
Simon McVittie
6451250b2e aboutdialog: Update precondition checks for new licenses added in 3.24.20
To avoid making this mistake again, add a static assertion that the
enum is in sync with gtk_license_info, and use the length of
gtk_license_info for the precondition check.

Signed-off-by: Simon McVittie <smcv@debian.org>
Resolves: #2734
2020-05-11 18:37:22 +01:00
Corentin Noël
076b2f11d2 docs: Fix several missing references in the documentation
This fixes several typos and missing references
2020-05-11 19:26:20 +02:00
Matthias Clasen
6d969d1026 Update the docs
Remove various references to gtk_widget_destroy in the docs.
2020-05-11 12:20:59 -04:00
Matthias Clasen
177c0eb9e2 Unset tooltip window earlier
This avoids a crash when the tooltip window tries
to update its action muxers.
2020-05-11 12:20:59 -04:00
Matthias Clasen
1306727fb1 window: Remove _set_has_user_ref_count 2020-05-11 12:20:59 -04:00
Matthias Clasen
0f10b170f4 widget: Drop gtk_widget_destroy 2020-05-11 12:20:59 -04:00
Matthias Clasen
6aebedb8bc window: Implement gtk_window_destroy
Don't call gtk_widget_destroy; instead implement
gtk_window_destroy outselves by removing the window
from the toplevel lista and dropping the reference that
GTK holds.
2020-05-11 12:20:59 -04:00
Matthias Clasen
025375ff5f Replace gtk_widget_destroy everywhere
Replace all remaining uses of gtk_widget_destroy
by gtk_container_remove or g_object_unref.
2020-05-11 12:20:59 -04:00
Matthias Clasen
cd0081d08a Use gtk_window_destroy
Replace calls to gtk_widget_destroy on windows
with gtk_window_destroy.
2020-05-11 12:20:57 -04:00
Matthias Clasen
48821a64d0 window: Add gtk_window_destroy
This is a replacement for gtk_widget_destroy for toplevels.
For now, it is just a wrapper.
2020-05-11 12:19:39 -04:00
Matthias Clasen
81340da8b6 nativedialog: Do not ref the transient_for parent
gtk_window_set_transient_for does not ref its parent either. This is
important because a child widget of the parent might be the one calling
this function.

This was showing up as widget-factory not existing on close after
opening the file chooser.
2020-05-11 12:19:39 -04:00
Matthias Clasen
ddebf07236 popover: Fix a reference leak
Don't leak the reference to the default widget.
2020-05-11 12:19:39 -04:00
Matthias Clasen
0ba1aad4e3 filechooserdialog: Fix disposing
We need to drop our widgetry in dispose to prevent
leakage.
2020-05-11 12:19:39 -04:00
Matthias Clasen
4b144855b9 colorchooserdialog: Fix disposing
We need to drop our widgetry in dispose to prevent
leakage.
2020-05-11 12:19:39 -04:00
Matthias Clasen
b6bfeb786f fontchooserdialog: Fix disposing
We need to drop our widgetry in dispose to prevent
leakage.
2020-05-11 12:19:39 -04:00
Matthias Clasen
573b20a8f8 Drop gtk_widget_destroyed
Use g_object_add_weak_pointer or a weak reference instead.
2020-05-11 12:19:39 -04:00
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