Commit Graph

3523 Commits

Author SHA1 Message Date
Matthias Clasen
3ab7b2d7ce Merge branch 'va-fixes-reported-by-pvs' into 'main'
Fix issues spotted by PVS-Studio

See merge request GNOME/gtk!6558
2023-11-15 00:27:08 +00:00
Andrey Kutejko
540a83327f Fix issues spotted by PVS-Studio 2023-11-14 08:56:40 +01:00
Matthias Clasen
d3a5aa5304 testdmabuf: Use GtkGraphicsOffload 2023-11-13 22:27:51 +01:00
Matthias Clasen
f0ec1660c1 Make testdmabuf fall back to memfd
If we can't open /dev/dma_heap/system, fall back to using memfd_create.
It does not let us make a 'proper' dmabuf, but it is good enough to
test our handling of linear buffers in various formats.
2023-10-22 22:18:30 -04:00
Benjamin Otte
e05764806a build: Change where we get drm_fourcc.h from
The canonical source for userspace is libdrm, not kernel headers.

Fixes compilation on Arch Linux.
2023-10-22 20:40:20 +02:00
Matthias Clasen
e1cbc96b8c testdmabuf: Add a --download-to option
The next option we add will tilt the balance
towards GOptionContext.
2023-10-21 17:26:53 -04:00
Benjamin Otte
58a0e4ffaa testdmabuf: Add --disjoint and --undecorated
The code now by default puts all planes into the same fd - like
v4l does, too.

The old behavior of one fd per plane can be enabled via --disjoint.

Also, am --undecorated option has been added so that the window
isn't decorated and all that the renderer has to do is display the
dmabuf.
This is useful when debugging just the dmabuf rendering.
2023-10-21 17:02:05 +02:00
Benjamin Otte
7ab9056c11 testdmabuf: Fix NV12
The code was computing the wrong size.
2023-10-21 16:42:16 +02:00
Benjamin Otte
2d9fbb16bc testdmabuf: Use the actual pixel
The previous code would subsample the luma channel, too. Don't do that.
2023-10-21 16:42:15 +02:00
Matthias Clasen
98e883f9b4 Make a test app with dma heaps
This uses the dma-heap kernel api to create a dma-buf
and use it for a GdkDmabufTexture. It supports a few
formats to test how well GL conversion of YUV works.

The YUV code is adapted from weston tests.
2023-10-20 19:53:33 -04:00
Matthias Clasen
fdcb1d92c5 Remove sysprof leftovers
This is a followup to 5dd0d39a6b.
2023-09-22 17:33:09 -04:00
Jonas Ådahl
7f946eff01 gtk: Add suspended window state
This is implemented using a new xdg_toplevel `suspended` state, and is
meant for allowing applications to know when they can stop doing
unnecessary work and thus save power.

In the other backends, the `suspended` state is set at the same time as
`minimized` as it's the closest there is to traditional windowing
systems.
2023-07-30 11:40:09 +03:00
Benjamin Otte
ece4e59e99 tests: Reduce number of random fonts
We were clowing through all the Pango caches for no benefit.

It made the test generation stuck in fontconfig loops instead of
quickly generating tests.

So don't do that and limit the different fonts to some reasonable list
of options.
2023-07-16 13:16:43 +02:00
Matthias Clasen
495411e16d testsections: A testbed for sections
Add a simple test client that lets us compare
and explore the section handling in listview
and gridview.
2023-05-27 21:30:14 -04:00
Benjamin Otte
8bcb918de5 tests: Remove some tests
They are failing to build because they use deprecated functions and
nobody thinks they're worth fixing.
2023-05-17 01:24:22 +02:00
Emmanuele Bassi
1ad4c04b2a Replace deprecated CSS loading API
Use gtk_css_provider_load_from_string() when loading CSS from C
strings.
2023-05-16 16:59:05 -04:00
Matthias Clasen
37345670c8 Add testfilelauncher
This is a test to use GtkFileLauncher a bit
more intensively than usual.
2023-05-15 00:20:24 -04:00
Matthias Clasen
ff920d98ec Use GTK_ALIGN_BASELINE_FILL
Replace GTK_ALIGN_BASELINE with its new name
everywhere.
2023-05-09 14:28:26 -04:00
Matthias Clasen
082ba6d7c8 Introduce GTK_ALIGN_BASELINE_FILL/CENTER
It turns out that the old behavior of GTK_ALIGN_BASELINE
was actually used in libadwaita, so bring it back, and
introduce a new GtkAlign value for the new behavior.
2023-05-07 21:26:09 -04:00
Matthias Clasen
14279785e6 tests: Stop using gtk_widget_get_allocated_width 2023-04-29 14:30:21 -04:00
Matthias Clasen
76698e5de8 testbaseline2: Don't set height-requests
Widget with height requests have their baselines
ignored. Oops.
2023-04-29 08:01:11 -04:00
Matthias Clasen
b201d66981 Stop using gtk_widget_get_allocated_baseline
Use gtk_widget_get_baseline instead.
2023-04-28 15:25:58 -04:00
Matthias Clasen
3766f1da8b Add another baseline test client 2023-04-28 08:50:12 -04:00
Benjamin Otte
5af3c2b2ec testcolumnview: Port to GtkColumnViewCell 2023-04-01 20:49:40 +02:00
Benjamin Otte
00cb4c66cf testdatatable: Add a --pages option
That way, local scrolling is available and the scrolling isn't random.

Recycling should now involve reordering the recycled widgets instead of
just keeping their order because all of them got recycled.
2023-04-01 20:49:40 +02:00
Matthias Clasen
b23ac5c8da Deprecate gtk_widget_translate_coordinates
Update all (non-deprecated) callers to use
gtk_widget_compute_point instead.

