Commit Graph

64216 Commits

Author SHA1 Message Date
Ray Strode
05736afaf8 x11: be more verbose when glClientWaitSync behaves unexpectedtly
When given a 0 timeout, glClientWaitSync is only supposed to return one
of three possible values:

 - GL_ALREADY_SIGNALED - fence fired
 - GL_WAIT_FAILED - there was an error
 - GL_TIMEOUT_EXPIRED - fence hasn't fired yet

In addition, it can also return GL_CONDITION_SATISFIED if a non-zero
timeout is passed, and the fence fires while waiting on the timeout.

Since commit 972134abe4 we now call
glClientWaitSync (with a 0 timeout), but one user is reporting it's
returning some value that's not one of the above four.

This commit changes the g_assert to a g_error so we can see what
value is getting returned.

May help with https://gitlab.gnome.org/GNOME/gtk/-/issues/2858
2020-06-22 11:16:32 -04:00
Matthias Clasen
8a91d1d1ce Merge branch 'matthiasc/for-master' into 'master'
gtk-demo: Add a warning to the colors demo

See merge request GNOME/gtk!2131
2020-06-22 13:11:13 +00:00
Timm Bäder
9f1208b595 Merge branch 'master.msvc' into 'master'
demos: Fix builds against Visual Studio headers

See merge request GNOME/gtk!2130
2020-06-22 12:02:26 +00:00
Matthias Clasen
9fd3212241 gtk-demo: Add a warning to the colors demo
Explain that the big sizes cause lockups.
2020-06-22 07:43:47 -04:00
Chun-wei Fan
293f2e6b1c demos: Fix builds against Visual Studio headers
According to [1], '_timezone' is already used for a global variable in the
time.h system header that is supplied by Microsoft, so using that for our
variable name when we are including time.h either directly or indirectly
will cause trouble.

This renames such variables to '_tz' to avoid that

[1]: https://docs.microsoft.com/en-us/cpp/c-runtime-library/daylight-dstbias-timezone-and-tzname
2020-06-22 17:04:18 +08:00
Matthias Clasen
f83aa16f59 Merge branch 'port-icon-browser' into 'master'
Port icon browser

See merge request GNOME/gtk!2127
2020-06-22 00:09:00 +00:00
Matthias Clasen
c73dd9ecaf Merge branch 'matthiasc/for-master' into 'master'
filter: Make GtkEveryFilter buildable

See merge request GNOME/gtk!2125
2020-06-21 17:57:31 +00:00
Matthias Clasen
607f08e79b Port the icon browser to GtkGridView 2020-06-21 13:36:57 -04:00
Matthias Clasen
511e5f39fa filter: Make GtkEveryFilter buildable
Due to an oversight, when multi filters were split into
any and every, any ended up with the listmodel and buildable
implementations, and every didn't get any.

Move the implementations up.
2020-06-21 13:10:18 -04:00
Matthias Clasen
7d409dd2e0 Merge branch 'wip/otte/listview-colors' into 'master'
Improve listview-colors demo

See merge request GNOME/gtk!2123
2020-06-21 12:49:49 +00:00
Matthias Clasen
9b8c0f3c7f gtk-demo: Cosmetic improvement to the colors demo
Make the count label not jump around, as the model
is refilled.
2020-06-21 14:17:47 +02:00
Benjamin Otte
727a78a74f gtk-demo: Add an "Unsorted" option (and default to it)
Tests the previous commit and ensures that selecting 16M colors actually
works quickly (it does).
2020-06-21 14:17:47 +02:00
Benjamin Otte
a928ea6c57 sortlistmodel: Look at order
For now, we just look at SORT_ORDER_NONE to bypass any sorting.
2020-06-21 14:17:47 +02:00
Benjamin Otte
d3f7dea624 gtk-demo: Reinstate incremental filling
Do it via the new size setting on the color list.

Also add an option to set the maximum size of the color list that it'll
be filled to so rudimentary performance testing is possible.

Hint: Do not select 16777216.

This reinstates commit c16848c2bb683f7ddf51571aa5951f8a4a1ea622.
2020-06-21 14:17:47 +02:00
Benjamin Otte
456b7628ee gtk-demo: Allow color list to have any size
For now, limit it to 1<<12 so the sorters don't explode.
2020-06-21 14:17:47 +02:00
Benjamin Otte
f149beb474 gtk-demo: Add a permutation to compute colors from the position
This way, the colors are furthest apart at the start and fill up the
remaining spots towards the end.
2020-06-21 14:17:47 +02:00
Benjamin Otte
1b0451761a gtk-demo: Add custom listmodel for all true colors. 2020-06-21 14:17:47 +02:00
Benjamin Otte
1d26341b03 gtk-demo: Make colors demo contain all 16,777,216 colors
This makes it slightly slow, so not sure it should stay like this.
2020-06-21 14:17:47 +02:00
Benjamin Otte
8348a113c6 gtk-demo: Compute HSV values directly 2020-06-21 14:17:47 +02:00
Benjamin Otte
bfdede7acc Revert "gtk-demo: Make the colors demo populate incrementally"
This eases adding a bunch of follow-up features. After those features
have landed, this functionality will be readded.

This reverts commit a10340859d.
2020-06-21 14:17:47 +02:00
Benjamin Otte
70894b48af gtk-demo: Embed the RGBA value 2020-06-21 14:17:47 +02:00
Aurimas Černius
b0c6b282fd Updated Lithuanian translation 2020-06-21 14:47:05 +03:00
Piotr Drąg
393054dd3f Update Polish translation 2020-06-21 11:37:46 +02:00
Matthias Clasen
97b10df723 Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

