Commit Graph

2642 Commits

Author SHA1 Message Date
Robert Mader
77e0d83000 gtk: Properly calculate device offset for DnD
We need to take the device scale into account, like it is done in
gdkwindow.c.

This fixes wrongly placed DnD surfaces in scaled contexts on X11
as well as Wayland.
2019-09-23 11:50:05 +02:00
Christoph Reiter
d52dad2042 autotools: dist all meson related build files 2019-04-11 16:45:36 +02:00
Chun-wei Fan
0e24d35e3b tests/: Declare variables at the top-of-block
This will ensure that the code will build for pre-C99 compilers.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
92206fe23b tests/animated-resizing.c: Include gtk/fallback-c89.c
This is to ensure that compilers that do not have round() in math.h can
still build the code.
2019-04-11 16:45:36 +02:00
Nirbheek Chauhan
ead77a4628 meson: Cleanup tests and gdk testsuite 2019-04-11 16:45:36 +02:00
Chun-wei Fan
8caa937739 tests: Include system headers appropriately
Don't include unistd.h on Windows, and include the appropriate headers on
Windows as necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2019-04-11 16:40:33 +02:00
Nirbheek Chauhan
8ec004cc08 Import meson build files from an 3.22
Specifically, from 6dd6660c68
2019-04-11 16:40:33 +02:00
Emmanuele Bassi
bfcd062e8e Use GLSL 3.30 shaders
We currently ask for anything above 3.2 GL contexts, but we're still
using GLSL 1.50 shaders all over the place. If a GL driver supports GL
3.2+ and GLSL 1.50 only then we'd be in trouble, but the chances of that
happening are really small.
2019-03-27 16:03:43 +00:00
Iain Lane
882c81dab2 Fix -Wincompatible-pointer-types warnings 2019-01-23 12:18:18 +00:00
Daniel Boles
ee5873be19 testrevealer: Make filler text actually big enough
…to do what it says it does, i.e. avoid the window expanding/shifting as
e.g. the leftmost entry is revealed.

noticed during https://gitlab.gnome.org/GNOME/gtk/issues/1057
2018-12-18 21:00:08 +00:00
Yi-Soo An
db7f085315 tests/animated-resizing: Remove deprecated functions
The functions as below are deprecated
- gdk_screen_get_monitor_geometry
- gdk_screen_get_primary_monitor

Instead of them, use functions below
- gdk_monitor_get_geometry
- gdk_display_get_primary_monitor
2018-07-20 15:42:26 +09:00
Daniel Boles
af350b20b1 testentrycompletion: Avoid a compiler cast warning
Instead of getting the model again but then forgetting to cast it to a
ListStore, just use the other variable store where we already did both.
2018-04-24 13:43:18 +01:00
Daniel Boles
7a75b89efe testmodelbutton: Test :centered, :icon, :inverted
Test more stuff.
2018-04-08 18:49:26 +01:00
Daniel Boles
b7e5a2dd10 testmodelbutton: Fix wrongly overridding MB child
I was setting a GtkButton:label, which resulted in the ModelButton's own
custom children getting lost. That doesn't make for a useful test...

https://gitlab.gnome.org/GNOME/gtk/issues/163#note_94842
2018-04-08 18:49:19 +01:00
Daniel Boles
e6e306ae8e testmodelbutton: Add explanatory comments to CSS
and load at an earlier, more sensible place, before creating any widgets
2018-04-08 16:07:35 +01:00
Daniel Boles
e193cd1cf1 tests/testmodelbutton: Add this
and test whether :action-name, :role, and CSS nodes work as expected

https://gitlab.gnome.org/GNOME/gtk/issues/163
2018-04-08 13:16:30 +01:00
Daniel Boles
fcfabb2fd3 testspinbutton: Add button to toggle wrap on Spins
I found myself wanting to test this for something else, so let's test
it. It revealed a bug immediately!

