Commit Graph

76746 Commits

Author SHA1 Message Date
Benjamin Otte
49c2c2da1a vulkan: Use map/unmap for fallback images 2023-06-14 03:34:07 +02:00
Benjamin Otte
f88b1cef21 vulkan: Render fallback into vulkan memory
Use the new map/unmap image upload method for Cairo node drawing:
1. map() the memory
2. create an image surface or that memory
3. draw to that image surface
4. success

There's no longer a need for Cairo to allocate image memory.
2023-06-14 03:34:07 +02:00
Benjamin Otte
c27e412ff1 vulkan: Use new upload method for texture uploads
gsk_vulkan_image_new_from_texture() now uses the direct copy via
gdk_texture_downloader_download_into().
2023-06-14 03:34:07 +02:00
Benjamin Otte
0c72f19cb1 vulkan: Add a new way to upload data into images
As an alternative to gsk_vulkan_image_new_from_data() that
takes a given data and creates an image from it, add a 3 step process:
  gsk_vulkan_image_new_for_upload()
  gsk_vulkan_image_map_memory()
  /* put data into memory */
  gsk_vulkan_image_unmap_memory()

The benefit of this approach is that it potentially avoids a copy;
instead of creating a buffer to pass and writing the data into it before
then memcpy()ing it into the image, the data can be written straight
into image memory.

So far, only the staging buffer upload is implemented.

There are also no users, those come in the next commit(s).
2023-06-14 03:34:07 +02:00
Benjamin Otte
cb4e92946b vulkan: Move some code
Add gsk_vulkan_image_new_from_texture() and use it.

Also rewrite the actual code from using Cairo surfaces to using
GdkTextureDownloader.
2023-06-14 03:34:07 +02:00
Benjamin Otte
e7c86f4608 vulkan: Constify upload function 2023-06-14 03:34:07 +02:00
Matthias Clasen
4d026857dc Merge branch 'wip/carlosg/pad-detection' into 'main'
gdk/wayland: Create pad devices on enter

See merge request GNOME/gtk!6094
2023-06-14 00:10:32 +00:00
Carlos Garnacho
c523c68cef gdk: Include pads in GDK_SEAT_CAPABILITY_ALL
The GDK_SEAT_CAPABILITY_TABLET_PAD stood awkwardly out of the
ALL value. Even though it's not a keyboard, its focus has more
resemblance to it, so it should be part of this group together
with keyboards.
2023-06-14 01:42:53 +02:00
Carlos Garnacho
9f4320a4ac gdk/wayland: Create pad devices on enter
We were creating the pad device on wp_tablet_pad.done, but
at that time we do not know what tablet it is associated with,
thus we cannot get appropriate vid/pid/name properties for it.

To get that, we need to wait for the pad to enter a surface,
at that time we do know what tablet it is associated with, so
we can get better information about the device.

There are pads that may plausibly "change" tablet between
one .enter event and the next (e.g. Wacom Express Key Remote),
but this situation is highly unlikely. The pad devices created
are thus persistent until that situation happens.
2023-06-14 01:42:53 +02:00
Matthias Clasen
8f6cc19fdb Merge branch 'mcatanzaro/gtk-show-uri-deprecated-for' into 'main'
Change recommended replacement for gtk_show_uri()

See merge request GNOME/gtk!6093
2023-06-13 18:28:32 +00:00
Michael Catanzaro
bef1c69254 Change recommended replacement for gtk_show_uri()
Problem is GtkFileLauncher is unable to handle all the types of URIs
that are supported by gtk_show_uri(), e.g. help: URIs. GtkUriLauncher
avoids this problem.

Another problem is that GtkUriLauncher is just generally a better choice
for launching URIs, since you don't have to create a GFile in order to
use it. Porting code is slightly simpler.

The documentation still mentions both GtkFileLauncher and GtkUriLauncher
as options, but most people will use whatever the compiler recommends
when it prints the deprecation warning.
2023-06-13 13:03:04 -05:00
Carlos Garnacho
f381cdef5b Merge branch 'window-clear-resize_cursor-on' into 'main'
window: Clear resize_cursor on leave notify events

