Commit Graph

1501 Commits

Author SHA1 Message Date
Matthias Clasen
dc4b7131f1 testsuite: Don't exit unsuccessfully when using TAP
The meson TAP parser doesn't take this lightly and
forgets all about xfails when we exit(1), so don't.
2020-03-20 11:55:26 -04:00
Matthias Clasen
c893f79023 reftests: Don't run tests with --verbose
Unexpected output tends to break TAP.
2020-03-20 10:43:25 -04:00
Matthias Clasen
cf7dc5b2bb testsuite: Don't g_print from tests
This breaks the TAP output.
2020-03-20 10:03:04 -04:00
Matthias Clasen
068ec58287 testsuite: Fix the accessible test
This test was happily doing nothing.
2020-03-20 10:03:04 -04:00
Matthias Clasen
f6fc3073fb temporarily disable window test
This test was broken by the GdkToplevel refactoring,
and needs a big gtkwindow.c configure request cleanup
before it will work again.
2020-03-19 18:08:06 -04:00
Matthias Clasen
31db615885 Revert "Merge branch 'disable-window-test' into 'master'"
This reverts commit 3ac4c76b18, reversing
changes made to 6ec96d2e98.
2020-03-19 18:03:16 -04:00
Matthias Clasen
89b537bd8a Fix the action test
We have a test that enumerates the GtkText actions,
so when a new open appears, the test needs to be updated.
2020-03-19 14:29:37 -04:00
Matthias Clasen
2e70b4c323 temporarily disable window test
This test was broken by the GdkToplevel refactoring,
and needs a big gtkwindow.c configure request cleanup
before it will work again.
2020-03-19 11:25:38 -04:00
Benjamin Otte
93bb3f7144 testsuite: Remove GtkAccelGroup usage 2020-03-18 23:00:51 -04:00
Benjamin Otte
94ef20ea36 accel: Add display arg to gtk_accelerator_parse_with_keycode()
It was using the default display unconditionally.
2020-03-18 23:00:51 -04:00
Benjamin Otte
87df17e4ce accelerators: Make gtk_accelerator_parse() return TRUE/FALSE
A parse function should return success or not. So do that.
2020-03-18 23:00:51 -04:00
Benjamin Otte
0c81698911 shortcuts: Mananage managed shortcuts with a custom model
Reduce the amount of special casing by using a list model
for global and managed shortcuts, too.

This way, the ListModel API will work for the ShortcutController in the
GtkShortcutManager and GtkRoot.

The only special case remaining is shortcut activation, which needs to
pass the right widget to the controller in the global/managed case.
2020-03-18 23:00:51 -04:00
Benjamin Otte
e6d0560a82 shortcut: Add GtkShortcutAction
Similar to GtkShortcutTrigger, GtkShortCutAction provides all the
different ways to activate a shortcut.

So far, these different ways are supported:

 - do nothing
 - Call a user-provided callback
 - Call gtk_widget_activate()
 - Call gtk_widget_mnemonic_activate()
 - Emit an action signal
 - Activate an action from the widget's action muxer
 - Activate a GAction
2020-03-18 23:00:51 -04:00
Benjamin Otte
fb99f834e6 gtk: Remove bindings
The whole binding functionality is now handled by shortcuts.
2020-03-18 23:00:50 -04:00
Matthias Clasen
78f9940ddc shortcut: Add GtkShortcutTrigger
Triggers are meant to describe how to trigger a shortcut.
So far only a keyval + modifiers trigger exists.
2020-03-18 23:00:49 -04:00
Matthias Clasen
33db28c288 Merge branch 'fix-tools-tests' into 'master'
Fix tools tests