Fixes: #5697
2023-03-25 10:14:35 -04:00
Ivan Molodetskikh
8d96b12cc7 testdndresize: Add non-resizing redrawing GL surface
The GL Wayland drag surface code path has a bug where it does not reset
the hotspot, so if a GL-backed draw surface redraws without resizing or
resetting the hotspot, it moves away. The next commit will fix that, but
this commit adds a test for that.
2023-03-15 16:09:51 -07:00
Ivan Molodetskikh
cd5af8c0d9 tests: Add resizing drag icon test
The test can verify that dynamic drag icon resizing and hotspot
adjustment work as intended.
2023-03-14 19:31:49 -07:00
Matthias Clasen
61d53b6402 tests: Stop using g_slice 2023-03-14 14:56:42 -04:00
Matthias Clasen
6cb612ac15 gtk-demo: Fix build without sincos
We are getting into trouble here if
sincos isn't detected but still present
in headers. Avoid that.

Also fix the other copy of gtkgears.c.
2023-02-18 10:41:02 -05:00
Matthias Clasen
d8cb11ec4a Deprecate GtkStatusbar
The design patterns using statusbar are no longer popular,
and it is pretty easy to make a statusbar yourself with boxes
and labels, if you need one. The only thing special about
GtkStatusbar was its window resize handle, but that has
been gone for a long time.
2023-02-02 08:39:24 +01:00
Matthias Clasen
9356dfc404 filedialog: Drop shortcut folders
The filechooser portal does not support this,
and we are defaulting to using the portal now.
Lets not offer a non-functional API.
2023-01-06 07:40:57 -05:00
Matthias Clasen
0ccf9ad8fc testfiledialog: Be more lenient
Accept both open_multiple and open-multiple.
2023-01-06 07:12:36 -05:00
Matthias Clasen
b6f9e00a9e Add a test for GtkFileDialog 2023-01-05 23:13:58 -05:00
Matthias Clasen
18e0eaa9d6 tests: Stop using gtk_widget_show/hide 2022-12-13 13:46:02 -05:00
Matthias Clasen
a9b387b37b tests: Silence a compiler warning 2022-12-09 13:13:24 -05:00
Matthias Clasen
9948053cd7 Deprecate GtkDialog
GtkDialog is too flexible in terms of UI (headerbars vs action bar,
etc), and has archaic APIs. It is time to retire it.
2022-10-29 15:27:53 -04:00
Matthias Clasen
f54ab91ff3 Deprecate GtkFileChooser and implementations
These are being replaced by GtkFileDialog.

This commit only moves the headers for GtkFileChooserWidget and
GtkFileChooserDialog to deprecated/, and keeps the implementations
in gtk/, since they will eventually be salvaged into a private
GtkFileChooserWindow.
2022-10-29 13:31:41 -04:00
Matthias Clasen
66b062a976 Deprecate GtkMessageDialog
It is getting replaced by GtkAlertDialog

This commit only moves the header to deprecated/,
and keeps the implementation in gtk/, since it will
eventually be salvaged into a private, dialog-free
widget.
2022-10-29 13:31:41 -04:00
Matthias Clasen
15572b0183 Deprecate GtkFontChooser and implementations
These are being replaced by GtkFontDialog
and GtkFontDialogButton

This commit only moves the headers for GtkFontChooserWidget and
GtkFontChooserDialog to deprecated/, and keeps the implementations
in gtk/, since they will eventually be salvaged into a private
GtkFontChooserWindow.
2022-10-29 13:31:41 -04:00
Matthias Clasen
a51a6a3ee2 Deprecate GtkColorChooser and implementations
These are being replaced by GtkColorDialog
and GtkColorDialogButton.

This commit only moves the headers for GtkColorChooserWidget
and GtkColorChooserDialog to deprecated/, and keeps the
implementations in gtk/, since they will eventually be
salvaged into a private GtkColorChooserWindow.
2022-10-29 13:31:41 -04:00
Chun-wei Fan
1a5a65acd0 tests/testmountoperation.c: Fix build on Windows
Sadly, we can't just use an interger for a GPid on Windows, so just cast
it.  Sounds silly for non-Windows, but that's life...
2022-10-17 12:36:17 +08:00
Matthias Clasen
ac3177ce95 tests: Ignore deprecations
Some of our tests use deprecated style context api.
Most of them should be ported to use global style
providers eventually. For now, ignore deprecations.
2022-10-12 15:35:00 -04:00
Matthias Clasen
299fbfd722 tests: Ignore deprecations for render api 2022-10-12 15:35:00 -04:00
Matthias Clasen
69e4c9b01e tests: Ignore deprecations
Eventually, most of these tests should be dropped.
2022-10-11 17:18:21 -04:00
Benjamin Otte
0db5c7f421 testgtk: Use global css provider 2022-10-09 10:13:44 -04:00
Benjamin Otte
ed83272f35 tests: Use per-screen CSS providers 2022-10-09 10:13:10 -04:00
Matthias Clasen
e1f69ea278 testmountoperation: Test process dialog
Without this, it is hard to trigger the
dialog. Event with this, we have to force
GtkMountOperation to use its own dialog.
2022-10-04 21:26:07 -04:00
Matthias Clasen
7e9ca5b41d Deprecate GtkEntryCompletion
We want to drop cell renderers and tree models
in GTK 5. The functionality of GtkEntryCompletion
may be replaced by a new widget in GTK 5.
2022-10-03 23:23:56 -04:00
Matthias Clasen
a527a4d82e Deprecate the app chooser widgets
These are a family of pretty specialized widgets, and
are very rarely used. Instead of porting them away
from GtkTreeView and GtkComboBox, deprecate them.
2022-10-03 23:02:09 -04:00