https://gitlab.gnome.org/GNOME/gtk/issues/88
2018-03-14 23:09:08 +00:00
Daniel Boles
bb16f1a0ff testspinbutton: Orient box orthogonally to Spins
This makes better use of space.
2018-03-14 23:00:59 +00:00
Daniel Boles
cbb22b2916 testinfobar: Test more properties, response signal
Also test :message-type, :show-close-button, and ::response.
2018-03-12 19:00:20 +00:00
Daniel Boles
6b4d95e86d testinfobar: Add simple test of :visible/:revealed
This exists merely to prove that, having added :revealed, show() and
hide() now work reliably, as does set_revealed() for the animated case.

https://bugzilla.gnome.org/show_bug.cgi?id=710888
2018-03-12 15:30:49 +00:00
Kalev Lember
60750b3ffd tests: Don't add testswitch twice in Makefile.am 2018-01-27 14:49:34 +01:00
Arnaud Bonatti
01c349995c Add test for GtkActionable GtkListBoxRow.
https://bugzilla.gnome.org/show_bug.cgi?id=741633
2018-01-02 17:53:20 -08:00
Matthias Clasen
ed0600e8c0 tests: Stop using gtk_font_button_get_font_name
We can instead use the GtkFontChooser::font property.
2017-12-21 11:13:08 -05:00
Daniel Boles
30effaf7fc testmenubutton: Fix inverted keynav in the GtkMenu
GtkMenu’s own keynav code, which actually bothers to account for the
layout of items, only happens if columns > 1. So, adding items to 1
column using a reverse loop meant they were placed in the Menu’s list of
children in that order, and because we only have 1 column, Menu passes
keynav up to MenuShell, which doesn’t adjust for the items’ positions.

‘Fix’ that here by adding items in the same order they’ll have when laid
out in the Menu, so keynav does what you’d expect, not the opposite. For
that, it’s simpler just to use gtk_container_add().

Let’s presume users are using add(), attach() with a non-inverted loop,
or attach() with arguments that create 2+ columns and so GtkMenu keynav.
2017-10-08 13:15:33 +01:00
Daniel Boles
3783934436 testcombo: Test grid :row- and :column-span-column
Ditch two items that were white and so weren’t visible on our standard
theme anyway, and use the new space to test extra grid-mode properties.

Note that if we do this then, as before, we set the ListStore on the
ComboBox before appending to it, that produced runtime warnings like:

Gtk-CRITICAL **: gtk_menu_attach: assertion 'left_attach < right_attach' failed

I didn’t look into that yet, but it may indicate that attaching items
vs. recognising their spans don’t occur in the correct order. For the
purposes of testing this, I just create the CB after filling its model.
2017-10-04 11:04:52 +01:00
Timm Bäder
87e76c12a9 testgtk: fix css 2017-09-03 12:20:13 +01:00
Daniel Boles
b1705523bb testgtk: Remove an unused variable 2017-08-27 15:36:13 +01:00
Daniel Boles
3a2c379f3c testpopover: Use HeaderBar to get CSD decorations
This helps test whether the Popover positioning gets messed up by the
presence of CSD shadow or other accessories around the content area.

https://bugzilla.gnome.org/show_bug.cgi?id=786209
2017-08-24 20:57:00 +01:00
Daniel Boles
1efbcb0f82 testpopover: Sync initial vals of controls & props
The ComboBoxes were initially empty, rather than reflecting the initial
values of the properties. The CheckButtons were only correct by chance.
Fix this by setting the initial values on the widgets and binding them
to the properties using SYNC_CREATE, so the two are always synced up.

https://bugzilla.gnome.org/show_bug.cgi?id=786209
2017-08-14 23:17:14 +01:00
Daniel Boles
ad06a08b99 testentryicons: Set tooltips on all icons
Just to test tooltips in all cases; what was already here
should have been sufficient, but this doesn't hurt.

While here, also add some instructive placeholder text.

https://bugzilla.gnome.org/show_bug.cgi?id=780938
2017-07-31 20:05:11 +01:00
Tom Schoonjans
626ac112f0 testgtk.c: native file chooser filter changes
Set the filter before showing the dialog
Afterwards, fetch the last active filter and display its name.

