Commit Graph

39430 Commits

Author SHA1 Message Date
José Expósito
fe86aa5f6b gtkgestureswipe: Don't filter hold events
Part-of: <!3454>
2022-01-26 22:49:53 +01:00
José Expósito
34133ec1e8 gtkgesturerotate: Don't filter hold events
Part-of: <!3454>
2022-01-26 22:49:53 +01:00
José Expósito
a99a75827c gtkgesturezoom: Don't filter hold events
Part-of: <!3454>
2022-01-26 22:49:53 +01:00
José Expósito
3bfcc12ec0 gtkgesture: Handle hold gestures
Hold gestures are used to bring existing gestures on touchpad
semantically closer to touchscreen gestures.

Touchpad gestures observe hold gestures with a matching amount of
fingers and emit their begin and end signals when fingers are detected
or removed on/from the touchpad.

When a hold cancel event is detected, it is required to wait a few
milliseconds until the next event(s) are received to avoid emitting
multiple begin signals.

Part-of: <!3454>
2022-01-26 22:49:53 +01:00
José Expósito
382341e1bf gtkgesture: Add hold to EVENT_IS_TOUCHPAD_GESTURE
Part-of: <!3454>
2022-01-26 22:49:53 +01:00
José Expósito
44b0d8b330 scrolledwindow: Stop kinetic scrolling on begin
Stop kinetic scrolling when a scroll begin signal is sent during the
event capture phase.

Part-of: <!3454>
2022-01-26 22:49:53 +01:00
José Expósito
62808722d2 kineticscrolling: Add stop function
Move the logic to stop kinetic scrolling to its own function and allow
to call it from the outside.

Part-of: <!3454>
2022-01-26 22:49:53 +01:00
José Expósito
f09338c8de gtkeventcontrollerscroll: Handle hold gestures
Handle hold events:

 - GDK_TOUCHPAD_GESTURE_PHASE_BEGIN: scroll-begin is emitted.
 - GDK_TOUCHPAD_GESTURE_PHASE_END: A hold gesture ends only when all
   fingers are lifted from the touchpad without movement, so
   scroll-end is emitted right away.
 - GDK_TOUCHPAD_GESTURE_PHASE_CANCEL: A hold gesture is cancelled when
   some fingers are lifted/put down or movement is detected. In this
   case, scroll-end is emitted after a small timeout only if
   GDK_SCROLL wasn't detected.

Part-of: <!3454>
2022-01-26 22:49:53 +01:00
José Expósito
ec91b2de10 gtkeventcontrollerscroll: Refactor scroll end
Move the logic to end scrolling to its own function to be able to
reuse it.

Refactor, no functional changes.

Part-of: <!3454>
2022-01-26 22:49:53 +01:00
José Expósito
5cd289dc1d gtkeventcontrollerscroll: Refactor scroll begin
Move the logic to begin scrolling to its own function to be able to
reuse it.

Refactor, no functional changes.

Part-of: <!3454>
2022-01-26 22:49:53 +01:00
José Expósito
0aa2a4ef14 gtkmain: Handle hold events
Part-of: <!3454>
2022-01-26 22:49:53 +01:00
Matthias Clasen
6f5210afea Merge branch 'wip/carlosg/touchpad-gesture-fixes' into 'main'
Touchpad gesture fixes

See merge request GNOME/gtk!4417
2022-01-26 19:32:33 +00:00
Matthias Clasen
6b1de35c01 Merge branch 'antoniof-main-patch-39484' into 'main'
gtkbitset: Define autocleanup function

See merge request GNOME/gtk!4416
2022-01-26 19:29:08 +00:00
Matthias Clasen
8fccfc7a3d Merge branch 'bilelmoussaoui/g-i' into 'main'
g-i: mark GtkSnapshot to_(node|paintable) as nullable

See merge request GNOME/gtk!4413
2022-01-26 19:19:42 +00:00
Carlos Garnacho
6fd3645713 gtk/gesture: Fix point info lookup on touchpad events
Since the addition of GdkEventSequence in touchpad events, these
are now stored in the gesture using that sequence. This bit of touchpad
gesture handling was however missing to be updated, still looking up
the special NULL sequence.

