Commit Graph

75762 Commits

Author SHA1 Message Date
Benjamin Otte
62951c7277 wayland: Don't leak all surfaces
X11 does add an extra reference to surfaces that gets released when the
DestroyNotify event arrives.
Wayland doesn't ave such an event, so that reference never gets
released.

This fixes a copy/paste error introduced in commit 590f3dfa1f.
2023-04-16 19:28:21 +02:00
Benjamin Otte
8e00f6e5e5 wayland: Don't insta-crash when a surface gets disposed
We want to remove the event queue from the list of event queues, not the
surface.
Otherwise the freed queue stays in the list and the next time an event
comes in, we access invalid memory.

Fixes thinko introduced in commit 7fafa5133b.

Luckily, we leak all surfaces, so this problem never occured.
2023-04-16 19:28:21 +02:00
Matthias Clasen
25a10f502e Merge branch 'focus-testsuite-fixes' into 'main'
text: Fix fallout from focus changes

See merge request GNOME/gtk!5841
2023-04-16 07:36:11 +00:00
Matthias Clasen
585fb497c1 testsuite: Actually wait for focus
We were failing to properly iterate the main
context here. Oops.
2023-04-16 09:11:24 +02:00
Matthias Clasen
c57e5811f1 tests: Check is-focus instead of has-focus
We are not presenting windows here.
2023-04-16 08:50:35 +02:00
Matthias Clasen
940a2b6923 text: Fix fallout from focus changes
We don't get proper notification for when the toplevel
is-active property changes, so monitor has-focus, and
update cursor blinking.
2023-04-16 08:49:20 +02:00
Matthias Clasen
6cee73d100 Merge branch 'wip/otte/gles-fixes' into 'main'
GLES 2 fixes

See merge request GNOME/gtk!5837
2023-04-15 16:27:16 +00:00
Matthias Clasen
e4c43901c1 Merge branch 'matthiasc/for-main' into 'main'
window: Don't mark widget prematurely as has-focus

See merge request GNOME/gtk!5836
2023-04-15 16:09:32 +00:00
Benjamin Otte
b64f7050ba testsuite: Make GLES testsuite run use GLES 2
We want to support GLES 2, so make sure we test that support.

Also force-disable common extensions we don't explicitly check for and
don't want to accidentally use.
2023-04-15 17:55:20 +02:00
Benjamin Otte
d37b9619e2 gles: Don't use vertex array objects
They're not needed and GLES doesn't technically support them, even
though GTK had been using them via epoxy sneakily using the
GL_OES_vertex_array_object extension behind our back.
2023-04-15 17:55:20 +02:00
Matthias Clasen
4a22e681b3 text: Only claim primary when focused
It does not make sense otherwise, and has unfortunate
side-effects on Wayland.
2023-04-15 15:02:52 +02:00
Matthias Clasen
189aced844 wayland: Improve logging for primary selection 2023-04-15 15:02:52 +02:00
Matthias Clasen
d90cb02570 window: Don't mark widget prematurely as has-focus
has-focus is defined is-focus && toplevel::is-active.
We were forgetting to look at is_active when handling
focus widget changes.
2023-04-15 14:58:57 +02:00
Matthias Clasen
4246c7bafd Merge branch 'better-snapshot-nodes-docs' into 'main'
gtk: Improve documentation on returned nodes for snapshot

Closes #5747

See merge request GNOME/gtk!5831
2023-04-15 10:51:39 +00:00
Matthias Clasen
d67101d46e Tweak the wording 2023-04-15 10:35:12 +00:00
Benjamin Otte
60f3cc398a Merge branch 'wip/otte/for-main' into 'main'
inspector: Don't randomly emit application signals

See merge request GNOME/gtk!5834
2023-04-15 03:40:00 +00:00
Benjamin Otte
e010cd242c listlistmodel: Add a cache
Cache the last looked up item and use it for looking up the next item if
it's closest. This massively speeds up iteration over the model, because
each call to get_item() will be adjacent to the previous one.