https://bugzilla.gnome.org/show_bug.cgi?id=784723
2017-07-18 13:48:13 -04:00
Matthias Clasen
6b3f2131c5 Redo the listbox dnd example
Rewrite this example to have better drag highlighting.
2017-05-31 21:15:34 -04:00
Jonas Ådahl
e5ed52b6c9 tests: Add testforeign
Add a test for exporting a handle. There are no GTK+ API for this, but
only per backend GDK API, and so far only Wayland is supported. There
is a private GdkWindow API but it's not exposed externally.

https://bugzilla.gnome.org/show_bug.cgi?id=782325
2017-05-23 09:39:29 +08:00
Emmanuele Bassi
d237b255f9 build: Remove unused rules
The foreign drawing example was moved to the GTK demos.
2017-05-09 14:19:51 +01:00
Matthias Clasen
ae6f95878e testlist3: Handle dropping a row onto itself
Instead of spewing criticals, we should handle this
gracefully by doing nothing.
2017-04-22 21:39:10 -04:00
Matthias Clasen
7ab48458a0 Refine the listbox dnd example
Add a drag handle, and demonstrate broken offsets.
2017-04-22 08:07:42 -04:00
Matthias Clasen
930acacf94 Implement dnd for list box rows in an example
This shows very basic DND of list box rows.
2017-04-21 17:02:05 -04:00
Matthias Clasen
12155b4ee3 Avoid redefining GNU_SOURCE
Gives a compiler warning with the wrong flags.
2017-03-26 15:05:27 +01:00
Philip Withnall
c00448f7c6 tests: Fix use of C99 inline declaration
We don’t claim to use them yet, even if we perhaps should.
2017-03-07 09:48:44 +00:00
Daniel Boles
5bdc85d34e testheightforwidth: cleanups 2017-03-07 09:17:29 +00:00
Daniel Boles
5f24d87a5b testframe: Don’t unnecessarily query the padding
The [hv]padding variables control and hence track this.
Also, simplify the CSS using shorthand 2-value notation (again).
2017-03-07 01:32:24 +00:00
Daniel Boles
ec30a03153 testframe: Actually set the padding
The CSS was targeting node GtkFrame, which is wrong: it is called frame.

This commit also assumes the interesting padding is that between the
border and the child widget, not the padding around the entire Frame.
Some additional hoops must be jumped through to preserve padding values
not being changed in either callback. However, the way this is done
means I must set the initial paddings to 0, which simplifies main().
2017-03-07 01:04:34 +00:00
Daniel Boles
685493075f testframe: Add CheckButton to toggle border off/on
We should test this.
2017-03-07 01:04:34 +00:00
Daniel Boles
39d5f22774 testframe: Order controls better & improve labels
The :label-widget is drawn before the child, so put the controls that
set the alignment of the :label-widget before those that pad the child.

We set (horizontal|vertical) padding, not "[xy]thickness". Also change
to "label [xy]align" & use grid spacing, not spaces at end of Labels.
2017-03-07 01:04:34 +00:00
Daniel Boles
9f1916f29e testframe: Minimise typecasts 2017-03-07 01:02:08 +00:00
Daniel Boles
5059348d9f testframe: Set value before connecting callbacks
The value comes from the widget, and we were setting this after
connecting the callback, which applies the value to the widget…
2017-03-07 01:02:08 +00:00
Daniel Boles
4bec5432ce testframe: Use a generic widget pointer 2017-03-07 01:02:08 +00:00
Daniel Boles
0349574b47 testheightforwidth: Add missing unref 2017-03-06 20:57:17 +00:00
Daniel Boles
77f01c374b testheightforwidth: Remove deprecations & clean up
cherry-pick of master commit bf0ea7b7bc
2017-03-06 20:50:33 +00:00
Daniel Boles
ccba2eaace Remove executable bit from C source files in tests 2017-01-19 00:17:40 +00:00