gtk4.git
2 years agogtk4-demo: Some a11y improvements
Matthias Clasen [Sun, 11 Jun 2023 11:04:56 +0000 (07:04 -0400)]
gtk4-demo: Some a11y improvements

Add some labels in the pickers demo.

2 years agofilechooser: Some accessibility improvements
Matthias Clasen [Mon, 12 Jun 2023 00:19:24 +0000 (20:19 -0400)]
filechooser: Some accessibility improvements

2 years agotogglebutton: Set a11y properties on realize
Matthias Clasen [Sun, 11 Jun 2023 23:28:16 +0000 (19:28 -0400)]
togglebutton: Set a11y properties on realize

The pressed property is required, so we need to
make sure that it is set.

2 years agofontchooser: Add one more accessible property
Matthias Clasen [Sun, 11 Jun 2023 16:39:08 +0000 (12:39 -0400)]
fontchooser: Add one more accessible property

2 years agoaboutdialog: Set some accessible properties
Matthias Clasen [Sun, 11 Jun 2023 16:38:42 +0000 (12:38 -0400)]
aboutdialog: Set some accessible properties

2 years agomenubutton: Set accessible relations
Matthias Clasen [Sun, 11 Jun 2023 16:38:06 +0000 (12:38 -0400)]
menubutton: Set accessible relations

In the case where we create the popover, mark it
as labelled by the button.

2 years agoshortcutswindow: Add some accessible properties
Matthias Clasen [Sun, 11 Jun 2023 16:37:52 +0000 (12:37 -0400)]
shortcutswindow: Add some accessible properties

2 years agopasswordentry: Change an accessible role
Matthias Clasen [Sun, 11 Jun 2023 16:37:06 +0000 (12:37 -0400)]
passwordentry: Change an accessible role

The caps-lock icon is really an alert. Maybe
this is in vain, since orca ignores these images.

2 years agoMerge branch 'wip/alice/menu-button' into 'main'
Matthias Clasen [Sun, 11 Jun 2023 15:14:02 +0000 (15:14 +0000)]
Merge branch 'wip/alice/menu-button' into 'main'

menubutton: Horizontally expand child

Closes #5883

See merge request GNOME/gtk!6084

2 years agoMerge branch 'master' into 'main'
Matthias Clasen [Sun, 11 Jun 2023 11:12:52 +0000 (11:12 +0000)]
Merge branch 'master' into 'main'

Reset chars_changed_stamp in _gtk_text_btree_unref

Closes #5544

See merge request GNOME/gtk!6087

2 years agoPopover: If can't get widget rect, zero output ptr
Daniel Boles [Sun, 11 Jun 2023 10:46:36 +0000 (11:46 +0100)]
Popover: If can't get widget rect, zero output ptr

cherry-pick of commit a6d40b610be6acb635d8732c11bb6d866bf2e95d

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/893#note_1766079

