Commit Graph

64395 Commits

Author SHA1 Message Date
Carlos Garnacho
5f29b8fcec gdk: Drop GdkGrabOwnership
We no longer expose such low level tweaks, this is essentially
unused.
2020-06-23 23:42:53 +02:00
Carlos Garnacho
59a8106373 gdk: Drop supports_multidevice API
Crossing events are now detached from widget state, all tricky consequences
from getting multiple crossing events are now somewhat moot. Resort to sending
all generated crossing events, and drop this barely (ever?) used API.
2020-06-23 23:42:53 +02:00
Carlos Garnacho
c1d90273ca gdk: Drop GDK_SOURCE_ERASER
All tools come from devices with GDK_SOURCE_PEN.
2020-06-23 23:42:53 +02:00
Carlos Garnacho
31b95ce47f gtkmain: Look up transient-for hierarchies to determine modality
Windows that are not modal, but are transient-for a modal window should
still be able to receive and handle events. Inspect the window hierarchy
in those cases, so these windows are handled just like widgets within
the modal dialog.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2851
Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/2850
2020-06-23 23:42:53 +02:00
Carlos Garnacho
4fe608e423 gtkwidget: Cancel all gestures in other groups
When a gesture (group) claims a sequence, all other gesture groups
in the same widget should get cancelled. Not just previously claimed
ones, that shouldn't happen actually.
2020-06-23 23:42:53 +02:00
Matthias Clasen
2cfeb1048c Merge branch 'stringlist' into 'master'
add a public stringlist api

See merge request GNOME/gtk!2134
2020-06-23 20:43:49 +00:00
Matthias Clasen
e8210d5865 Add GtkStringList as public api
This is a list model holding strings, initialized
from a char **. String lists are buildable as well,
and that replaces the buildable support in GktDropDowns.
2020-06-23 16:11:46 -04:00
Matthias Clasen
fff981b220 Merge branch 'wip/jimmac/notebook-legibility' into 'master'
Adwaita: notebook legibility fixes

Closes #2652

See merge request GNOME/gtk!2142
2020-06-23 19:12:52 +00:00
Matthias Clasen
a3f4caa291 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2141
2020-06-23 19:10:54 +00:00
Jakub Steiner
ec54399d89 Adwaita: notebook legibility fixes
- make inactive tabs more legible

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2652
2020-06-23 19:54:54 +02:00
Matthias Clasen
83f22fcce2 Add a few missing includes
These sources are using GtkListStore apis,
but were replying on indirect includes to
get the header. Make this explicit, to prepare
for GtkEntryCompletion losing its tree view
dependencies.
2020-06-23 07:55:53 -04:00
Matthias Clasen
34a12f47f1 entry completion: Drop the Private struct
This is in preparation for porting GtkEntryCompletion
to use GtkListView.
2020-06-23 07:55:38 -04:00
Ray Strode
518462d882 Merge branch 'wip/fencing-without-context-is-discouraged' into 'master'
x11: Ensure bound context is compatible with sync fence

See merge request GNOME/gtk!2139
2020-06-23 09:53:35 +00:00
Ray Strode
1912513d7a x11: Ensure bound context is compatible with sync fence
Commit a0f6ff101e made sure that a
context was bound before calling glClientWaitSync, but it doesn't
check that the context shares objects with the context that created
the fence.

This commit does a little more validation before deciding the current
context is good enough.
2020-06-22 19:09:43 -04:00
Matthias Clasen
1643e81c47 Merge branch 'wip/fencing-without-context-is-discouraged' into 'master'
x11: ensure some context is bound before calling glClientWaitSync

See merge request GNOME/gtk!2138
2020-06-22 23:01:11 +00:00
Matthias Clasen
7ff427b456 Merge branch 'drop-entry-completion-actions' into 'master'
entrycompletion: Drop action support

See merge request GNOME/gtk!2136
2020-06-22 22:59:17 +00:00
Matthias Clasen
91a96d27f1 Merge branch 'matthiasc/for-master' into 'master'
Add a basic clipboard test

See merge request GNOME/gtk!2137
2020-06-22 22:13:30 +00:00
Ray Strode
a0f6ff101e x11: ensure some context is bound before calling glClientWaitSync
Since commit 972134abe4 we now call
glClientWaitSync for the vendor nvidia driver, to know when a frame
is ready for the compositor to process.

glClientWaitSync can be called regardless of which context is currently
bound, but if no context is bound at all, it returns 0 without
doing anything.

This commit checks for that edge case, and ensures a context gets
made current in the event no context is already current, before calling
glClientWaitSync.
2020-06-22 17:13:54 -04:00
Matthias Clasen
9bcf401ef7 Add a basic clipboard test
This is not reproducing the failure I'm after, unfortunately.
2020-06-22 16:55:01 -04:00
Matthias Clasen
67a7ad069f entrycompletion: Drop action support
This api has not really been kept up with current
user experiences in popups, and we're better off
just dropping it and letting people do their own
popups if they need custom UI.
2020-06-22 14:43:36 -04:00
Matthias Clasen
367d24be7f Merge branch 'keyval-to-uni-fix' into 'master'
gdk: Make gdk_keyval_to_unicode platform-independent

See merge request GNOME/gtk!2132
2020-06-22 18:13:25 +00:00
Matthias Clasen
1791c637d0 Merge branch 'fix-entry-completion' into 'master'
Fix entry completion

See merge request GNOME/gtk!2135
2020-06-22 17:56:43 +00:00
Matthias Clasen
c6fe8818ed gdk: Clarify the docs of gdk_keyval_to_unicode
Explicitly state that the conversion does not
take locale into account, and point out GDK_KEY_KP_Decimal
as a candidate for special-casing.
2020-06-22 13:24:34 -04:00
Matthias Clasen
53a30eaa12 entry completion: Make keynav work again
Use gtk_widget_prepend_controller to supersede entry keynav
while the popup is open. This fixes selecting completions
with the keyboard - the Enter keypress was ending up
triggering GtkText::activate instead of inserting the
selected completion into the entry.
2020-06-22 12:48:42 -04:00
Matthias Clasen
692cc42e10 Add gtk_widget_prepend_controller
Add a variant of gtk_widget_add_controller that
inserts the controller at the beginning, instead
of the end. This will be used in entry completion
to make sure the entry completion key event handling
supersedes the entry one while the popup is open.

Keep this private for now, until we determine if
it needs to be public api.
2020-06-22 12:47:27 -04:00
Matthias Clasen
9faaa5e8be Fix change notification for event controllers
We were adding event controllers at the end, but
announcing a change at the beginning, in
gtk_widget_add_controller. Fix that by emitting
::items-changed for the position where we actually
inserted the controller.
2020-06-22 12:46:12 -04:00
Matthias Clasen
418bbb2685 entrycompletion: Name the controllers
This helps with debugging.
2020-06-22 12:31:15 -04:00
Matthias Clasen
fb148027d9 Merge branch 'wip/dont-assert-without-evidence' into 'master'
x11: be more verbose when glClientWaitSync behaves unexpectedtly

See merge request GNOME/gtk!2133
2020-06-22 15:47:27 +00:00
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
Matthias Clasen
2df139cf40 gdk: Make gdk_keyval_to_unicode platform-independent
The result of gdk_keyval_to_unicode should not depend
on the platform.
2020-06-22 08:31:10 -04: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