Commit Graph

68171 Commits

Author SHA1 Message Date
Rafostar
53af35d256
x11: fix crash on idle compute size without layout
On x11 toplevel layout is not created before toplevel
is presented, but GTK tries to update it on idle
which leads to a crash due to accessing property
of undefined object. Treat soon to be created layout
as a layout with default values upon creation (resizable).
2021-01-03 18:02:31 +01:00
Philipp Kiemle
51a6b29e01 Update German translation 2021-01-03 13:41:25 +00:00
Philipp Kiemle
e3835476ba Update German translation 2021-01-03 13:40:13 +00:00
Timm Bäder
256b094b13 messagedialog: Modernize source file
Move vfunc implementations above class_init, remove unneeded prototypes,
properly indent everything and remove trailing whitespace
2021-01-03 11:01:29 +01:00
Timm Bäder
699adb0b10 widget: Refactor gtk_widget_class_set_template()
Don't call gbytes_get_data/get_size so often and exit early if the given
bytes is already precompiled.
2021-01-03 11:01:29 +01:00
Timm Bäder
c91b5eaa41 widget: Inline setup_template_child() into only caller
This is a pretty short and self-contained function.
2021-01-03 11:01:29 +01:00
Timm Bäder
7e1f20bf4c icontheme: Make a parameter const 2021-01-03 11:01:29 +01:00
Timm Bäder
f9fe640905 settings: Overallocate property_values
Instead of walking the pspecs twice and checking for the owner_type,
just allocate n_pspecs entries. They are the same value right now
anyway, but even if they aren't it doesn't hurt to have a few extra ones
allocated.
2021-01-03 11:01:29 +01:00
Timm Bäder
34ea99006f settings: Load keyfiles ourselves
This does not change anything in the case where the .init file does not
exist. We still hit the disk once. Otherwise, we now only hit it once
instead of twice and avoid a potential race-condition.
2021-01-03 11:01:29 +01:00
Timm Bäder
06cce81a97 widget: Use gtk_widget_get_native() in get_surface_allocation() 2021-01-03 11:01:29 +01:00
Timm Bäder
4a1a7940d5 gtksettings: Remove unused defines 2021-01-03 11:01:29 +01:00
Timm Bäder
1108d00014 render: Inline function into only caller 2021-01-03 11:01:29 +01:00
Timm Bäder
034672e84e frame: Remove unnecessary function
Just call the vfunc directly in the only place we used to call the old
wrapper
2021-01-03 11:01:29 +01:00
Timm Bäder
00c885c93c gesture: Replace tabs 2021-01-03 11:01:29 +01:00
Timm Bäder
114f0bd8d6 box: Replace tabs with spaces 2021-01-03 11:01:29 +01:00
Timm Bäder
24c67efdfd scrolledwindow: Use g_clear_handle_id 2021-01-03 11:01:29 +01:00
Timm Bäder
6a3748146d viewport: Small cleanup
No need to check for visibility before calling gtk_widget_measure().
2021-01-03 11:01:29 +01:00
Timm Bäder
92ec754737 widget: Move quark_builder_set_id declaration to other GQuarks 2021-01-03 11:01:29 +01:00
Timm Bäder
d11fbbc478 widget: Re-arrange some more functions 2021-01-03 11:01:29 +01:00
Timm Bäder
f11f0da11c wiget: Fix whitespace issues
Switch from tabs to spaces everywhere consistently and remove all
trailing whitespace.
2021-01-03 11:01:29 +01:00
Timm Bäder
ebdf2989f8 widget: Move a few vfunc implementations above class_init
And save us the prototypes at the top of the file this way.
2021-01-03 11:01:29 +01:00
Timm Bäder
bc35c5d494 nevertrigger: Remove unused instance members 2021-01-03 11:01:29 +01:00
Timm Bäder
70a3e5e8ce shortcutmanager: Use g_list_store_find()
We require glib 2.66 these days, so we can unconditionally use
g_list_store_find().
2021-01-03 11:01:29 +01:00
Timm Bäder
74ff61a937 gesturelongpress: Remove a useless cast
We already get a GtkGestureLongPress here.
2021-01-03 11:01:29 +01:00
Timm Bäder
280d7e57bd gesturelongpress: Keep the pspec around
So we can use it to notify(), like we do everywhere else.
2021-01-03 11:01:29 +01:00
Timm Bäder
03f5a368ec label: Remove unused private functions 2021-01-03 11:01:29 +01:00
Timm Bäder
0b15aba82a label: Remove mnemonics_visible_apply_recursively from private header
This is only used in gtklabel.c
2021-01-03 11:01:28 +01:00
Timm Bäder
d8fa9de93a label: Modernize source file
Try to sort toplevel functions to minimize unnecessary function
prototypes at the beginning of the file, get rid of all tabs and
trailing whitespace.
2021-01-03 11:01:28 +01:00
Timm Bäder
afabbc4957 gtk4-demo: Remove unused size group 2021-01-03 11:01:28 +01:00
Timm Bäder
d978ba31d6 glcontext-wayland: Whitespace 2021-01-03 11:01:28 +01:00
Timm Bäder
71efa96ef2 gesturestylus: Only add histroy element if translation succeeded
Instead of always doing it and then undoing it if the translation does
not succeed.
2021-01-03 11:01:28 +01:00
Timm Bäder
e336fe2bf8 gesturestylus: Retrieve event and controller widget only once
Make it clear that these are not gonna chance while iterating the loop.
2021-01-03 11:01:28 +01:00
Timm Bäder
d7f15c15e9 glcontext-wayland: Avoid heap-alloacting small arrays...
every frame.
2021-01-03 11:01:28 +01:00
Timm Bäder
fff570538c glcontext-wayland: Only allocate configs we use
We only use the first one, so don't allocate space for more than that.
2021-01-03 11:01:28 +01:00
Matthias Clasen
38166a67c7 NEWS: Updates 2021-01-02 20:17:19 -05:00
Matthias Clasen
01b94db73d Merge branch 'matthiasc/for-master' into 'master'
video: Tweak the docs