2 years agoReset chars_changed_stamp in _gtk_text_btree_unref
Bart Jacobs [Sun, 11 Jun 2023 08:57:41 +0000 (08:57 +0000)]
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.

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Sun, 11 Jun 2023 02:19:13 +0000 (02:19 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

mediafile: Load extension at startup with GTK_MEDIA

See merge request GNOME/gtk!6086

2 years agovulkan: Handle new nodes being added correctly
Benjamin Otte [Sun, 11 Jun 2023 01:09:09 +0000 (03:09 +0200)]
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.

2 years agovulkan: Do intersection check for every node
Benjamin Otte [Sun, 11 Jun 2023 01:01:04 +0000 (03:01 +0200)]
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.

2 years agovulkan: Handle empty rects in intersects_rect()
Benjamin Otte [Sun, 11 Jun 2023 00:56:50 +0000 (02:56 +0200)]
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.

2 years agomediafile: Load extension at startup with GTK_MEDIA
Benjamin Otte [Sat, 26 Dec 2020 13:55:41 +0000 (14:55 +0100)]
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.

2 years agoMerge branch 'fontchooser-a11y' into 'main'
Matthias Clasen [Sat, 10 Jun 2023 20:29:45 +0000 (20:29 +0000)]
Merge branch 'fontchooser-a11y' into 'main'

button: Improve accessible setup

See merge request GNOME/gtk!6081

2 years agomenubutton: Horizontally expand child
Alice Mikhaylenko [Sat, 10 Jun 2023 20:02:15 +0000 (00:02 +0400)]
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

2 years agomenubutton: Normalize label layout
Alice Mikhaylenko [Sat, 10 Jun 2023 20:01:19 +0000 (00:01 +0400)]
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

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Sat, 10 Jun 2023 18:51:05 +0000 (18:51 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

testsuite: Add another test to the listitemmanager

See merge request GNOME/gtk!6083

2 years agolistitemmanager: All sections without widgets are unmatched
Benjamin Otte [Sat, 10 Jun 2023 18:20:51 +0000 (20:20 +0200)]
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

2 years agotestsuite: Print update after changes, not before
Benjamin Otte [Sat, 10 Jun 2023 18:20:10 +0000 (20:20 +0200)]
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.

2 years agotestsuite: Check that removing listitem trackers works properly
Benjamin Otte [Sat, 10 Jun 2023 18:19:19 +0000 (20:19 +0200)]
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.)

2 years agotestsuite: Add another test to the listitemmanager
Benjamin Otte [Sat, 10 Jun 2023 18:12:11 +0000 (20:12 +0200)]
testsuite: Add another test to the listitemmanager

Ensure the itemmanager doesn't lose any widgets by ensuring that the
tiles with widgets do account for all children of the list widget.

2 years agocolorchooser: Improve accessibility
Matthias Clasen [Sat, 10 Jun 2023 17:59:32 +0000 (13:59 -0400)]
colorchooser: Improve accessibility

Set up missing accessible relations, labels and roles.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sat, 10 Jun 2023 16:15:20 +0000 (16:15 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

inspector: Fix an oversight

See merge request GNOME/gtk!6082

2 years agofontchooser: Improve accessibility
Matthias Clasen [Sat, 10 Jun 2023 15:00:35 +0000 (11:00 -0400)]
fontchooser: Improve accessibility

Set up missing accessible relations, labels and roles.

2 years agobutton: Improve accessible setup
Matthias Clasen [Sat, 10 Jun 2023 14:25:02 +0000 (10:25 -0400)]
button: Improve accessible setup

With the current approach, we get duplicate labels
in the accessible name: _Cancel Cancel. Change things
around to always set the labelled-by accessible relation
if we have a label, and not the label accessible property.

2 years agoinspector: Fix an oversight
Matthias Clasen [Sat, 10 Jun 2023 14:26:25 +0000 (10:26 -0400)]
inspector: Fix an oversight

There is no margin property, so don't set it.

2 years agoMerge branch 'textview-ctrl-backspace' into 'main'
Matthias Clasen [Sat, 10 Jun 2023 13:33:10 +0000 (13:33 +0000)]
Merge branch 'textview-ctrl-backspace' into 'main'

textview: Improve word navigation

Closes #737

See merge request GNOME/gtk!6080

2 years agotextview: Improve word navigation
Matthias Clasen [Sat, 10 Jun 2023 13:03:10 +0000 (09:03 -0400)]
textview: Improve word navigation

Both Ctrl-Left and Ctrl-Backspace were failing
to step over a non-word at the beginning of
the line. Fix this to match GtkEntry behavior.

Fixes: #737
2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sat, 10 Jun 2023 11:03:02 +0000 (11:03 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

gtk-demo: Change sidebar tab behavior

Closes #3543

See merge request GNOME/gtk!6079

2 years agogtk-demo: Change sidebar tab behavior
Matthias Clasen [Sat, 10 Jun 2023 04:02:29 +0000 (00:02 -0400)]
gtk-demo: Change sidebar tab behavior

Change the sidebar to use the 'item' tab
behavior.

Fixes: #3543
2 years agotestsuite: More memleak fixes
Matthias Clasen [Sat, 10 Jun 2023 03:14:03 +0000 (23:14 -0400)]
testsuite: More memleak fixes

2 years agobuilder: Cosmetics
Matthias Clasen [Sat, 10 Jun 2023 03:13:26 +0000 (23:13 -0400)]
builder: Cosmetics

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sat, 10 Jun 2023 03:17:14 +0000 (03:17 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

inspector: Cosmetics

See merge request GNOME/gtk!6078

2 years agogtk: Plug a memory leak
Matthias Clasen [Sat, 10 Jun 2023 02:30:01 +0000 (22:30 -0400)]
gtk: Plug a memory leak

2 years agogsk: Fully free mask nodes
Matthias Clasen [Sat, 10 Jun 2023 02:23:06 +0000 (22:23 -0400)]
gsk: Fully free mask nodes

We were forgetting to chain up in finalize.  Oops

2 years agogsk: Plug a memory leak
Matthias Clasen [Sat, 10 Jun 2023 01:54:16 +0000 (21:54 -0400)]
gsk: Plug a memory leak

2 years agotestsuite: Plug some memory leaks
Matthias Clasen [Fri, 9 Jun 2023 14:59:47 +0000 (10:59 -0400)]
testsuite: Plug some memory leaks

2 years agoinspector: Show computed values in a11y tab
Matthias Clasen [Sat, 10 Jun 2023 01:03:54 +0000 (21:03 -0400)]
inspector: Show computed values in a11y tab

Show the name and description in the a11y tab.
These are not direct property values, but computed
according to ARIA rules.

2 years agoinspector: Cosmetics
Matthias Clasen [Fri, 9 Jun 2023 20:39:42 +0000 (16:39 -0400)]
inspector: Cosmetics

Don't use technobabble like "fps overlay" in the UI.

2 years agoMerge branch 'filechooser-sort-directories-first' into 'main'
Matthias Clasen [Fri, 9 Jun 2023 19:10:58 +0000 (19:10 +0000)]
Merge branch 'filechooser-sort-directories-first' into 'main'

FileChooser: Sort directories before files by default

See merge request GNOME/gtk!4284

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Fri, 9 Jun 2023 14:18:51 +0000 (14:18 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Avoid deprecation warnings from GTK_ALIGN_BASELINE_FILL

Closes #5875

See merge request GNOME/gtk!6077

2 years agoFix some typos in gtk.supp
Matthias Clasen [Fri, 9 Jun 2023 12:28:36 +0000 (08:28 -0400)]
Fix some typos in gtk.supp

Actually ignore the media module leak.

2 years agoprint: Drop one use of private api
Matthias Clasen [Fri, 9 Jun 2023 12:23:09 +0000 (08:23 -0400)]
print: Drop one use of private api

We added public api for the foreground color
for just this case, so use it.

2 years agogdk: Fix an oversight in GdkContentFormats
Matthias Clasen [Fri, 9 Jun 2023 12:12:56 +0000 (08:12 -0400)]
gdk: Fix an oversight in GdkContentFormats

When clearing a builder, reset the counts to 0.

Otherwise valgrind spots uninitialized memory
use in our testsuite.

2 years agoAvoid deprecation warnings from GTK_ALIGN_BASELINE_FILL
Matthias Clasen [Fri, 9 Jun 2023 10:39:02 +0000 (06:39 -0400)]
Avoid deprecation warnings from GTK_ALIGN_BASELINE_FILL

We have to be careful to only use GDK_ALIGN_BASELINE_FILL when
permitted by GDK_VERSION_MAX_ALLOWED because gtkenums.h is a
public header.

Fixes: #5875
I don't think we can avoid conditional compilation here, because the old definition is going to cause deprecated declaration warnings unless you define an old GDK_VERSION_MIN_REQUIRED.

2 years agoDrawingArea: Document Widget.get_color, !StyleCont
Daniel Boles [Fri, 9 Jun 2023 12:02:40 +0000 (13:02 +0100)]
DrawingArea: Document Widget.get_color, !StyleCont

StyleContext is deprecated. To just get foreground colour we now have a
method on Widget, so use that in this example, instead of StyleContext.

2 years agoUpdate POTFILES.in and POTFILES.skip
Piotr Drąg [Fri, 9 Jun 2023 11:22:17 +0000 (13:22 +0200)]
Update POTFILES.in and POTFILES.skip

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Fri, 9 Jun 2023 00:47:26 +0000 (00:47 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

testsuite: Set GIO_USE_VFS=local everywhere

See merge request GNOME/gtk!6076

2 years agoMerge branch 'print-subdir' into 'main'
Matthias Clasen [Fri, 9 Jun 2023 00:32:45 +0000 (00:32 +0000)]
Merge branch 'print-subdir' into 'main'

Move printing code to its own directory

See merge request GNOME/gtk!6067

2 years agotestsuite: Set GIO_USE_VFS=local everywhere
Benjamin Otte [Fri, 9 Jun 2023 00:26:18 +0000 (02:26 +0200)]
testsuite: Set GIO_USE_VFS=local everywhere

And do so centrally, not randomly in individual tests.

(Hopefully) fixes spurious test failures in CI.

Related: #5867

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Thu, 8 Jun 2023 23:54:07 +0000 (23:54 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

testsuite: Make memorytexture tests random

See merge request GNOME/gtk!6075

2 years agoprint: Reimplement collate preview
Matthias Clasen [Thu, 8 Jun 2023 04:24:38 +0000 (00:24 -0400)]
print: Reimplement collate preview

Redo this with widgets instead of cairo drawing.
The new private widget is called GtkPageThumbnail.

2 years agoprint: Drop some private api use
Matthias Clasen [Thu, 8 Jun 2023 04:02:05 +0000 (00:02 -0400)]
print: Drop some private api use

2 years agoMove resources too
Matthias Clasen [Thu, 8 Jun 2023 03:47:34 +0000 (23:47 -0400)]
Move resources too

2 years agotestsuite: Don't always loop in memorytexture tests
Benjamin Otte [Thu, 8 Jun 2023 23:09:52 +0000 (01:09 +0200)]
testsuite: Don't always loop in memorytexture tests

When running the tests, only run the random (and potentially large) size
download test once instead of 10 times.

There's no real benefit in doing that, both because it's unlikely to
fail only in the 2nd or 9th run and because the sizes are picked
randomly.

This also speeds up the test massively as the download test was
dominating the runtime.

2 years agotestsuite: Make memorytexture tests random
Benjamin Otte [Thu, 8 Jun 2023 23:04:27 +0000 (01:04 +0200)]
testsuite: Make memorytexture tests random

Instead of picking a few numbers in advance and running them through the
test gauntlet every time, pick the random numbers at runtime.

This both increases the test coverage in that it ultimately tests more
combinations across many runs and it reduces the runtime of individual
runs because every tun only runs the download tests twice (with 1px and
the random size) instead of 5 times.

And that speedup benefits the CI, where the asan runs would cause this
test to timeout sometimes.

2 years agoMerge branch 'wip/otte/for-vulkan' into 'main'
Benjamin Otte [Thu, 8 Jun 2023 21:57:07 +0000 (21:57 +0000)]
Merge branch 'wip/otte/for-vulkan' into 'main'

vulkan: Fancy gradients

See merge request GNOME/gtk!6073

2 years agovulkan: Antialiasing for linear gradients
Benjamin Otte [Thu, 8 Jun 2023 19:42:18 +0000 (21:42 +0200)]
vulkan: Antialiasing for linear gradients

Shaders are complicated now...

2 years agotestsuite: Add a test for repeating gradients
Benjamin Otte [Thu, 8 Jun 2023 10:52:33 +0000 (12:52 +0200)]
testsuite: Add a test for repeating gradients

Make sure scaling the image also scales the color stop lookup.

2 years agovulkan: Make gradient shader use buffers
Benjamin Otte [Thu, 8 Jun 2023 10:03:48 +0000 (12:03 +0200)]
vulkan: Make gradient shader use buffers

This allows putting any number of color stops into the buffer, so
fallbacks with too many stops are no longer necessary.

2 years agovulkan: Add support for storage buffers
Benjamin Otte [Thu, 25 May 2023 20:21:23 +0000 (22:21 +0200)]
vulkan: Add support for storage buffers

And add a default storage buffer that is used for per-frame temporary
data.

So far nothing is using this code, this is just infrastructure.

2 years agovulkan: Switch GLSL version to 450
Benjamin Otte [Thu, 8 Jun 2023 09:00:18 +0000 (11:00 +0200)]
vulkan: Switch GLSL version to 450

We need more modern features soon.

2 years agovulkan: Only update descriptor sets with contents
Benjamin Otte [Thu, 8 Jun 2023 04:55:40 +0000 (06:55 +0200)]
vulkan: Only update descriptor sets with contents

If one of the descriptor sets doesn't have any items, don't include it
in the sets passed to vkUpdateDescriptorSets().

This has no effect right now, because we either have both images and
samplers or neither, but it will become relevant once we also support
buffers.

2 years agoprint: Some more include cleanup
Matthias Clasen [Wed, 7 Jun 2023 19:35:12 +0000 (15:35 -0400)]
print: Some more include cleanup

2 years agoUpdate POTFILES.in
Matthias Clasen [Wed, 7 Jun 2023 18:41:46 +0000 (14:41 -0400)]
Update POTFILES.in

The moving the printing sources needs to
be reflected here.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Wed, 7 Jun 2023 15:11:29 +0000 (15:11 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Fix a compiler warning

See merge request GNOME/gtk!6070

2 years agoci: Mark asan as must-pass
Matthias Clasen [Wed, 7 Jun 2023 14:54:48 +0000 (10:54 -0400)]
ci: Mark asan as must-pass

The asan test run seems to pass pretty
reliably now, so lets keep it that way.

2 years agoFix a compiler warning
Matthias Clasen [Wed, 7 Jun 2023 11:41:30 +0000 (07:41 -0400)]
Fix a compiler warning

Compilers these days are very picky about
their NULLs.

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Wed, 7 Jun 2023 14:21:32 +0000 (14:21 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

gtk-demo: Remove random numbers

See merge request GNOME/gtk!6069

2 years agogtk-demo: make the sidebar request proper width
Benjamin Otte [Wed, 7 Jun 2023 13:55:59 +0000 (15:55 +0200)]
gtk-demo: make the sidebar request proper width

- 25 chars sounds about right for the texts we use
- don't use min width so we allow shrinking the widget (large text or
  small mobile devices)
- ellipsize the text instead of clipping it.

2 years agogtk-demo: Remove random numbers
Benjamin Otte [Wed, 7 Jun 2023 13:54:53 +0000 (15:54 +0200)]
gtk-demo: Remove random numbers

There were 3 different random numbers set to determine the sidebar width
and all of them were wrong. Remove them.

Instead, propagate the natural width of the listitems.

2 years agoFix a compiler warning
Matthias Clasen [Wed, 7 Jun 2023 11:41:30 +0000 (07:41 -0400)]
Fix a compiler warning

Compilers these days are very picky about
their NULLs.

2 years agoMake introspection build
Matthias Clasen [Wed, 7 Jun 2023 11:27:03 +0000 (07:27 -0400)]
Make introspection build

2 years agoprint: Maintain compatibility
Matthias Clasen [Wed, 7 Jun 2023 04:29:39 +0000 (00:29 -0400)]
print: Maintain compatibility

gtkunixprint.h is a public header, that needs
to keep being installed in the same location.

2 years agoprint: Start sorting apart includes
Matthias Clasen [Wed, 7 Jun 2023 03:35:07 +0000 (23:35 -0400)]
print: Start sorting apart includes

Use gtk/gtk.h in the print sources, so that it
becomes apparent where we are using private apis.

2 years agoprint: Move all the remaining sources
Matthias Clasen [Wed, 7 Jun 2023 03:14:39 +0000 (23:14 -0400)]
print: Move all the remaining sources

Move the unix- and Windows-specific print
sources to the gtk/print subdirectory.

2 years agoprint: Move frontend sources
Matthias Clasen [Wed, 7 Jun 2023 02:52:12 +0000 (22:52 -0400)]
print: Move frontend sources

Move the cross-platform printing sources
to the gtk/print subdirectory.

2 years agoprint: Install headers in a subdir
Matthias Clasen [Wed, 7 Jun 2023 02:45:02 +0000 (22:45 -0400)]
print: Install headers in a subdir

This is a first step towards isolating the printing
code within gtk.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Wed, 7 Jun 2023 03:14:17 +0000 (03:14 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Drop gtkunixprint-autocleanups.h

See merge request GNOME/gtk!6066

2 years agoprint: Rename private headers
Matthias Clasen [Wed, 7 Jun 2023 02:26:38 +0000 (22:26 -0400)]
print: Rename private headers

Rename private print-related headers to follow our
naming conventions:
gtkprintutils.h -> gtkprintutilsprivate.h
gtkprinteroption.h -> gtkprinteroptionprivate.h
gtkprinteroptionset.h => gtkprinteroptionsetprivate.h
gtkprinteroptionwidget.h -> gtkprinteroptionwidgetprivate.h

2 years agoDrop gtkunixprint-autocleanups.h
Matthias Clasen [Wed, 7 Jun 2023 02:18:12 +0000 (22:18 -0400)]
Drop gtkunixprint-autocleanups.h

Move these definitions where they belong
and git rid of an auxiliary header we don't
need anymore.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Tue, 6 Jun 2023 11:17:32 +0000 (11:17 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

ci: More asan test runs

See merge request GNOME/gtk!6064

2 years agoMerge branch 'wip/otte/fix-glx' into 'main'
Marco Trevisan [Tue, 6 Jun 2023 10:56:55 +0000 (10:56 +0000)]
Merge branch 'wip/otte/fix-glx' into 'main'

glx: Ignore all errors

See merge request GNOME/gtk!6065

2 years agoglx: Fake an X request to make GLX hack work
Benjamin Otte [Tue, 6 Jun 2023 03:13:39 +0000 (05:13 +0200)]
glx: Fake an X request to make GLX hack work

Sometimes, GLX can decide to use the previous request serial when faking
XErrors via __glXSendError() (look through the Mesa sources to enjoy).
This can cause the error trap we just installed to not feel responsible
for the error. And that makes GDK decide to immediately abort the
application.
That is not what we or GLX want.

So we use a no-op X Request to bump the request number so that when GLX
does its shenanigans, it uses a serial that our error trap will catch.

Fixes a crash in mutter's CI which apparently manages to drive GLX
without an X server.

2 years agoglx: Move error trap even further out
Benjamin Otte [Tue, 6 Jun 2023 02:57:12 +0000 (04:57 +0200)]
glx: Move error trap even further out

This way we only create one error trap for all attempts to create a
context instead of up to 3.

2 years agoglx: Ignore all errors
Benjamin Otte [Mon, 5 Jun 2023 17:12:29 +0000 (19:12 +0200)]
glx: Ignore all errors

In error cases, glXCreateContextAttribsARB() will always return NULL so
it is enough to run the loop until the first non-NULL context is
returned.

And at that point, we can just look at the return value and ignore all
errors.

2 years agoci: Build less for asan
Matthias Clasen [Tue, 6 Jun 2023 02:05:16 +0000 (22:05 -0400)]
ci: Build less for asan

The asan build is all about running the tests
with asan, so lets not waste time building
demos and examples.

2 years agoci: More asan test runs
Matthias Clasen [Tue, 6 Jun 2023 01:47:36 +0000 (21:47 -0400)]
ci: More asan test runs

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Tue, 6 Jun 2023 01:37:47 +0000 (01:37 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Revert "ci: More verbose output from asan"

See merge request GNOME/gtk!6063

2 years agoci: Disable headless tests under asan
Matthias Clasen [Tue, 6 Jun 2023 01:15:31 +0000 (21:15 -0400)]
ci: Disable headless tests under asan

Our use of LD_PRELOAD for these tests does not
sit right with asan, so just skip them in this
case.

2 years agoci: Tweak asan options
Matthias Clasen [Tue, 6 Jun 2023 01:09:51 +0000 (21:09 -0400)]
ci: Tweak asan options

Allow the allocator to return NULL, so our
g_try_malloc tests don't fail.

2 years agoci: Turn off LeakSanitizer
Matthias Clasen [Tue, 6 Jun 2023 00:56:00 +0000 (20:56 -0400)]
ci: Turn off LeakSanitizer

When it is enabled, almost every report from asan is
"LeakSanitizer has encountered a fatal error."
So try without.

2 years agoci: Reenable asan builds
Matthias Clasen [Mon, 5 Jun 2023 20:21:24 +0000 (16:21 -0400)]
ci: Reenable asan builds

This is an attempts to catch sporadic ci failures.

2 years agowayland: Free seat globals in dispose
Matthias Clasen [Mon, 5 Jun 2023 22:05:27 +0000 (18:05 -0400)]
wayland: Free seat globals in dispose

This matches what we do for the display globals.

2 years agogdk: Dispose seats when a display is closed
Matthias Clasen [Mon, 5 Jun 2023 22:04:12 +0000 (18:04 -0400)]
gdk: Dispose seats when a display is closed

We dispose the display itself. It does not make
sense to hold onto seat resources beyond that point.

2 years agowayland: Don't leak all globals
Matthias Clasen [Mon, 5 Jun 2023 21:18:10 +0000 (17:18 -0400)]
wayland: Don't leak all globals