See merge request GNOME/gtk!6090
2023-06-13 11:39:04 +00:00
Michel Dänzer
f8fd04402e window: Clear resize_cursor on leave notify events
When the pointer leaves the window surface, gtk_window_capture_motion
will not be called anymore, so priv->resize_cursor may remain non-NULL
indefinitely without this.

If update_cursor is later called (via gtk_window_maybe_update_cursor) on
a virtual enter notify event (e.g. because the pointer entered a
descendant surface), it would previously re-set the window surface
cursor to priv->resize_cursor, which could result in the wrong cursor
shape being shown for descendant surfaces.

This affected mutter-x11-frames, see
https://gitlab.freedesktop.org/xorg/xserver/-/issues/1557.

One could also say that if the pointer leaves the window surface, it's
trivially not over any window edge.
2023-06-13 12:01:29 +02:00
Matthias Clasen
e5f570045e Merge branch 'matthiasc/for-main' into 'main'
Matthiasc/for main

See merge request GNOME/gtk!6091
2023-06-12 19:18:49 +00:00
Matthias Clasen
4bee0e2454 ci: Collect artifacts from the asan build 2023-06-12 14:54:28 -04:00
Matthias Clasen
fb6ce30fb4 listitemmanager: Quiet a compiler warning 2023-06-12 14:54:21 -04:00
Matthias Clasen
11108ed048 Merge branch 'a11y-overlay' into 'main'
inspector: Add an a11y overlay

Closes #5883

See merge request GNOME/gtk!6085
2023-06-12 17:56:26 +00:00
Matthias Clasen
deac44962a Fix a crash in gtk-demo
Fixes #5889
2023-06-12 12:12:49 -04:00
Daniel Boles
0f6219c9ca docs/reference/gtk/running: Incl GDK_DEBUG=portals
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5871
2023-06-12 16:29:52 +01:00
Luca Bacci
cf980cdefb Merge branch 'focus-modal-windows' into 'main'
win32: Focus modal windows when clicking on unfocused parent

See merge request GNOME/gtk!6051
2023-06-12 13:55:45 +00:00
Luca Bacci
51265e2367 Merge branch 'center-dialogs' into 'main'
win32: Center newly created transient windows

Closes #5407

See merge request GNOME/gtk!6050
2023-06-12 13:53:00 +00:00
Daniel Rusek
f1484df60a Update Czech translation 2023-06-12 13:14:31 +00:00
Matthias Clasen
92a8cf3f29 inspector: Add an a11y overlay
Add an overlay that shows a11y issues.

For now, this checks for:
 - abstract roles being used
 - elements without labels
 - required attributes
 - required context
2023-06-12 07:31:49 -04:00
Alice Mikhaylenko
5a877c8d43 menubutton: Horizontally expand child
Set hexpand on the outer box so we don't propagate that expand.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5883
2023-06-12 07:31:49 -04:00
Alice Mikhaylenko
1ffaf486af menubutton: Normalize label layout
- Remove unnecessary halign=center and hexpand=0 dance
- Set hexpand=false on the outer box so we don't propagate hexpand
2023-06-12 07:31:49 -04:00
Matthias Clasen
9c3e514d3f Merge branch 'misc-a11y-fixes' into 'main'
Various a11y improvements

See merge request GNOME/gtk!6089
2023-06-12 01:48:04 +00:00
Matthias Clasen
1b829c7d01 gtk4-demo: Some a11y improvements
Add some labels in the pickers demo.
2023-06-11 20:29:25 -04:00
Matthias Clasen
0f39069be1 filechooser: Some accessibility improvements 2023-06-11 20:29:25 -04:00
Matthias Clasen
bc27b54367 togglebutton: Set a11y properties on realize
The pressed property is required, so we need to
make sure that it is set.
2023-06-11 20:29:25 -04:00
Matthias Clasen
9e784f47c9 fontchooser: Add one more accessible property 2023-06-11 20:29:25 -04:00
Matthias Clasen
ade66c84ed aboutdialog: Set some accessible properties 2023-06-11 20:29:25 -04:00
Matthias Clasen
57c34fca96 menubutton: Set accessible relations
In the case where we create the popover, mark it
as labelled by the button.
2023-06-11 20:29:25 -04:00
Matthias Clasen
10e91f6281 shortcutswindow: Add some accessible properties 2023-06-11 20:29:25 -04:00
Matthias Clasen
aada893352 passwordentry: Change an accessible role
The caps-lock icon is really an alert. Maybe
this is in vain, since orca ignores these images.
2023-06-11 20:29:25 -04:00
Matthias Clasen
2349f13f45 Merge branch 'wip/alice/menu-button' into 'main'
menubutton: Horizontally expand child

