Commit Graph

75506 Commits

Author SHA1 Message Date
Luca Bacci
a55b84f524 Check for NULL groups in gtk_action_muxer_get_group ()
The groups hash table is initialized lazily when inserting
the first GActionGroup (gtk_action_muxer_insert ()). Do as
all surrounding code does and check for NULL before using
groups.

This avoids triggering a warning
2023-06-05 08:00:43 -04:00
Daniel Boles
ba69a30d27 MenuButton: Always mention child@always-show-arrow
get_always_show_arrow() did not mention at all that the custom child is
relevant. set_always_show_arrow() only did in the blurb, not for the arg
2023-06-05 07:59:47 -04:00
FineFindus
5abff9e22a docs: add HSL to Gdk.RGBA.parse
Update the Gdk.RGBA.parse docs to reflect the ability to parse HSL, which has been added in 4.5.0.
2023-06-05 07:58:47 -04:00
Jason Francis
6a172090aa win32: Invalidate inactive monitors
Without this, there are still GdkMonitors present for displays that are
present but disconnected (such as when a laptop disables the internal
display to connect to an external monitor).
2023-06-05 07:58:25 -04:00
Benjamin Otte
36b4903e0c glx: Implement support for EXT_swap_control
XWayland (at least on gnome-shell) does not support SGI_swap_control,
which we were using to unset the swap interval.

It does support EXT_swap_control though, which is the more modern
version of the same thing, so this commit adds support for that.

And now GDK_DEBUG=no-vsync gives me >1000fps instead of just 60fps,
2023-06-05 07:58:12 -04:00
José Expósito
2092d21bad gtkeventcontrollerscroll: Send lores scroll in the middle of the detent
Some mice send a value slightly lower than 120 for some detents. The
current approach waits until a value of 120 is reached before sending a
low-resolution scroll event.

For example, the MX Master 3 sends a value of 112 in some detents:

              detent                   detent
    |                        |                       |
                        ^    ^                    ^
                        112  REL_WHEEL            224

As illustrated, only one event was sent but two were expected. However,
sending the low-resolution scroll event in the middle plus the existing
heuristics to reset the accumulator solve this issue:

              detent                   detent
    |                        |                       |
                ^          ^             ^          ^
                REL_WHEEL  112           REL_WHEEL  224

Send low-resolution scroll events in the middle of the detent to solve
this problem.

Related to https://gitlab.gnome.org/GNOME/mutter/-/issues/2469
2023-06-05 07:57:52 -04:00
Daniel Boles
23c044d060 MenuButton: Fix small grammar-o/match related syms 2023-06-05 07:57:33 -04:00
Matthias Clasen
9de18be775 menus: Avoid unnecessary right padding
We are using placeholders in the 'check' column
that are put in a size group, so that they all
take the same space once a check or radio is shown.

Unfortunately, for the inline-buttons option, we
were using a GtkBuiltinIcon as placeholder, and those
respect the -gtk-icon-size CSS property and take
a minimum size of 16px. Use a GtkGizmo instead to
get the expected result of no extra padding unless
there's a check or radio.

Fixes: #5839
2023-06-05 07:57:21 -04:00
Khalid Abu Shawarib
10c62d9e72 gtk/recentmanager: Fix date leak 2023-06-05 07:57:07 -04:00
Arjan Molenaar
dc82959ac1 Fix typo in CSS docs 2023-06-05 07:56:40 -04:00
Calvin Walton
e435d8b93c filelauncher: Use ShowItems to show in File Manager
The non-portal fallback method for launching a file manager to show the
file in its parent directory was incorrectly using the `ShowFolders`
method (open a folder) instead of `ShowItems` (open the parent directory
and show the file).

The `show_item` function (previously `show_folder`) had an unused
`callback` parameter; it has been removed and the type of the parameter
containing the GTask has been renamed and now uses the correct type
instead of gpointer to reduce the amount of casting required.

Fixes GNOME/gtk#5842
2023-06-05 07:56:23 -04:00
Matthias Clasen
97ac0a4587 roaring: Mark a variable as unused
Otherwise clang complains.
2023-06-05 07:55:38 -04:00
Fina Wilke
a8ec2d6b9e scrolledwindow: Propagate child measure size whenever possible
In height-for-width and hscrollbar-policy = never, we can provide
the child with a proper for_size when measuring it. The same is true for
width-for-height and vscrollbar-policy = never.