Use the last sequence here, which will be the one coming from touchpad
gesture events.
2022-01-26 16:02:00 +01:00
Carlos Garnacho
8e86e6325b gtk/main: Do not use touchpad event sequence for pointer focus lookup
Despite touchpad gestures having a sequence, these must use the logical
pointer focus. Avoid using the sequence for GtkPointerFocus lookups with
those events, in order to ensure those events make it all the way to the
intended target.

This is fallout from adding GdkEventSequence information to touchpad
gestures.
2022-01-26 15:59:36 +01:00
António Fernandes
1a64eeb88e gtkbitset: Define autocleanup function 2022-01-25 21:33:31 +00:00
Kévin Commaille
aaba777ad0
popovermenu: Fix crash when removing child
gtk_menu_section_box_remove_custom was looking in the wrong place for the
stack ancestor, causing an assertion error.
2022-01-25 15:31:00 +01:00
Bilal Elmoussaoui
b362eeefdf g-i: mark GtkSnapshot to_(node|paintable) as nullable
Fixes an upstream issue reported at https://github.com/gtk-rs/gtk4-rs/issues/845
2022-01-23 22:11:07 +00:00
Matthias Clasen
6fd53f28f3 Use pango api better
Avoid direct access to PangoLayoutLine members,
use pango api for it where we can.#
2022-01-23 09:55:46 -05:00
Matthias Clasen
4fe976549e Use pango api better
Avoid direct access to PangoLayoutLine members,
use pango api for it where we can.
2022-01-23 09:09:57 -05:00
Matthias Clasen
feac1e5fba Use pango api better
Avoid direct access to PangoLayoutLine members,
use pango api for it where we can.
2022-01-22 23:10:53 -05:00
Matthias Clasen
9146a21738 Merge branch 'bilelmoussaoui/g-i' into 'main'
g-i: mark gtk_text_iter_get_child_anchor as nullable

See merge request GNOME/gtk!4401
2022-01-19 13:48:57 +00:00
Bilal Elmoussaoui
0f67e46549 g-i: mark gtk_text_iter_get_paintable as nullable 2022-01-19 10:22:40 +00:00
Guido Günther
45397534eb gtkimcontextwayland: Save context even when text_input isn't around yet
Remember the current context on focus-in even though the text-input
isn't set up yet. This helps in the case where the text-input is not yet
created but a widget already got focused. Without that the enable()
invocation in text_input_enter() woulnd't be invoked leaving the input
method disabled.

This fixes

    gtk4-demo --run=search_entry

which would initially not show the on-screen keyboard when e.g using
phoc/sway as compositor.
2022-01-19 10:20:46 +00:00
Bilal Elmoussaoui
ffa93b87f8 g-i: mark gtk_text_iter_get_child_anchor as nullable 2022-01-19 10:18:40 +00:00
Alexandros Theodotou
738d962aca
gtk: document return value of ShortcutFunc 2022-01-18 10:58:47 +00:00
Philip Zander
52616dee8e GtkIMContextIME: Ignore ASCII control characters
Make GtkIMContextIME ignore ASCII control characters just like other
IMContext implementations (e.G. GtkIMContextSimple). Fixes bogus
characters appearing in text input fields (old bug 676077).
2022-01-17 12:03:01 +01:00
Philip Zander
b9bc7d9166 IMContextSimple/IMContextIME: Fix AltGr not working on Win32
The old code assumed that any key press containing Ctrl or Alt cannot be
regular text input. This is not correct on Win32 as AltGr = Ctrl + Alt.
2022-01-13 17:26:59 +01:00
Luca Bacci
5bf5d25bc1 Merge branch 'fix-build-no-pangoft' into 'main'
Improve and fix building font features on Windows (was: Fix builds without PangoFT2)

Closes #4605

See merge request GNOME/gtk!4339
2022-01-12 19:53:39 +00:00
Marek Kasik
915090f118 printing: Unref old spool_io before setting new one
Unref private spool_io of GtkPrintJob before setting it to a new one
in gtk_print_job_set_source_file() and gtk_print_job_set_source_fd()
to prevent a leak.