See merge request GNOME/gtk!2122
2020-06-21 05:58:15 +00:00
Matthias Clasen
62b214ffdf filechooserwidget: Use gtk_drop_down_get_selected_item
This showed up as a test failure when we get NULL as
selected item and then try to unref it. Luckily
get_selected_item is transfer none, so we don't have
to worry about it.
2020-06-21 01:20:05 -04:00
Benjamin Otte
3549f43902 demo: Use GtkDropDown::selected-item 2020-06-21 02:23:46 +02:00
Benjamin Otte
45167d5c0d dropdown: emit notify for selected from the changed callback
Otherwise we don't emit it when the selection itself changes it - for
exaple because the model changed.
2020-06-21 02:23:46 +02:00
Matthias Clasen
0214b98c5e Merge branch 'matthiasc/for-master' into 'master'
misc listview scrolling fixes

See merge request GNOME/gtk!2119
2020-06-20 21:21:29 +00:00
Matthias Clasen
19c38158fc Merge branch 'incremental-colors' into 'master'
Incremental colors demo

See merge request GNOME/gtk!2121
2020-06-20 20:35:23 +00:00
Matthias Clasen
7ff35340ca Merge branch 'drop-down-selected-item' into 'master'
dropdown: Add GtkDropDown:selected-item

Closes #2861

See merge request GNOME/gtk!2120
2020-06-20 18:51:18 +00:00
Matthias Clasen
a10340859d gtk-demo: Make the colors demo populate incrementally
Add a refill button that incrementally refills the color
demo. This is useful to test how the grid view operates
when the model is frequently changed.
2020-06-20 14:47:57 -04:00
Matthias Clasen
8475d88af0 gtk-demo: Clean up initial selection handling
We call selection_cb now, so we don't need to manually
do part of what that call does ahead of time.

This should have been noticed in 10bcbae68c.
2020-06-20 14:47:39 -04:00
Matthias Clasen
79b1d24128 Merge branch 'gtk4-arb_fbo' into 'master'
Switch to GL_ARB_framebuffer_object

See merge request GNOME/gtk!2079
2020-06-20 17:12:52 +00:00
Matthias Clasen
ad98e72884 dropdown: Add GtkDropDown:selected-item
This is the same readonly property we have in
GtkSingleSelection.

Fixes: #2861
2020-06-20 13:11:48 -04:00
Matthias Clasen
3fab2b55cc gtk-demo: Clean up memory handling in the weather demo
gtk_weather_info_new was consuming the info, but not
the timestamp, which confused me. Make it not consume
either, and be more explicit about where the unrefs
happen.
2020-06-20 12:18:17 -04:00
Matthias Clasen
2842030e59 gridview: Don't assert on a condition that can happen
We are currently not robust against model changes or
widget invalidations, so we can actually end up in
situations where we run out of items here. Handle
the failure a bit more gracefully, by returning NULL.

This is good enough to make scrolling work okish most
of the time. We still need a proper fix to handle
other situations.
2020-06-20 12:11:59 -04:00
Benjamin Otte
7c2d21892f gridview: Compute right amount of items to skip
We only want to skip the remaining items in the current row, not since
the start of the widget.
2020-06-20 12:08:46 -04:00
Matthias Clasen
677bfe6857 gtk-demo: Clean up initial selection handling
We call selection_cb now, so we don't need to manually
do part of what that call does ahead of time.

This should have been noticed in 10bcbae68c.
2020-06-20 08:48:29 -04:00
Matthias Clasen
b7ddf0b2e5 Merge branch 'dnd-demo-animation' into 'master'
gtk-demo: Add animated icons to the dnd demo

See merge request GNOME/gtk!2117
2020-06-19 23:57:47 +00:00
Matthias Clasen
eb25fc1d5a gtk-demo: Add animated icons to the dnd demo
This is to test animated drag icons.
2020-06-19 19:26:43 -04:00
Matthias Clasen
395d40485d Merge branch 'listview-dnd' into 'master'
Listview dnd

See merge request GNOME/gtk!2116
2020-06-19 22:24:36 +00:00
Matthias Clasen
17af979b24 testlistdnd: Use editable labels
Use editable labels instead of entries, and write
changes back to the model.
2020-06-19 16:30:25 -04:00
Matthias Clasen
8511f25b97 editablelabel: Allow to drag text
If we allow editing, we should allow direct drags too.
2020-06-19 15:26:53 -04:00
Matthias Clasen
290611f9ce editablelabel: Accept text drops
This seems natural. If we allow editing, we should
allow drops too.
2020-06-19 15:26:53 -04:00
Matthias Clasen
6280066207 testlistdnd: Add a tree
This lets us test auto-expand of tree expanders.
2020-06-19 15:26:47 -04:00
Matthias Clasen
f054c317ee expander: Remove a pointless return
GtkDropControllerMotion::enter does not expect
a boolean return value, so don't provide one.
2020-06-19 15:26:47 -04:00
Matthias Clasen
9555e611e1 treeexpander: Auto-expand during DND
When hovering over a tree expander during DND,
expand the tree after a timeout. This matches
the behavior of GtkTreeView and GtkExpander.
2020-06-19 15:26:47 -04:00
Matthias Clasen
5629ac3c63 Add a list dnd example
Add a test for dnd with listview, gridview and columnview.
2020-06-19 15:26:10 -04:00
Matthias Clasen
110c316810 columnview: Increase the autoscroll threshold
With autoscroll during DND, we stop when you hit the edge
of the widget, so a larger threshold makes sense to avoid
hitting the edge by accident.
2020-06-19 15:26:10 -04:00
Matthias Clasen
470a1aabdd columnview: Autoscroll during DND
Use a drop motion controller to autoscroll horizontally
while a drag operation is hovering over the list. The
vertical scrolling is handled by the listview.
2020-06-19 15:26:10 -04:00