This allows for accurately measuring the size of eg. wrapping labels.
2023-06-05 07:55:20 -04:00
Matthias Clasen
e8869391bb gsk: Fix a crash
When we start ignoring batches, we must do it everywhere,
or we may run into assertions. This was triggered by an
enormous text node tree produced by tests/rendernode-create.
2023-06-05 07:53:31 -04:00
Benjamin Otte
b902838344 node-editor: Print default renderer in title
If there is a value passed to GSK_RENDERER, display it in the window
title.

This is mostly so that when I show off screenshots, people know what
renderer I'm using.
2023-06-05 07:52:43 -04:00
Benjamin Otte
830d28df90 rendernode: clip when drawing shadows
Ensures the shadow stays small.
2023-06-05 07:52:27 -04:00
Benjamin Otte
41696b0c57 css: Remove crashy resource:// optimization
Using gdk_texture_new_from_resource() is not valid here because we are
not sure if the given resource is valid.

Plus, the previous optimization is no longer relevant, because we are
not using gdk_pixbuf_new_from_resource() anymore - which was what this
optimization was about before it was ported to GdkTexture.

Test attached.
2023-06-05 07:52:05 -04:00
Benjamin Otte
49d06736a5 gdk: Clamp frame region to surface size
The region may be larger than the surface's size, but many rendering
APIs require the size to be clamped.

Fixes #5812
2023-06-05 07:51:30 -04:00
Matthias Clasen
b4acfc890b Fix a few bugs in GtkPropertyLookupListModel
Fix bugs in property types.
2023-06-05 07:51:09 -04:00
Corey Berla
51140f2b3a filesystemmodel: Ignore changes on the parent directory
The filesystemmodel tracks changes and additions to child files
through G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED.  This event will also
occur if the parent directory is changed.  Since the parent directory
doesn't exist in the model, it creates a non-existent item.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4233
2023-06-05 07:50:34 -04:00
Corey Berla
999f503eec filechooserwidget: Stop leaking file system models 2023-06-05 07:50:25 -04:00
FeRD (Frank Dana)
7ef7dee97e doc/actions: Fix end-of-file :
The actions document ended with a : where there used to be a period,
seemingly a bug in the conversion from XML. Replace that : with a
period, and remove another spurious : inserted during the conversion.
2023-06-05 07:49:25 -04:00
FeRD (Frank Dana)
e67bfe453e docs/input: <kbd>␣</kbd> => <kbd>Space</kbd>
- Switch to semantic newlines, where adding <kbd> caused wrapped text
  to grow wider than 80 characters on some lines.
2023-06-05 07:49:17 -04:00
FeRD (Frank Dana)
630392c18f docs/input-handling: A few more <kbd> wrappings
- Format a few missed keypresses/combos using <kbd>
- Switch to semantic newlines for those (paragraphs, bullet points)
2023-06-05 07:49:09 -04:00
FeRD (Frank Dana)
39475ead3b docs/input-handling: Don't leave reader hanging
Strangely, the document's last sentence ended with a colon,
giving the impression there's missing text that should follow.
There is not.

Even more strange, it's _always_ ended with a colon,
ever since the file was converted from XML
(in commit 10cd539104).

BUT, the XML file it was converted _from_ ended that same sentence
with a period! I have no idea where the colon came from.
2023-06-05 07:48:43 -04:00
Matthias Clasen
84b5209e0c Add a README to examples/hello
Just so nobody wonders why there's a meson.build
in this subdirectory.
2023-06-05 07:48:26 -04:00
Daniel Boles
b1fe1c3417 Widget: Fix doubled word need, missing possessives 2023-06-05 07:48:04 -04:00
Matthias Clasen
062f9aa0eb popover: Stop making assumptions about corners
The popover tail drawing code was just assuming that
the corner values are numbers. Which they won't, anymore.
2023-06-05 07:47:45 -04:00
Matthias Clasen
14ec1e3388 css: Fix initial rotate transform value 2023-06-05 07:47:21 -04:00
Matthias Clasen
97f889d96c css: Make some corner values static
Provide static value for uniform corners
with lengths from 0 to 8px. This covers
the majority of corners in widget-factory.
2023-06-05 07:47:11 -04:00
Matthias Clasen
3a88cbd9b9 css: More static length values
Make all length values from 0px to 8px available
as static values. This will help with cutting
down on the number of corner values (we have a
lot of 5px corners).
2023-06-05 07:46:59 -04:00
Matthias Clasen
a1c7935d9d Revert "csscornervalue: Accept other values if x == y"
This reverts commit 1f2f2777e1.