Fixes: #4627
2022-01-12 12:47:28 +01:00
Chun-wei Fan
b666a767e4 language-names: Use Windows APIs to acquire language names
Instead of relying on the iso-codes package, use the native Windows NLS APIs to
acquire the localized (translated) language names so that we do not need to
incur an extra runtime dependency on Windows.  It's not coverering 100% of the
languages that we would like to support through this, but should cover much of
the things that are required.
2022-01-12 17:29:30 +08:00
Chun-wei Fan
ee2dd1acc7 gtk/meson.build: Fix builds without PangoFT2
We aren't really using PangoFT2 for [language|script]-names.c, and are
always using items from them, so make sure they are being built.

Also always include the pangoft2 dependency in gtk_dep if it is found.
2022-01-12 17:29:28 +08:00
Matthias Clasen
21d40fc038 Merge branch 'fix-directory-list' into 'main'
directorylist: Fix several issues

Closes #3784

See merge request GNOME/gtk!4367
2022-01-12 02:58:25 +00:00
Matthias Clasen
b494d94bdb Merge branch 'drop-script-names' into 'main'
Drop the script name data

See merge request GNOME/gtk!4361
2022-01-12 02:43:54 +00:00
Matthias Clasen
dcdcc659ef directorylist: Fix several issues
We were handling events in the wrong order,
by doing async calls for some of them, but not
for all of them.

And we were not taking into account that GFileMonitors
RENAMED events may or may not move a file on top
of an existing file.

Fixes: #3784
2022-01-11 21:35:19 -05:00
Matthias Clasen
70732afb95 Drop the script name data
It is not used in GTK itself, and gtk4-demo
has its own copy.
2022-01-10 10:43:05 -05:00
Sebastian Dröge
1e26c352d6 Fix typo in IconView docs
g_lsit_free_full() -> g_list_free_full()
2022-01-09 13:59:59 +02:00
Emmanuele Bassi
bed67edd2e Merge branch 'ebassi/docs-for-main' into 'main'
Document side effect of GLArea:has-depth-buffer

Closes #838

See merge request GNOME/gtk!4351
2022-01-07 19:14:59 +00:00
Emmanuele Bassi
8a6dd2805f Document side effect of GLArea:has-depth-buffer
We enable depth testing when creating a depth buffer.

Fixes: #838
2022-01-07 18:30:54 +00:00
Matthias Clasen
464219c0fa Merge branch 'wip/baedert/for-master' into 'main'
label: Remove a redundant assignment

See merge request GNOME/gtk!4348
2022-01-07 16:47:07 +00:00
Timm Bäder
262f2a1453 Make some code samples compile 2022-01-07 17:21:37 +01:00
Timm Bäder
b408967278 label: Remove a redundant assignment
clang-tidy says:

gtklabel.c:1188:15: warning: Although the value stored to 'mid' is used in the enclosing expression, the value is never actually read from 'mid'
        min = mid = text_width;
              ^     ~~~~~~~~~~

Which seems right since mid will be assigned to at the beginning of the
next loop iteration anyway.
2022-01-07 17:21:37 +01:00
Emmanuele Bassi
1fd97fed91 docs: Clean up the ToggleButton description
- Use different headings
- Fix the coding style of the example
2022-01-07 15:42:08 +00:00
Matthias Clasen
46a7aaac76 Merge branch 'wip/chergert/fix-textview-dnd-move-same-view' into 'main'
textview: remove drag selection after dnd move action

See merge request GNOME/gtk!4346
2022-01-07 03:15:48 +00:00
Christian Hergert
e14d6fe9d5 textview: remove drag selection after dnd move action
If we have a GDK_ACTION_MOVE, we need to delete the selection. However,
previously this only worked when the drop target and drag source were
different applications, as the selection would get messed up along the
way.

Instead, we stash marks for the duration of the operation so that we can
delete the appropriate selection when completing the move.
2022-01-06 16:30:34 -08:00
Matthias Clasen
9dccdd1008 Merge branch 'docs-improvs-i' into 'main'
docs: Improve docs for four classes

See merge request GNOME/gtk!4337
2022-01-06 19:19:31 +00:00
Maximiliano Sandoval R
1229032b4e
docs: Add misc links 2022-01-05 14:06:43 +01:00
Maximiliano Sandoval R
6d80135342
docs: Improve docs for gtksnapshot.c 2022-01-05 14:06:41 +01:00
Maximiliano Sandoval R
c36a10da83
docs: Improve docs for gtkversion.h 2022-01-05 13:24:32 +01:00