Commit Graph

73286 Commits

Author SHA1 Message Date
José Expósito
6ebb38e12e gdk/events: Set discrete scroll deltas in its constructor
Instead of calculating the discrete scroll deltas in
GtkEventControllerScroll, move that code to the event constructor and
access the precalculated values using gdk_scroll_event_get_deltas.

Refactor, no functional changes.
2022-08-10 14:23:58 +00:00
José Expósito
51ca454eef gdk/events: Add constructor for high-resolution scroll events
Starting with Linux Kernel v5.0 two new axes are available for
mice that support high-resolution wheel scrolling: REL_WHEEL_HI_RES and
REL_HWHEEL_HI_RES.

Both axes send data in fractions of 120 where each multiple of 120
amounts to one logical scroll event. Fractions of 120 indicate a wheel
movement less than one detent.

The 120 magic number is a copy of the Windows API, so this new
constructor can be used both in Linux >= 5.0 and Windows >= Vista.
2022-08-10 14:23:58 +00:00
José Expósito
fb100d719f build: Update Wayland to >= 1.21.0 2022-08-10 14:23:58 +00:00
Jordi Mas
cf1974f6b1 Update Catalan translation 2022-08-10 14:27:44 +02:00
Emmanuele Bassi
3f4a0aa1f3 Merge branch 'rounded-clip-node-new-transfer-full' into 'main'
Mark gsk_rounded_clip_node_new() return value as (transfer full)

See merge request GNOME/gtk!4941
2022-08-10 09:23:02 +00:00
Sebastian Dröge
0cc2d5559b Mark gsk_rounded_clip_node_new() return value as (transfer full)
Like all the other constructors for nodes already do. Without this,
newly created rounded clip nodes are leaked in bindings.
2022-08-10 11:07:51 +03:00
Carlos Garnacho
378ae4fbc1 Merge branch 'gbsneto/paned-focus-infloop' into 'main'
paned: Protect against NULL variable

Closes #5094

See merge request GNOME/gtk!4938
2022-08-09 18:26:48 +00:00
Matthias Clasen
00f079d705 Merge branch 'wip/carlosg/fix-crossing-on-unmap' into 'main'
gtkwindow: Use pointer-oriented function to deal with crossing events

Closes #5094

See merge request GNOME/gtk!4937
2022-08-09 18:15:41 +00:00
Carlos Garnacho
54465adff2 gtkwindow: Use pointer-oriented function to deal with crossing events
Commit adba0b97 fixed missed pointer crossings by using a helper function that
was already present and looked like did everything that was needed. However
this function was oriented to keyboard focus and it also did update the related
widget state. Doing these changes on pointer-based crossing was misuse, and
could cause weird interactions with keyboard focus management.

Fix this by using gtkmain.c gtk_synthesize_crossing_event() that is in fact
oriented to pointers.

Fixes: adba0b97 (gtkwindow: Synthesize pointer crossing events on state changes)
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5094
2022-08-09 19:48:15 +02:00
Georges Basile Stavracas Neto
29580d4252 paned: Warn if child is not actually a child
This will at least allow us to debug this in the future.
2022-08-09 14:20:25 -03:00
Carlos Garnacho
25c3616a79 gtkmain: Pass coordinates when synthesizing pointer events
Instead of passing an event and figuring out coordinates from it, pass
directly the toplevel coordinates so that we can use this outside event
handling.

All callers have been updated to pass the coordinates, in practical effects
they were already based on the GtkNative.
2022-08-09 19:13:28 +02:00
Georges Basile Stavracas Neto
120399cc92 paned: Protect against NULL variable
The inner loop in gtk_paned_set_focus_child() tries to find the
topmost GtkPaned, however, if the `w` variable ends up becoming
NULL after bubbling up the entire GtkWidget hierarchy, this loop
never breaks.

Check for NULL in this loop.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/5094
2022-08-09 13:59:09 -03:00
Kukuh Syafaat
86e5ad85b7 Update Indonesian translation 2022-08-09 02:12:09 +00:00
Quentin PAGÈS
04ad5e8936 Update Occitan translation 2022-08-08 20:49:35 +00:00
Carlos Garnacho
9691a11076 Merge branch 'wip/exalm/multiplier' into 'main'
scrolledwindow: Lower the scroll multiplier

See merge request GNOME/gtk!4933
2022-08-08 12:00:15 +00:00
Daniel Mustieles
fef3ab0b62 Updated Spanish translation 2022-08-08 12:42:06 +02:00
Alexander Mikhaylenko
493660a296 scrolledwindow: Lower the scroll multiplier
c68247f63b introduced a scroll multiplier,
intended to be significantly lower than the GTK 4.6 behavior but higher
than 1. However, it was _higher_ than 4.6, since 4.6 also had a permanent
1/10 multiplier in GDK, so the cited multiplier values were really 6.4 and
9.7.
2022-08-08 00:07:36 +04:00
Matthias Clasen
73f634435a Merge branch 'build-fix-glib-2.66' into 'main'
build: fix for use with glib 2.66.0 (2nd try)