See merge request GNOME/gtk!1524
2020-03-13 20:36:54 +00:00
Matthias Clasen
7db490ef2a testsuite: Specify the test protocol
If we don't specify protocol: 'tap', meson things
all is good even though my test yells "not ok".
2020-03-13 15:53:19 -04:00
Matthias Clasen
8b1301cecd Update the ui file conversion output
This changed because the popover property got renamed.
2020-03-13 15:53:19 -04:00
Matthias Clasen
bc6953a081 testsuite: Update the settings test output 2020-03-13 15:53:19 -04:00
Matthias Clasen
4b71ed3f5e testsuite: Update tools tests
These tests need to test GTK4 ui file syntax.
2020-03-13 15:34:54 -04:00
Matthias Clasen
8fd51d761b testsuite: Actually run tools tests
The script was looking in the wrong place for the tests.
2020-03-13 15:11:07 -04:00
Matthias Clasen
66a0a8d53e Merge branch 'wip/baedert/test-cflags' into 'master'
Pass (almost) all our cflags to tests, testsuite, examples, demos, ...

See merge request GNOME/gtk!1516
2020-03-13 18:40:46 +00:00
Matthias Clasen
e7ef4a57ca testsuite: Stop using type-hints 2020-03-11 19:36:04 -04:00
Matthias Clasen
aec3705717 testsuite: Stop using type-hint 2020-03-11 19:35:56 -04:00
Matthias Clasen
c488e86caa testsuite: Update a11y test output 2020-03-11 19:35:55 -04:00
Matthias Clasen
ad322c154c testsuite: Stop using GtkSpinner::active
This property was renamed to ::spinning.
2020-03-11 19:35:55 -04:00
Matthias Clasen
d70c9453ba disable popover test
This is failing atm
2020-03-11 19:35:55 -04:00
Timm Bäder
7553649c47 testsuite/gtk: Add common_cflags to build
With a few exceptions.
2020-03-07 16:28:04 +01:00
Timm Bäder
6fcd5d5ab5 testsuite/reftests: Add common_cflags to build 2020-03-06 18:24:58 +01:00
Timm Bäder
e759358402 testsuite/a11y: Add common_cflags to build 2020-03-06 18:22:01 +01:00
Timm Bäder
01bd7910ce testsuite/css: Add common_cflags to build
And fix all the errors coming from that.
2020-03-06 18:22:01 +01:00
Timm Bäder
79c60bb7fd testsuite/gdk: Add common_cflags to build 2020-03-06 18:22:01 +01:00
Timm Bäder
b3c332ad9c testsuite/performance: Add common_cflags to build 2020-03-06 18:22:01 +01:00
Timm Bäder
83982a28e7 testuite/gsk: Add common_cflags to build
And fix all the warnings and errors.
2020-03-06 18:22:01 +01:00
Benjamin Otte
b1a257c0c3 reftest: Plug memleak 2020-03-06 05:52:44 +01:00
Benjamin Otte
b231a40106 testsuite: Avoid passing NULL to strcmp()
Use g_strcmp0() instead.
2020-03-06 05:43:56 +01:00
Benjamin Otte
a411959c91 droptarget: Redo
This is a huge reorganization of GtkDropTarget. I did not know how to
split this up, so it's unfortunately all one commit.

Highlights:

- Split GtkDropTarget into GtkDropTarget and GtkDropTargetAsync
  GtkDropTarget is the simple one that only works with GTypes and offers
  a synchronous interface.
  GtkDropTargetAsync retains the full old functionality and allows
  handling mime types.

- Drop events are handled differently
  Instead of picking a single drop target and sending all DND events to
  it, every event is sent to every drop target. The first one to handle
  the event gets to call gdk_drop_status(), further handlers do not
  interact with the GdkDrop.
  Of course, for the ultimate GDK_DROP_STARTING event, only the first
  one to accept the drop gets to handle it.
  This allows stacking DND event controllers that aren't necessarily
  interested in handling the event or that might decide later to drop
  it.

- Port all widgets to either of those
  Both have a somewhat changed API due to the new event handling.
  For the ones who should use the sync version, lots of cleanup was
  involved to operate on a sync API.
2020-03-02 03:18:55 +01:00
Benjamin Otte
d9fa839097 testsuite: Use g_assert() in tests 2020-03-02 03:18:55 +01:00
Matthias Clasen
fa75d7f480 builder-tool: Fix a thinko
We can't rely on the pspec for a removed property.
This code worked until I actually removed the properties.