Improves performance of the inspector quite a bit.
2023-04-15 05:27:47 +02:00
Benjamin Otte
41454b63b4 testsuite: Add some more exhaustive testing to listlistmodel 2023-04-15 05:27:47 +02:00
Benjamin Otte
f458951745 inspector: Don't randomly emit application signals
When the variant-editor emits a callback, it might not actually have
edited the value in question. Try to detect that by only emitting
signals if the value changed.
2023-04-15 05:27:47 +02:00
Benjamin Otte
ef3793ec37 Merge branch 'gbsneto/vulkan-buffer-release' into 'main'
gsk/vulkan/render: Download image before reset

See merge request GNOME/gtk!5832
2023-04-14 23:28:55 +00:00
Georges Basile Stavracas Neto
94b1a78378 gsk/vulkan/render: Download image before reset
gsk_vulkan_render_download_target() currently resets the uploader
objects before downloading the image that it produces. This is
problematic because there might be unreleased buffers and images
in the command queue.

In particular, this can make validation layers complain about the
glyph atlas - of all things! - upload buffer being released while
still being used by the command queue.

Fix that by resetting the uploader after downloading the image.
2023-04-14 16:43:04 -03:00
Marco Trevisan (Treviño)
584fd36a5f gtk: Improve documentation on returned nodes for snapshot
Closes: #5747
2023-04-14 18:05:21 +02:00
Matthias Clasen
64a1969293 Merge branch 'fix_scalebutton_orientation' into 'main'
ScaleButton: fix CSS name in documentation, fix orientation doing nothing

See merge request GNOME/gtk!5819
2023-04-13 20:44:23 +00:00
Matthias Clasen
2baab9732c Merge branch 'check-openuri-portal-version' into 'main'
openuriportal: Detect if the interface isn't there

Closes #5733

See merge request GNOME/gtk!5826
2023-04-13 20:44:03 +00:00
Georges Basile Stavracas Neto
8134daf843 Merge branch 'gbsneto/vulkan-mailbox' into 'main'
gdk/vulkancontext: Use more appropriate present mode

See merge request GNOME/gtk!5828
2023-04-13 17:07:59 +00:00
Georges Basile Stavracas Neto
9c013d40c1 gdk/vulkancontext: Use more appropriate present mode
Check if the driver supports MAILBOX and prefer using it; in its
absense, checkif the driver supports IMMEDIATE and prefer using
it; finally, if neither of them are supported, use the guaranteed
to be supported FIFO mode.
2023-04-13 13:54:45 -03:00
Benjamin Otte
d798372a53 Merge branch 'wip/otte/for-main' into 'main'
x11: Remove commented outdated code

See merge request GNOME/gtk!5827
2023-04-13 15:34:48 +00:00
Benjamin Otte
cfaf1b3e71 x11: Remove commented outdated code
... and it's copy/paste into the win32 backend
2023-04-13 17:15:35 +02:00
Benjamin Otte
9763d83a9d gdk: Remove unused vfunc 2023-04-13 17:15:35 +02:00
Benjamin Otte
5f82a496cb Merge branch 'wip/otte/wl-gloria-gaynor' into 'main'
wayland: Make wl_surface survive until surface is desstroyed

See merge request GNOME/gtk!5825
2023-04-13 15:12:07 +00:00
Matthias Clasen
0c35015c44 Merge branch 'wip/exalm/print-dialog' into 'main'
printunixdialog: Remove a redundant style class

See merge request GNOME/gtk!5823
2023-04-13 05:39:08 +00:00
Matthias Clasen
3da0572078 openuriportal: Detect if the interface isn't there
Check the portal version number before trying to use
it. Most importantly, this will detect the case where
the interface isn't supported at all, since the proxy
will report a version of 0 in that case.

Fixes: #5733
2023-04-13 07:24:38 +02:00
Matthias Clasen
c649d8a4ec Merge branch 'bilelmoussaoui/g-i' into 'main'
g-i: Fix GtkGLArea type name

See merge request GNOME/gtk!5824
2023-04-13 04:37:45 +00:00
Benjamin Otte
75bea01a86 wayland: Keep EGL window around when hidden
See previous commit:

We want to keep resources around as long as the surface exists.
2023-04-13 05:19:18 +02:00
Benjamin Otte
5d3cec5441 wayland: Don't destroy the wl_surface on hide()
We want to keep the wl_surface around, because surfaces create their
resources on construct and keep them until destroyed. See the HWND ond
Windows and the XWindow on X11.