See merge request GNOME/gtk!4932
2022-08-07 19:09:04 +00:00
Matthias Clasen
b17bba4af2 Merge branch 'wip/carlosg/scroll-overshoot' into 'main'
gtk/scrolledwindow: Check for overshoot setting up kinetic scroll helpers

Closes #4784

See merge request GNOME/gtk!4909
2022-08-07 19:01:25 +00:00
Emmanuele Bassi
ba1a084899 Apply 1 suggestion(s) to 1 file(s) 2022-08-07 18:54:19 +00:00
Carlos Garnacho
0e5a97ae58 gtk/scrolledwindow: Check for overshoot setting up kinetic scroll helpers
We may have situations where velocity is 0/0, but are overshooting. Places where
this happens are mouse wheels, and continuous scroll that ended up still before
finish. In this situation we also want to run the animation for overshoot, so
check for the corresponding axes to also set up the kinetic scroll helper.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4784
2022-08-07 20:26:52 +02:00
Matthias Clasen
7a306fe32f Merge branch 'wip/carlosg/fixes' into 'main'
Some fixes

Closes #2877 and #5003

See merge request GNOME/gtk!4929
2022-08-07 18:06:28 +00:00
Emmanuele Bassi
ac7009d56c Merge branch 'clipboard-seg2' into 'main'
x11: Don't assume valid type

See merge request GNOME/gtk!4912
2022-08-07 16:21:40 +00:00
Carlos Garnacho
c68247f63b gtkscrolledwindow: Add fixed multiplier to scroll events in surface units
The expected configurability is not going to arrive yet from compositors, and
it is precipitate for GTK to gain any configurability. We do know a factor of 1
feels way too slow, and we do know a factor of page_size * pow (2 / 3) feels way
way too fast.

With the previous multiplier, gtk4-demo at its default size had a vertical textview
factor of 64.332901, and maximized on a 1920x1080 screen a factor of 97.585365.
Pick a magic multiplier that is both significantly below these values and above 1,
and stick to it.

Future work will add the configurability of smooth scroll events where it belongs.
At that point this commit may be reverted so we don't pile up on magic numbers again.

Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/4793
2022-08-07 17:16:14 +02:00
Asier Sarasua Garmendia
668a2c0f3e Update Basque translation 2022-08-07 09:49:00 +00:00
Hugo Carvalho
c435c7e764 Update Portuguese translation 2022-08-06 23:01:57 +00:00
Danial Behzadi
4d36a4ebd7 Update Persian translation 2022-08-06 22:43:23 +00:00
Hannes Müller
703fc51d8e build: fix for use with glib 2.66.0
Add missing #define g_memdup2() for gdksurface-broadway.c in case of enabled
broadway-backend as used otherwise.

Copy static would_drop() replacement for g_log_writer_default_would_drop()
from gtk-builder-tool.c to gtk-reftest.c
2022-08-06 21:11:08 +02:00
Aleksandr Melman
fb008578b4 Update Russian translation 2022-08-06 14:44:53 +00:00
Carlos Garnacho
adba0b972e gtkwindow: Synthesize pointer crossing events on state changes
When widgets go mapped/unmapped, we repick but don't generate crossing
events. Since there could be stateful controllers that use those in
the previously picked widget (e.g. GtkEventControllerMotion), skipping
those breaks their state.

Ensure to send the relevant crossing events on every situation that
changes the pointer focus, so these controllers get a fair opportunity
to undo their state.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2877
2022-08-05 19:25:13 +02:00
Carlos Garnacho
c77b98d716 gdk/wayland: Drop surface checks on wl_pointer.leave handling
Even though the argument is non-nullable, GTK sometimes incurs in that
by itself by destroying the surface while the event is in flight. This
is the case of popping down a GtkDropdown. When this happens we simply
ignore the crossing event, but we should let it through instead, the
compositor did not send it in vain and we possibly still have pointer
state to undo.