Update the tests to reflect this.
2020-02-26 10:01:38 -05:00
Matthias Clasen
37a2cae10e Small fixups
Trying to get the ci style test to pass.
2020-02-26 08:13:45 -05:00
Matthias Clasen
b5bacb3be6 Drop the margin property
Replace it with margin-start, -end, -top, -bottom throughout.
2020-02-25 20:59:04 -05:00
Matthias Clasen
a9c05193a7 Drop the expand property
The hexpand and vexpand properties are sufficient.
2020-02-25 18:29:15 -05:00
Matthias Clasen
2d4e1e248d update testsuite
Update the expected results of the tools tests that are
affected by the new property handling for expand and margin.
2020-02-25 18:28:55 -05:00
Matthias Clasen
648a67085f testsuite: Remove outdated exclusions
There were mentions of GtkCList and GtkColorSelection
in these test. The memories!
2020-02-24 23:08:34 -05:00
Matthias Clasen
a43d13aa74 popover: Drop ::relative-to
It is enough to just set the parent (and make the parent
call gtk_native_check_resize in size_allocate).

This commit removes the relative_to argument to the
constructors of GtkPopover and GtkPopoverMenu, and
updates all callers.
2020-02-24 20:46:41 -05:00
Matthias Clasen
7f46b25c04 Merge branch 'wip/ebassi/filechooser-new' into 'master'
Clean up the GtkFileChooser API

Closes #2455

See merge request GNOME/gtk!1454
2020-02-24 00:32:23 +00:00
Benjamin Otte
cc7c1fe108 gdk: Remove GdkAtom
finally!!!!!
2020-02-23 01:59:26 +01:00
Emmanuele Bassi
4a3742979d Remove GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
We don't need a whole separate action, now that the file chooser widget
can create folders; we can create use SELECT_FOLDER and create one.
2020-02-22 15:22:06 +00:00
Emmanuele Bassi
b09e7df81b Remove GtkFileChooser:local-only
Now that the whole API goes through GFile we don't have the weird split
between local-only and non-local-only modes.
2020-02-22 15:22:06 +00:00
Benjamin Otte
6f0a0ce7f1 testsuite: Don't use g_return_if_fail()
Use g_assert()
2020-02-22 07:44:52 +01:00
Benjamin Otte
18d7187e4b testsuite: Don't use return_if_fail()
Use assert() instead
2020-02-22 07:35:23 +01:00
Benjamin Otte
2a8fd25a4b testsuite: Check proper notify emissions, too
This is in particular relevant for the ::is-focus property, because
updating that one doesn't cause enter/leave events.

But it also checks that notify and enter/leave happen in the right
order.
2020-02-22 07:33:40 +01:00
Benjamin Otte
7597f6b594 transform: Don't crash for gsk_transform_transform (id, id)
See attached tests
2020-02-21 18:30:13 +01:00
Benjamin Otte
b50093d044 transform: Make sure the identity transform is equal to NULL 2020-02-21 18:25:05 +01:00
Matthias Clasen
cadeca74e2 Go back to ::enter/::leave for pointer changes
These signals are behaving a little differently from
what ::focus-in/::focus-out used to do.
2020-02-21 00:51:03 -05:00
Matthias Clasen
5a2f829a40 Split off GtkEventControllerFocus
Split the focus tracking into a separate
GtkEventControllerFocus, and change the API one more time.
We are back to having ::focus-in and ::focus-out signals.

Update all users.
2020-02-21 00:51:03 -05:00
Matthias Clasen
4098653974 Update the focus test
This needs an update to handle the new focus-change signal.
2020-02-21 00:51:03 -05:00
Matthias Clasen
4cf63f3eb3 wip: Use event constructors in the testsuite
This doesn't work because the constructors aren't exported,
so remove the gestures text temporarily, until we figure
out how to deal with it.
2020-02-21 00:40:52 -05:00
Matthias Clasen
9330158f11 Make a11y testsuite pass 2020-02-21 00:39:12 -05:00
Timm Bäder
5097c1defc Merge branch 'file-filter-name-property' into 'master'
GtkFileFilter: Add a GObject property for the name