This is relevant for graphics resources, where we want to have access
to the VkSurface and eglSurface while the GdkSurface is hidden.
We also want these surfaces to be permanent and not change during the
lifetime of the GdkSurface.

What we can - and must - destroy however are the xdg surfaces, because
those handle visibility on screen.
And we also need to ensure no buffer is attached, so that during the
next creation of the xdg surface we don't get a protocol error.
2023-04-13 04:23:35 +02:00
Benjamin Otte
891242920e wayland: Split out a function
We have a create_wl_surface(), create a matching destroy_wl_surface().
2023-04-13 02:56:12 +02:00
Benjamin Otte
b375f17f09 wayland: Remove useless function
gdk_wayland_surface_maybe_resize() just calls
gdk_wayland_surface_update_size(), so make all callers call that one
instead.

The check that it does is done by the other function again.
2023-04-13 02:48:47 +02:00
Benjamin Otte
ec69990126 wayland: Remove an old workaround
This workaround - were it ever to trigger - is broken today. It destroys
the wl_surface and all associated structs but does not recreate the
xdg_popup or xdg_toplevel struct, so it would cause a hidden window.

The workaround looked a lot different when it was introduced in commit
83b54bab57, too - both in what it did and
in what the vfuncs did that it called.
2023-04-13 02:44:05 +02:00
Bilal Elmoussaoui
aec5a5739e g-i: Fix GtkGLArea type name 2023-04-12 18:12:40 +00:00
Alexander Mikhaylenko
ac9e0039b8 printunixdialog: Remove a redundant style class
.view does absolutely nothing in Default style since the whole box is
covered with a GtkNotebook which has its own background, and adds an
unwanted background onto the tab strip in Adwaita.
2023-04-12 21:09:25 +04:00
Matthias Clasen
4574b21fd6 Merge branch 'dialogs-force-window-destruction' into 'main'
gtk/dialogs: Destroy the window promptly on finish async function

Closes #5741

See merge request GNOME/gtk!5820
2023-04-12 13:54:13 +00:00
Marco Trevisan (Treviño)
31c5961c4f gtk/dialogs: Destroy the window promptly on finish async function
Some bindings (GJS!) could add temporary references to the GAsyncResult
argument that we return, and thus to the GTask, which may cause the
dialog not to close when the finish function is called (but at garbage
collection instead!).

To prevent this, just manually destroy the window (by removing the task
data), so that we are not bound to the GTask lifetime anymore.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5741
2023-04-12 15:39:39 +02:00
Matthias Clasen
8fc3f06155 Merge branch 'filechooserentry-fixes' into 'main'
filechooserentry: Make filtering work again

Closes #5743

See merge request GNOME/gtk!5822
2023-04-12 10:38:04 +00:00
Matthias Clasen
5327203201 Merge branch 'wip/carlosg/multi-click-text-view' into 'main'
textview: Reset press counter if double/triple clicking on a different line

See merge request GNOME/gtk!5821
2023-04-12 10:11:16 +00:00
Matthias Clasen
8442fce962 Merge branch 'touch-no-double-click-threshold' into 'main'
gestureclick: Don't use threshold for touch

Closes #5580

See merge request GNOME/gtk!5798
2023-04-12 10:10:31 +00:00
Matthias Clasen
d8b46c16cc Merge branch 'stylus-fixes' into 'main'
gtk-demo: Test stylus-only mode

See merge request GNOME/gtk!5804
2023-04-12 10:10:11 +00:00
Matthias Clasen
4df7273266 filechooserentry: Plug a memory leak 2023-04-12 12:09:02 +02:00
Matthias Clasen
2b8fd89fd5 filechooserentry: Make filtering work again
We need to look at the filchooser::filtered-out
attribute to know which files the filesystem model
has filtered away.

Fixes: #5743
2023-04-12 12:08:43 +02:00
Carlos Garnacho
5b9a7863cf textview: Reset press counter if double/triple clicking on a different line
If we click close enough between lines, and with the maximum distances applied
by GtkGestureClick we could jump between lines when handling double/triple
click for word/line selection.

Ensure that the whole operation stays in the same line and reset the
gesture/counter if we do move between lines, so we start from scratch in the
new line.
2023-04-12 11:27:41 +02:00
G.Willems
d625ff8106 scalebutton: fix orientation not applied to scale 2023-04-11 23:54:06 +02:00