It broke transitioning of corner values.
2023-06-05 07:46:47 -04:00
Matthias Clasen
17da269a5f css: Correct initial shadow filter values
This was using numbers instead of lengths,
causing confusion in the transition code.
2023-06-05 07:46:32 -04:00
Matthias Clasen
db5286d670 css: Fix transition of font features
If we store ints as values, we better use
g_hash_table_lookup_extended, or zeros will
show up as missing values.
2023-06-05 07:46:20 -04:00
Maximiliano Sandoval R
3f04251224 mediacontrols: Set valign=center on volume button
To match the play button.
2023-06-05 07:46:09 -04:00
Daniel Boles
17c5297aef Overlay: Add minimal doc blurb for property :child 2023-06-05 07:46:03 -04:00
Matthias Clasen
b88b4919be urilauncher: Validate the uri
We don't want to send nonsense to the portal.

Fixes: #5829
2023-06-05 07:45:25 -04:00
Matthias Clasen
bb3a6214cb tests: Stop copying the tool tests
No point in doing that, and the meson feature
we are using here is deprecated.
2023-06-05 07:44:08 -04:00
Aurimas Černius
c403656620 Update Lithuanian translation 2023-06-04 20:32:14 +00:00
Matthias Clasen
faa700e3a4 Merge branch 'backport_gtkstack_crash' into 'gtk-4-10'
Backport the fix from #6031

See merge request GNOME/gtk!6036
2023-05-30 10:24:10 +00:00
Lukáš Tyrychtr
35e813c814 GtkStack: Fix a potential crash in gtk_stack_get_first_accessible_child
This one can occur when the stack has no pages.
2023-05-30 10:45:15 +02:00
Matthias Clasen
dc306aec28 Merge branch 'cherry-pick-099955b0' into 'gtk-4-10'
cherry-picking "gridview: Add border-spacing where it was missed"

See merge request GNOME/gtk!6029
2023-05-29 00:14:36 +00:00
Benjamin Otte
915dd6583a gridview: Add border-spacing where it was missed
We were computing column widths without taking border-spacing into
account, making them slightly too big.


(cherry picked from commit 099955b0c0)
2023-05-28 15:13:39 -04:00
Asier Sarasua Garmendia
a6931a66c5 Update Basque translation 2023-05-18 16:30:55 +00:00
Jordi Mas
c163f74d99 Update Catalan translation 2023-05-12 19:42:11 +02:00
Guillaume Bernard
cfa3f25934 Update French translation 2023-05-12 13:13:03 +00:00
Matthias Clasen
38f9803f45 Merge branch 'cherry-pick-29e71868' into 'gtk-4-10'
treelistmodel: Be safer during collapsing

See merge request GNOME/gtk!5918
2023-05-05 03:52:53 +00:00
Benjamin Otte
541de3451c Merge branch 'wip/otte/treelistmodel-madness' into 'main'
treelistmodel: Be safer during collapsing

See merge request GNOME/gtk!5875

(cherry picked from commit 29e7186829)

8766a6fa treelistmodel: Be safer during collapsing
3c76f3fb treelistmodel: Delay notifies from TreeListRow
2023-05-04 21:45:06 -04:00
Matthias Clasen
b41af7b983 Merge branch 'wip/carlosg/invalidate-surface-x11-4-10' into 'gtk-4-10'
gdk/x11: Invalidate whole surface after size change (4.10)

See merge request GNOME/gtk!5916
2023-05-04 19:22:13 +00:00
Carlos Garnacho
b686ce1cb6 gdk/x11: Invalidate whole surface after size change
The Expose events following a ConfigureNotify may arrive at
a time that we did not resize the surface yet, making these
expose events a no-op. Even though gsk/gtk take care of the
window content itself, this might lead to unrendered portions
of the window shadow.

This may be seen with GSK_RENDERER=cairo and GDK_BACKEND=x11,
attempting to tile a window (e.g. gtk4-demo) left or right.
The window will show black rectangles or other artifacts in
the window shadow areas that correspond to the newly painted
portions (as the window needs to expand vertically).

In order to fix this with a similar behavior to Wayland,
consider ourselves the whole surface invalidated after resize,
in order to ensure everything is painted from scratch.

(cherry-picked from commit 24302315fb)
2023-05-04 19:03:58 +02:00