See merge request GNOME/gtk!376
2020-02-19 07:43:51 +00:00
Matthias Clasen
66307f00f1 icontheme: Update the api
Add properties, and use string arrays instead of lists.

Among other things, this renames gtk_icon_theme_list_icons
to gtk_icon_theme_get_icon_names.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2410
2020-02-18 20:32:17 -05:00
Matthias Clasen
723b894c19 testsuite: Stop using gdk_surface_new_temp
We can just use regular toplevels here.
2020-02-14 21:19:29 +01:00
Benjamin Otte
222e6e5d6e testsuite: Use GtkTextDirection instead of GtkWindowType
GtkWindowType is aout to be dropped, so use another enum for the enum
tests - one that is likely to survive for a long time.
2020-02-14 21:18:49 +01:00
Benjamin Otte
a278edab22 window: Remove type argument from gtk_window_new() 2020-02-14 21:18:49 +01:00
Benjamin Otte
c2bd4bc3cb testsuite: Replace popups with toplevels
The tests do not depend on the window being a popup.
2020-02-14 21:18:49 +01:00
Benjamin Otte
fb856d96cd builder: Use different construct-only property
The window type is going away, so use the css name instead.
2020-02-14 21:18:49 +01:00
Benjamin Otte
ad23ce23ad testsuite: Remove popup property from simplify tools
I'm not even sure a popup GtkAssistant should be a thing...
2020-02-14 21:18:49 +01:00
Benjamin Otte
41bdf16b23 testsuite: Turn all CSS test ui files into regular windows
Use undecorated windows instead of popups.
2020-02-14 21:18:49 +01:00
Benjamin Otte
2c843362a0 testsuite: Make a11y tests use regular windows 2020-02-14 21:18:49 +01:00
Benjamin Otte
980934f82d reftests: Change popup windows to non-decorated windows
This allows getting rid of popup windows.
2020-02-14 17:54:38 +01:00
Benjamin Otte
d303b5b0eb slicelistmodel: Fix two wrong computations
Both of those are thinkos during math.
Found by Mohammed Sadiq.

Testcases triggering both have been added.
2020-02-14 03:15:22 +01:00
Matthias Clasen
cdee2ac173 testsuite: Handle icontheme test better
Skip just the failing tests in release builds.
2020-02-13 10:56:26 -05:00
Matthias Clasen
47f2a6cafd Remove border-half-pixel reftest from xfail
It passes both locally and on ci now.
2020-02-13 09:39:27 -05:00
Benjamin Otte
75b130ed6b testsuite: Add tests for rounded rect code
... including the bug that was fixed in the parent commit.
2020-02-13 07:36:38 +01:00
Benjamin Otte
16e38701b6 testsuite: Don't use gdk_cairo_get_clip_rectangle()
I want to remove it.
2020-02-13 06:15:44 +01:00
Benjamin Otte
9d8ceb0cb2 testsuite: Don't destroy surfaces that are still used
Coercing the surfaces must not unref the old surface, because the old
surface is going to be saved to a file.
2020-02-13 06:15:44 +01:00
Benjamin Otte
c313a71c3a testsuite: Remove accidentally checked in file
This file should go in the listview branch I guess.
2020-02-13 06:14:05 +01:00
Matthias Clasen
e1d85aeeb0 testsuite: Warn if a necessary env var is missing
Better to warn if we know why the tests are
going to fail. Saves headscratching later.
2020-02-12 12:18:59 -05:00
Matthias Clasen
cc8506ca15 Move performance tests to the right testsuite
This was a copy-paste error.
2020-02-12 12:18:59 -05:00
Emmanuele Bassi
b99a4da939 testsuite/gtk: Add xfail tests
Some tests are expected to fail.

Some tests are expected to fail in non-debugging builds.

The icontheme test is the latter.
2020-02-11 14:53:57 +00:00
Matthias Clasen
7ac2982617 Revert "Add the label-wrap-justify reftest to xfails"
This reverts commit 5e746d35b2.

