Commit Graph

3512 Commits

Author SHA1 Message Date
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
Marc-André Lureau
a75de5fb90 gdk/win32: correct gdk_win32_surface_get_handle return type
The associated surface window handle is a HWND, not a HGDIOBJ.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-08-23 16:17:19 +04:00
Matthias Clasen
1097003f6f Beef up testfontchooserdialog
Allow testing levels.
2022-07-03 12:50:30 -04:00
Ivan Molodetskikh
53f3b4b9d9 tests: Add testdatatable
Add a GtkColumnView scrolling performance test similar to the one used
previously in https://gitlab.gnome.org/GNOME/gtk/-/issues/3334.

The test creates a table with 20 columns and 10,000 rows and scrolls it
to a random position every frame, while measuring the frame times.

There is a commandline flag to pick the cell widget between none (for
benchmarking raw column view scrolling) and various label types. There
is also a commandline switch to disable automatic scrolling in case a
manual assessment is desired. Finally, there's an argument for
controlling the number of columns.
2022-06-28 21:52:49 -07:00
Benjamin Otte
c796b30136 testcolumnview: Use GtkInscription
This test is suddenly MASSIVELY faster.

I wonder why.
Could it be because inscription does exactly what it was made for?
2022-06-10 04:34:23 +02:00
Matthias Clasen
b41206abab tests: Make fontchooser test build on macOS
Not sure what changed here, but we want to
be able to build this without fontconfig too.
2021-12-29 09:15:26 -05:00
Matthias Clasen
db46a8dd06 Add a testcase for scroll-to-mark
This should help for figuring out #4325.
2021-12-01 17:22:19 -05:00
Benjamin Otte
ef09cbee2f build: Fix build with sysprof-capture but without sysprof 2021-09-26 09:41:55 +02:00
Benjamin Otte
c84d5b1f7f tests: Update rendernode test to use textures 2021-09-16 23:59:37 +02:00
Matthias Clasen
643a91bd08 Fix the testupload test
This can only ever have worked by accident.
2021-09-10 08:28:32 -04:00
Matthias Clasen
a06858ccd9 Add a custom input test
This shows the minimal work required to hook up an
im context to a custom widget.
2021-08-17 22:33:26 -04:00
Caolán McNamara
bbf7454fc9 make testdnd trashcan work again
so that dragging into the 'trashcan' is detected
2021-06-23 15:09:44 +01:00