See merge request GNOME/gtk!3026
2021-01-02 19:04:26 +00:00
Matthias Clasen
c804645382 video: Tweak the docs
Point out the limitations and use cases of GtkVideo
and mention that GtkPicture can display video just fine.
2021-01-02 12:21:03 -05:00
Matthias Clasen
384081ce0a Merge branch 'matthiasc/for-master' into 'master'
video: Pause on unset too

See merge request GNOME/gtk!3025
2021-01-02 15:49:46 +00:00
Florentina Mușat
afccb86f7e Update Romanian translation 2021-01-02 11:21:43 +00:00
Matthias Clasen
0ba5631100 video: Pause on unset too
When new media stream is set on the GtkVideo
widget and we're autoplaying, pause the old one.

Otherwise, the music keeps playing unexpectedly.
2021-01-02 01:33:48 -05:00
Matthias Clasen
c72589f0ee Merge branch 'wip/chergert/fix-macos-compute-size' into 'master'
macos: fix compute_size and request_layout

Closes #3532

See merge request GNOME/gtk!3023
2021-01-01 23:33:01 +00:00
Matthias Clasen
f2e5775380 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3506 and #3530

See merge request GNOME/gtk!3024
2021-01-01 22:48:11 +00:00
Benjamin Otte
a7164208d3 Merge branch 'video-stop' into 'master'
video: Stop playing when appropriate

See merge request GNOME/gtk!3022
2021-01-01 21:54:22 +00:00
Matthias Clasen
20f3d1608d video: Be consistent about play/pause
Always check that the stream is prepared, and the
widget is mapped, before calling gtk_media_stream_play().
2021-01-01 16:25:54 -05:00
Christian Hergert
9320148d71 macos: implement compute_size and request_layout
These functions were not implemented when the sizing changes
landed before GTK 4 was released. This fixes an issue with non-
resizeable windows not reacting to layout changes.

Fixes #3532
2021-01-01 13:17:47 -08:00
Christian Hergert
ad617a0e06 macos: avoid setHasShadow unless shadow changes 2021-01-01 13:17:47 -08:00
Christian Hergert
62af8365f6 macos: fix toplevel present function prototype
No need to return anything here.
2021-01-01 13:17:47 -08:00
Matthias Clasen
29afe5a688 video: Stop playing when appropriate
When the widget gets unrealized or hidden, pause
the mediastream. Otherwise, audio might keep playing
unexpectedly.
2021-01-01 15:17:59 -05:00
Matthias Clasen
2d3885a44a center layout: Fix handling of expanding center child
We were not taking spacing into account when adjusting
the size of an expanding center child, causing it to slip
under the end child at times.

Fixes: #3506
2021-01-01 11:02:57 -05:00
Matthias Clasen
75a297632e Merge branch 'wip/chergert/fix-macos-window-check' into 'master'
macos: ensure GdkMacosWindow in surface discovery

Closes #3533

See merge request GNOME/gtk!3021
2021-01-01 15:39:08 +00:00