Drop the surface checks, so that the event is propagated along GTK.
2022-08-05 19:25:13 +02:00
Carlos Garnacho
8eda182f24 gtkeventcontroller: Fix internal enum documentation
Copy and paste typo.
2022-08-05 19:25:13 +02:00
Carlos Garnacho
15e0c175a3 gtkgesturerotate: Filter touchpad holds events
Since the pinch touchpad gestures already have begin/update/end phases,
this gesture has no actual use for these events.
2022-08-05 19:25:13 +02:00
Carlos Garnacho
bc953eebdd gtkgesturerotate: Filter touchpad holds events
Since the pinch touchpad gestures already have begin/update/end phases,
this gesture has no actual use for these events.
2022-08-05 19:25:13 +02:00
Carlos Garnacho
6238f97cb6 gdkevent: Give touchpad hold events a sequence
Following what was done for pinch/swipe events, give hold gestures their
own distinct sequence as well. Without this it was NULL, which was already
distinct to other touchpad gestures.
2022-08-05 19:25:13 +02:00
Carlos Garnacho
023924bca9 gtkgesture: Do not coalesce hold events with other touchpad gestures
This delaying of the cancel event was made to avoid intermediate cancellation
for >=2fg hold gestures followed by pinch/swipe gestures, and it worked as
long as everything was considered to have the same sequence.

Since each pinch/swipe pointer gesture now gets its own sequence, this no
longer applies, nor works. This results in zoom/rotate/swipe gestures being
stuck since the sequence for the touchpad events changes mid-gesture.

Sticking to this pattern of giving touchpad gestures their own sequence,
these hold events cannot be assumed to coalesce with other touchpad gestures,
it is better to let it propagate altogether so that both the hold gesture
and the incoming gesture trigger coherent begin and end/cancel phases.

In the worst case, this results in "::begin, ::cancel, ::begin , ..." before
triggering a touchpad gesture, but the extra begin/cancel ought to be a safe
no-op in widgets.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5003
2022-08-05 19:25:13 +02:00
Matthias Clasen
af6432aa67 Merge branch 'ebassi/textbuffer-private-api' into 'main'
Move private function out of the AT-SPI a11y backend

See merge request GNOME/gtk!4924
2022-08-05 12:01:27 +00:00
Emmanuele Bassi
6c37158bbc Re-enable the TextBuffer wrap-mode serialization test
The private serialization function is now available on all platforms.
2022-08-04 23:39:54 +01:00
Emmanuele Bassi
d030c92d63 Move private function out of the AT-SPI a11y backend
The textbuffer test is calling into a function defined by the AT-SPI
accessibility backend. As of commit 4ddf1b70 we only build and run the
test on Linux, but the function in question isn't really
accessibility-related: it's just a serialization function.
2022-08-04 23:34:41 +01:00
Yuri Chornoivan
a07ee709d2 Update Ukrainian translation 2022-08-04 14:33:50 +00:00
Matthias Clasen
60b77736b5 Merge branch 'cleanup-ffmpeg' into 'main'
ffmpeg: add audio playback through avdevice

See merge request GNOME/gtk!4852
2022-08-04 10:49:45 +00:00
Stephan Vedder
83ff85d227 ffmpeg: add audio playback through avdevice 2022-08-04 10:49:44 +00:00
Matthias Clasen
f7b3a214f3 Merge branch 'mount_operation' into 'main'
mountoperation: Fix authentication dialog

Closes #5059 and #5058

See merge request GNOME/gtk!4899
2022-08-03 11:56:25 +00:00
Matthias Clasen
c1053096bd Merge branch 'win32-nahimic-nv-notes' into 'main'
running.md: Mention about issue with Nahimic on Windows

Closes #4113

See merge request GNOME/gtk!4915
2022-08-02 11:10:25 +00:00
Chun-wei Fan
f2b85fa1c7 running.md: Mention about issue with Nahimic on Windows
Let people know that they will need to use GTK with the Nahimic service
disabled or OpenGL disabled or put their GTK application into the Nahimic
backlist, or try to use GLES, since there is a known issue in the Windows
nVidia graphics drivers and Nahimic that causes GL operations to fail,
causing crashes in operations such as window resizes.

This will close issue #4113--sadly, there is nothing we can do within
GTK to fix the issue.
2022-08-02 13:50:49 +08:00
Matthias Clasen
a48942bf39 Merge branch 'label-tabs' into 'main'
Label tabs

See merge request GNOME/gtk!4914
2022-08-02 00:18:44 +00:00
Benjamin Otte
c1d6160bd4 Merge branch 'otte-main-patch-86462' into 'main'
Fix g_object_new(GTK_TYPE_SNAPSHOT)

See merge request GNOME/gtk!4919
2022-08-01 20:47:12 +00:00
Benjamin Otte
dbab69c453 snapshot: Don't critical on dispose
When there's remaining state that draws nothing, it returns no
rendernode. So do a NULL-check before unreffing it.
2022-08-01 20:28:46 +00:00
Benjamin Otte
09f0c96b9b Fix g_object_new(GTK_TYPE_SNAPSHOT)
GJS apparent likes g_object_new() over actual constructors, so make that work.
2022-08-01 20:08:58 +00:00
Matthias Clasen
641a589734 Add GtkLabel:tabs
This adds more powerful formatting capabilities to GtkLabel
without costing us much, since Pango already supports tabs.
2022-08-01 08:20:05 -04:00