Closes #5883

See merge request GNOME/gtk!6084
2023-06-11 15:14:02 +00:00
Matthias Clasen
084b4361b6 Merge branch 'master' into 'main'
Reset chars_changed_stamp in _gtk_text_btree_unref

Closes #5544

See merge request GNOME/gtk!6087
2023-06-11 11:12:52 +00:00
Daniel Boles
d0ebd42e3e Popover: If can't get widget rect, zero output ptr
cherry-pick of commit a6d40b610b

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/893#note_1766079
2023-06-11 11:46:36 +01:00
Bart Jacobs
a4330aae38 Reset chars_changed_stamp in _gtk_text_btree_unref
This causes an "Invalid text buffer iterator" warning to be produced if a TextIter is used after the TextBuffer is disposed.
2023-06-11 08:57:41 +00:00
Benjamin Otte
a02fc2d290 Merge branch 'wip/otte/for-main' into 'main'
mediafile: Load extension at startup with GTK_MEDIA

See merge request GNOME/gtk!6086
2023-06-11 02:19:13 +00:00
Benjamin Otte
9df935591c vulkan: Handle new nodes being added correctly
When nodes are added, nothing was warning us that we need to bump
N_RENDER_NODES.

Make sure that that's no longer necessary by refactoring the code to
remove the define.
2023-06-11 03:54:50 +02:00
Benjamin Otte
1f8045ddbe vulkan: Do intersection check for every node
This is more expensive, but it finds more cases, and in particular it
catches corner cases like empty nodes or fully clipped nodes that might
otherwise make the kernel throw signals in our direction.
2023-06-11 03:54:50 +02:00
Benjamin Otte
82ba8c848b vulkan: Handle empty rects in intersects_rect()
Apart from the none case, this was already handled, so we just check if
the rect is empty now.
2023-06-11 03:15:08 +02:00
Benjamin Otte
cf48f83709 mediafile: Load extension at startup with GTK_MEDIA
When the GTK_MEDIA env var is set, check at startup that it works, not
only when the first MediaFile is instantiated.

This has the fortunate side effect that it prints help output for
GTK_MEDIA=help at startup, too.
2023-06-11 03:14:55 +02:00
Matthias Clasen
9d79982677 Merge branch 'fontchooser-a11y' into 'main'
button: Improve accessible setup

See merge request GNOME/gtk!6081
2023-06-10 20:29:45 +00:00
Alice Mikhaylenko
27599d688e menubutton: Horizontally expand child
Set hexpand on the outer box so we don't propagate that expand.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5883
2023-06-11 00:02:15 +04:00
Alice Mikhaylenko
c0d8716366 menubutton: Normalize label layout
- Remove unnecessary halign=center and hexpand=0 dance
- Set hexpand=false on the outer box so we don't propagate hexpand
2023-06-11 00:01:19 +04:00
Benjamin Otte
3681144768 Merge branch 'wip/otte/for-main' into 'main'
testsuite: Add another test to the listitemmanager

See merge request GNOME/gtk!6083
2023-06-10 18:51:05 +00:00
Benjamin Otte
c2fef6f6fd listitemmanager: All sections without widgets are unmatched
We were failing to mark sections when both the start and end of the
untracked area fell on a section boundary.

Fixes testsuite failure in
https://gitlab.gnome.org/GNOME/gtk/-/jobs/2878290
2023-06-10 20:25:20 +02:00
Benjamin Otte
f06cfa2967 testsuite: Print update after changes, not before
This way, we don't do an empty print at the start and don't miss a print
at the end.
2023-06-10 20:25:20 +02:00
Benjamin Otte
2cbee7cf86 testsuite: Check that removing listitem trackers works properly
We remove them at the end, so just to be sure, check again.

(Guess if I added this check because removing failed.)
2023-06-10 20:25:20 +02:00