Turns out label-wrap-justify isn't failing in ci, and this is
now making ci fail :(
2020-02-11 07:44:01 -05:00
Matthias Clasen
5e746d35b2 Add the label-wrap-justify reftest to xfails
Seems just like the other label tests, down to details
of text rendering.
2020-02-10 15:19:13 -05:00
Matthias Clasen
d711ca3a67 Drop the toplevel-vs-popup reftest
Popups look different from toplevels. I don't think
a reftest that tries to prove otherwise has much
leg to stand on.
2020-02-10 15:15:05 -05:00
Matthias Clasen
564a43cd3a Disable the buttons a11y test
The test fails because radio buttons are currently broken.
2020-02-10 15:06:56 -05:00
Matthias Clasen
17a5e9b2aa Update expected test output
The a11y test for GtkAssistant produces different
output due to headerbar changes.
2020-02-10 15:03:47 -05:00
Matthias Clasen
0677bfeb7f testsuite: Update expected output
The output for combo boxes in a11y tests has changed
because they use popovers now.
2020-02-10 13:55:37 -05:00
Alexander Larsson
7d23b6dad5 Fix gestures test
This tests was testing gestures by faking an event in the
middle of a window that has a hbox with an expanding image in it.
For me (and I guess this depends on all sorts of issues like whether
CSD is enabled, font sizes, etc) the hbox ended up centered horizontally
but not vertically (probably because of csd at the top), so no events
ever hit the inner widgets.

This is fixed by emitting the events at allocation.x/y of the
hbox, which should contain both the hbox and the image (as it expands).
2020-02-10 16:24:03 +01:00
Matthias Clasen
59b935af38 Merge branch 'mainloop-cleanup' into 'master'
Mainloop cleanup

See merge request GNOME/gtk!1404
2020-02-10 14:32:09 +00:00
Alexander Larsson
1698369d52 Merge branch 'icon-theme-api-rework' into 'master'
Icon theme api rework

See merge request GNOME/gtk!1390
2020-02-10 12:45:56 +00:00
Alexander Larsson
ad0e901061 icon-theme: Add back and fix test for handling non-square icons
We test this by looking at the produced render nodes now that
we don't actualluy scale the icon. Also, it turns out that this
code was broken due to some typos, so we also fix those.
2020-02-10 13:17:15 +01:00
Alexander Larsson
904eecd1ed icon paintable: Replace get_filename and get_resource_path with get_file()
This returns a GFile which can represent both the above.
2020-02-10 12:33:17 +01:00
Matthias Clasen
a8db322be6 Drop gtk_get_main_thread
This is not a very useful api, and if you need it,
you can just as easily keep track yourself which thread
called gtk_init().
2020-02-09 23:13:13 -05:00
Matthias Clasen
a6c5466900 Stop using gtk_main and gtk_main_quit
Replace these calls with direct use of GMainContext api.
2020-02-09 23:12:32 -05:00
Matthias Clasen
c789711652 Stop using gtk_main_quit
Stop using gtk_main and gtk_main_quit in tests and
examples. These APIs are on the way out.
2020-02-09 23:12:32 -05:00
Matthias Clasen
24917ac353 tests: Stop using gtk_events_pending
Just use the GMainContext api directly.
2020-02-09 23:11:49 -05:00
Matthias Clasen
ebc24d75af testsuite: Stop using gtk_main_do_event
Instead, emit ::event on the surface. Neither of
these is a proper test api, but one works as well
as the other.
2020-02-09 10:54:26 -05:00
Timm Bäder
01ba11fc71 css: Remove outline border radius properties
These are always set to the same value as the corresponding border
radius properties. They are also non-standard, so remove them and
replace them with the border radius properties everywhere.

Fixes #2414
2020-02-08 20:43:16 +01:00
Benjamin Otte
d72301b3c1 testsuite: Get rid of GtkToolbar
Just use GtkBox instead
2020-02-07 14:08:08 +01:00
Matthias Clasen
e45b668e04 testsuite: Misc. updates of expected output
The a11y dumps for action and header bars
have changed in harmless ways.
2020-02-06 18:04:36 -05:00
Matthias Clasen
048effdc5a testsuite: Clean up a11y menu tests
We don't need some of the tests anymore, since
we just have popovers now.
2020-02-06 17:21:06 -05:00