summaryrefslogtreecommitdiff
path: root/gdk/gdkevents.c
Commit message (Collapse)AuthorAgeFilesLines
* Drop pointer_emulated discrete scroll eventsLuca Bacci2022-05-241-11/+1
| | | | | GTK4 has had smooth scroll events since the beginning, so we prefer not to emit emulated discrete scroll events at all
* gdk: always populate GDK_AXIS_{X,Y} in merged event historyHemidark2022-04-051-2/+8
| | | | | | | | | | | | | | | | | | Since GdkTimeCoord stores only axis values, prior to this change, if a device didn't report GDK_AXIS_X or GDK_AXIS_Y, the history attached to merged motion events wouldn't contain any positional information. Commit 6012276093ea10dc0913c38d9123c37b08a20264 already addressed this issue for devices without tools by storing the event position in GdkTimeCoord using GDK_AXIS_X and GDK_AXIS_Y and augmenting the GdkTimeCoord's axis bitmask accordingly. This change generalizes that workaround to all devices. Note that if a device DOES report values for GDK_AXIS_X and GDK_AXIS_Y, those values won't be overwritten. Closes #4809
* gdk: Add enum to indicate the unit of scroll deltaspanoplie2022-03-191-3/+45
| | | | | | | Add a new GdkScrollUnit enum that represent the unit of scroll deltas provided by GdkScrollEvent. The unit is accessible through gdk_scroll_event_get_unit().
* gdk/events: Add hold GdkEventJosé Expósito2022-01-261-3/+27
| | | | | | | Allow to create hold events as well as the required functions to get information about the event: gesture phase, finger count, etc Part-of: <!3454>
* gdk: Always request "flush events" frame clock phase on eventsCarlos Garnacho2022-01-261-16/+0
| | | | | | | | | | | | | | | | | | | | This change is done for 2 reasons: - The logic to request this phase when compressing scroll events is slightly broken. If there are multiple scroll events that are coalesced into one, the surface frame clock will not get this request. The worst case is having >= 2 scroll events on every frame, as the compressed event will be left in the queue, and be further compressed on future events. - Even scroll events aside, this phase is requested in oddly specific places that are not enough to cover all events, others do rely on unrelated GdkFrameClock activity that happens to flush the events as well. Unify this phase request so it explicitly happens on the arrival of any event. This ensures that events (compressed or not) will be handled promptly after arrival.
* gdk: add missing nullable annotationsBilal Elmoussaoui2022-01-011-1/+1
|
* Don't keep discrete scroll events in the queueMatthias Clasen2021-12-201-1/+2
| | | | We are not going to compress those anyway.
* gdk: Prepare touchpad events for sequencesMatthias Clasen2021-12-151-27/+53
| | | | | | | It makes sense to connect the begin/update/end events for touchpad swipes and pinches in a sequence. This commit adds the plumbing for it, but not backends are setting sequences yet.
* docs: Add some information about event axesMatthias Clasen2021-12-151-0/+6
|
* Fix event historyMatthias Clasen2021-12-151-36/+76
| | | | | Collecting of history wasn't working correctly for either motion or scroll events.
* gdk: Remove gdkinternals.hBenjamin Otte2021-09-241-1/+0
|
* gdk: Remove gdk.h include from gdk-private.hBenjamin Otte2021-09-241-3/+4
|
* gdk: Clean up docs syntaxMatthias Clasen2021-05-221-22/+21
| | | | Replace leftover gtk-doc syntax (#Type) with backquotes.
* docs: Reduce redundancyMatthias Clasen2021-05-201-5/+4
| | | | | | | | Remove a boatload of "or %NULL" from nullable parameters and return values. gi-docgen generates suitable text from the annotation that we don't need to duplicate. This adds a few missing nullable annotations too.
* gdk: Add gdk_device_get_timestampMatthias Clasen2021-03-261-0/+3
| | | | | | Give each device a timestamp that reflects the last user activity with that device, as reflected in the events that are produced for this device.
* wayland: Fix cross-layout acceleratorsMatthias Clasen2021-03-151-4/+21
| | | | | | | | | GTK traditionally lets you activate keyboard shortcuts even if they are for a non-active layout. But it is meant to only activate with a keysym from a non-active layout when that symbol is not present in the current layout. That last condition was lost when key event handling was redone for GTK4. Bring it back.
* docs: Rework the gdk docsMatthias Clasen2021-03-111-100/+130
| | | | Convert links, make things more concise.
* docs: Move GdkEvent docs inlineMatthias Clasen2021-03-111-2/+6
| | | | This is not really worth a chapter of its own.
* docs: Move detached sections into their own content fileEmmanuele Bassi2021-03-111-13/+0
|
* gdk: Move from g_memdup() to g_memdup2()Emmanuele Bassi2021-02-111-2/+2
| | | | | The g_memdup() function is replaced by a safer version in newer versions of GLib.
* Merge branch 'wip/chergert/volatile-fixes' into 'master'Timm Bäder2020-12-291-3/+3
|\ | | | | | | | | types: fix various use of volatile in type registration See merge request GNOME/gtk!2865
| * types: fix various use of volatile in type registrationwip/chergert/volatile-fixesChristian Hergert2020-11-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | The use of volatile was incorrect in GLib and has been that way for a long time. Recently however that has changed, and this makes GTK follow suit to avoid using volatile in the type registration. See also: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719 Combined with the above merge request for GLib, this fixes a large number of compilation warnings when using Clang.
* | main: Add & use gdk_event_dup_axes()Timm Bäder2020-12-211-0/+16
| | | | | | | | | | The way this code is written trips up scan-build. Add gdk_event_dup_axes() and use it in gtkmain.c.
* | docs: Complete symbol coverage for GDKEmmanuele Bassi2020-12-161-0/+78
| | | | | | | | | | | | | | | | | | | | 100% symbol docs coverage. 833 symbols documented. 0 symbols incomplete. 0 not documented. What's left are just type system macros and windowing system opaque structures.
* | gdk: Replace all GDK_CONFIGURE usage with GdkSurface::layoutJonas Ådahl2020-12-071-71/+0
|/ | | | | | This removes the GDK_CONFIGURE event and all related functions and data types; it includes untested changes to the MacOSX, Win32 and Broadway backends.
* gdk: Deliver queued events on flushflush-eventsMatthias Clasen2020-10-231-4/+9
| | | | | | | The current code was marking queued events as flushed, but left them in the queue. That doesn't make sense to me - we should deliver all events we have before we reach the paint phase of the frame cycle.
* gdk: Drop some unused private apiMatthias Clasen2020-10-071-4/+0
| | | | | | No users of gdk_display_peek_event, gdk_display_has_pending _gdk_display_event_data_copy or _gdk_display_event_data_free, so drop all of these, and related vfuncs.
* gdk: Slim down gdkinternals.h moreMatthias Clasen2020-08-141-5/+5
| | | | Move things to the private headers they belong in.
* Fix a leak in scroll event compressionMatthias Clasen2020-08-061-0/+2
| | | | | We were leaking the last event in a sequence of scroll events.
* docs: Clean up dangling links in gdk docsMatthias Clasen2020-08-051-3/+3
| | | | Clean up references to no-longer-existing APIs.
* gdk: Conflate GDK devicesCarlos Garnacho2020-07-291-80/+22
| | | | | | | | | | Make GdkEvents hold a single GdkDevice. This device is closer to the logical device conceptually, although it must be sufficient for device checks (i.e. GdkInputSource), which makes it similar to the physical devices. Make the logical devices have a more accurate GdkInputSource where needed, and conflate the event devices altogether.
* gdk: Make events hold an axis array matching GdkAxisUseCarlos Garnacho2020-07-291-17/+14
| | | | | Instead of doing device-specific translations of array positions, use GdkAxisUse as an array index right away.
* Replace "gdouble" with "double"Benjamin Otte2020-07-251-11/+11
|
* Replace "gchar" with "char"Benjamin Otte2020-07-251-1/+1
|
* Replace "gint" with "int"Benjamin Otte2020-07-251-1/+1
|
* gdk: Small documentation fixesMatthias Clasen2020-06-281-1/+1
| | | | Make sure gdk_event_get_seat shows up.
* gdk: Add gdk_event_get_seat()Carlos Garnacho2020-06-231-0/+16
| | | | | It currently fetches the seat from the event device, will be changed in future commits.
* Rename master and slave deviceEmmanuele Bassi2020-06-181-3/+3
| | | | | | We already use the "logical/virtual" and "physical" names in the documentation, there's no reason to use loaded terms just because X11 uses them.
* Address review commentsMatthias Clasen2020-06-091-5/+16
| | | | | We were casting scroll events to motion events rather carelessly. Don't do that.
* gdk: Add documentationMatthias Clasen2020-06-091-0/+6
| | | | Add some useful information about event history.
* gdk: Rename gdk_motion_event_get_historyMatthias Clasen2020-06-091-55/+26
| | | | | | | | | | | Scroll events can have history too, so make a getter that works for both. This drops the gdk_scroll_event_get_history getter that was added a few commits earlier, since we now store scroll history in the same way as motion history. Update the docs, and all callers.
* Keep scroll historyMatthias Clasen2020-06-091-10/+65
| | | | | | Similar to how we keep motion history for compressed events, keep scroll history for compressed scroll events.
* gdk: Compress scroll eventsMatthias Clasen2020-06-091-2/+91
| | | | | | | | | | Only return one accumulated scroll event per frame. Compress them by adding up the deltas. Still missing: a way to capture history, like we do for motion events. Fixes: #2800
* Remove position from GdkScrollEventEmmanuele Bassi2020-06-011-25/+3
| | | | | | Scroll events do not have a position, so they shouldn't implement the GdkEventClass.get_position() virtual function; nor they should have an x and y fields that never get updated.
* gdk: Drop some unused event queue functionsMatthias Clasen2020-05-261-47/+0
|
* Add private accessor for GdkKeyEvent.translatedEmmanuele Bassi2020-05-241-0/+26
| | | | Avoid accessing the event structure directly, even from within GTK.
* docs: Fix several missing references in the documentationCorentin Noël2020-05-111-1/+1
| | | | This fixes several typos and missing references
* Annotate gdk_motion_event_get_history() correctlyEmmanuele Bassi2020-05-061-2/+2
| | | | | We moved from returning a list to returning a C array, and this requires a change in the annotations.
* GdkEvent: Save history in a GArrayTimm Bäder2020-05-051-9/+29
| | | | Instead of a less efficient GList.
* keymap: Cache key infoMatthias Clasen2020-04-301-7/+4
| | | | | | | | | | | | | | | We currently calling gdk_display_map_keyval up to once per key event per shortcut trigger, and that function does an expensive loop over the entire keymap and allocates an array. Avoid this by caching the entries in a single array, and have a lookup table for finding the entries for a keyval. To do this, change the GdkKeymap.get_entries_for_keyval signature, and change the ::keys-changed signal to be RUN_FIRST, since we want to clear the cache in the class handler before running signal handlers. These changes are possible now, since keymaps are no longer public API.