Commit Graph

286 Commits

Author SHA1 Message Date
Matthias Clasen
b6893b6d9f Quietly ignore GDK_NOTHING events
These don't have a surface, so we can't deliver
them via the ::event signal. But then, they're
good for nothing anyway.
2019-02-23 17:09:25 -05:00
Matthias Clasen
e16cdb141c Drop gdk_event_handler_set
This is no longer used by GTK.
2019-02-23 14:13:57 -05:00
Timm Bäder
2146fd28f8 GdkDisplay: Use a GQueue for the events queue 2019-02-10 10:31:27 +01:00
Timm Bäder
01e985a830 GdkEvent: Remove unused struct 2019-01-18 19:43:48 +01:00
Timm Bäder
b2eff300b1 GdkEvent: Add a proper user_data member to GdkEventAny
Setting it as qdata on the object doesn't save any memory since we use
the user_data as the event target, which every event has set these days.
This way is also faster since just reffing the object doesn't do any
locking.
2019-01-18 19:43:48 +01:00
Benjamin Otte
375fbd4e47 gdk: Remove key_event->string and key_event->length
They're unused.
2018-07-30 19:32:38 +02:00
Benjamin Otte
813957a92f gdk: Remove gdk_event_get_string()
You want to use an IM module to get strings out of keypresses, not some
crude hack that only works on X11 and Wayland anyway.
2018-07-30 19:32:38 +02:00
Matthias Clasen
bf5f27c6d5 Handle configure events in gdk
The previous attempt at removing configure events entirely
was causing some dialogs not to show up under Wayland.
Presumably due to ordering issues with emitting ::size-change
out of the backend.

Instead, keep configure events in the event queue, but handle
them on the gdk side. This keeps the ordering intact, while
still removing configure events from the api. The dialogs
show up now.
2018-07-15 20:23:45 -04:00
Matthias Clasen
7a1073c3ae Revert "gdk: Drop configure events"
This reverts commit a8926c9d87.
2018-07-15 20:23:45 -04:00
Matthias Clasen
7ca6440f4d gdk: Drop map events
We are really inconsistent about generating these,
and they are not actually used in GTK+. Instead,
add a boolean GdkSurface::mapped property.
2018-07-15 15:10:56 -04:00
Matthias Clasen
da3aaf39b9 gdk: Drop expose events
Replace expose events with a GdkSurface::expose signal.
This is part of the move to use events only for input.
2018-07-15 13:13:07 -04:00
Matthias Clasen
a8926c9d87 gdk: Drop configure events
Replace configure events with a GdkSurface::size-changed signal.
This is part of the move to use events only for input.
2018-07-15 11:51:09 -04:00
Matthias Clasen
64f5afe608 dnd: Rename headers
Rename gdkdnd.h to gdkdrag.h, to go along with gdkdrop.h

This commit includes the necessary updates to the X11, Wayland
and Broadway backends. Other backends have to be updated separately.
2018-07-02 15:00:50 +02:00
Matthias Clasen
7733f646d6 gdk: Rename GdkDragContext to GdkDrag
This is to go along with the newly introduced GdkDrop.

This commit includes the necessary updates to the X11, Wayland
and Broadway backends. Other backends have to be updated separately.
2018-07-02 14:59:26 +02:00
Matthias Clasen
8755d884f3 Remove a lot of Since annotations
4.0 will represent a clean epoch. We don't want to have
lots of noise in the docs about 2.x or 3.x.
2018-06-25 19:55:04 -04:00
Benjamin Otte
c67fb57881 events: Make GdkEventDND have a GdkDrop member
... instead of a GdkDragContext.
2018-06-18 23:49:52 +02:00
Benjamin Otte
d02b185a87 dnd: Add gdk_event_get_drop()
And remove gdk_event_get_drag_context().

All GTK code now only uses GdkDrop for dropping.
2018-06-18 23:49:52 +02:00
Benjamin Otte
4b85b5299a dnd: Remove GdkDragContext::commit_drag_status() vfunc
The idea behind the vfunc doesn't work as status updates can happen
asynchronously.

A better solution needs to be found.
2018-06-18 23:49:52 +02:00
Benjamin Otte
83a80ab866 events: Mark static function as such 2018-05-29 21:54:47 +02:00
Benjamin Otte
7e574fa98c gdk: Get rid of gdk_event_free()
Events are objects, so use g_object_unref().
2018-05-29 21:53:44 +02:00
Matthias Clasen
3684b72121 Misc documentation fixes
Close some gaps in gdk docs.
2018-04-28 22:34:14 -04:00
Alexander Larsson
3dce0dcca7 GdkSurface: Rename lots of stuff from window->surface
Mostly these are internal things, but the major public change is
that event.window is now event.surface.
2018-03-20 15:14:10 +01:00
Alexander Larsson
391727bd0d GdkWindow -> GdkSurface initial type rename
This renames the GdkWindow class and related classes (impl, backend
subclasses) to surface. Additionally it renames related types:
GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType,
GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge

This is an automatic conversion using the below commands:

git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass

git sed -f g GdkWindow GdkSurface
git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing
git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING
git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2"
git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE
git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo

git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE"
git sed -f g "broadway_window" "broadway_surface"
git sed -f g "BroadwayWindow" "BroadwaySurface"
git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE"
git sed -f g "wayland_window" "wayland_surface"
git sed -f g "WaylandWindow" "WaylandSurface"
git sed -f g "X11_WINDOW" "X11_SURFACE"
git sed -f g "x11_window" "x11_surface"
git sed -f g "X11Window" "X11Surface"
git sed -f g "WIN32_WINDOW" "WIN32_SURFACE"
git sed -f g "win32_window" "win32_surface"
git sed -f g "Win32Window" "Win32Surface"
git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE"
git sed -f g "quartz_window" "quartz_surface"
git sed -f g "QuartzWindow" "QuartzSurface"

git checkout NEWS* po-properties
2018-03-20 11:40:08 +01:00
Matthias Clasen
4c150d8eb5 The big versioning cleanup
Remove all the old 2.x and 3.x version annotations.
GTK+ 4 is a new start, and from the perspective of a
GTK+ 4 developer all these APIs have been around since
the beginning.
2018-02-06 01:16:32 -05:00
Carlos Garnacho
f964fe3ee5 gdk: Rename gdk_event_get_history() to get_motion_history()
It only applies to GDK_MOTION_NOTIFY events, so this is a more descriptive
name. Also add Since tag in docs, and GDK_AVAILABLE_IN_3_94.
2018-02-05 16:05:34 +01:00
Matthias Clasen
ca2a7c1efd Document more structs 2017-12-26 14:39:24 -05:00
Matthias Clasen
278c4583fc Document new event getters
New API needs documentation.
2017-12-26 13:00:27 -05:00
Matthias Clasen
d6985d793f Try to make the docs build more quiet
Not sure if this really makes a difference.
2017-12-26 13:00:27 -05:00
Matthias Clasen
97dcf2461e gdk: Remove the event structs from the documentation
No longer public api.
2017-12-26 13:00:27 -05:00
Emmanuele Bassi
90a4e33415 Update annotations for GdkEvent API
The GdkEvent API is missing some gtk-doc stanzas, as well as some
introspection annotations.
2017-12-21 19:07:02 +00:00
Carlos Garnacho
f93837ceb2 gdk: Remove leftover variable
This is unused and leaked.
2017-12-19 22:58:51 +01:00
Benjamin Otte
a04afde35c gdk: Remove DRAG_STATUS and DROP_FINISHED events
Those are source-side events that are handled by signals of the
Dragontext these days.
2017-12-15 23:48:36 +01:00
Matthias Clasen
e92c0e85ec Replace gdk_keymap_get_for_display by gdk_display_get_keymap
Replace all uses of the old function by the new one.
No functional change.
2017-12-15 07:44:58 -05:00
Matthias Clasen
9194ee4973 gdk: Drop GDK_DAMAGE
We haven't been generating events of this type
since we dropped offscreen windows.
2017-12-14 23:35:08 -05:00
Matthias Clasen
65fc43a1f3 Drop GDK_CLIENT_EVENT
We never generate events of this type, so no need
to carry it around.
2017-12-14 22:55:03 -05:00
Matthias Clasen
bcf570cc16 Move code around
gdk_window_set_state is now an ordinary (private) setter,
so it should live in gdkwindow.c.
2017-12-14 22:35:27 -05:00
Matthias Clasen
11a946df39 gdk: Drop GdkEventWindowState
No longer generate this event. Instead, emit change
notification for GdkWindow::state.
2017-12-14 22:24:06 -05:00
Matthias Clasen
e5b1867118 gdk: Add a GdkWindow::state property
This will eventually replace the window state event.
2017-12-14 22:24:06 -05:00
Benjamin Otte
f2bb2024c8 gdk: Remove properties
They are not used anymore.

Gone with them are PropertyNotify events.
2017-12-14 03:05:34 +01:00
Carlos Garnacho
f79ac6d30b gdk: Remove gdk_window_[gs]et_event_compression()
Motion compression is now the unmodifiable default, callers may
call gdk_event_get_motion_history() to check the uncoalesced
motion history.
2017-12-14 01:05:48 +01:00
Carlos Garnacho
ea216accd7 gdk: Implement motion history as motion event data
In the motion compression phase the coalesced events will be saved
as a GdkTimeCoord on the motion event that shall be delivered.

For simplicity (and because history doesn't make much sense otherwise)
event history is only recorded while there are buttons pressed, this
also tidily ensures that those coalesced events would have the same
target widget on the gtk side than the delivered one, because of
implicit grabs.
2017-12-14 01:05:48 +01:00
Carlos Garnacho
a040ed55cc gdk: Keep reference on tools from motion/button events. 2017-12-14 01:05:48 +01:00
Carlos Garnacho
8c9231dbb4 gdk: Move additional code in gdk_event_new() to GdkEvent::constructed
Now that the type is a construct only property, we can initialize the
event fields properly here.
2017-12-14 01:05:48 +01:00
Carlos Garnacho
5ee1d4893a gdk: Make GdkEvent type a construct only property
So it must be set at the time of doing g_object_new().
2017-12-14 01:05:48 +01:00
Carlos Garnacho
ca89ad75b4 gdk: Remove gdk_event_is_allocated()
All events are allocated now.
2017-12-14 01:05:48 +01:00
Carlos Garnacho
2acbb7b01d gdk: Turn GdkEvent into a GObject
Two warts remain. gdk_event_copy() should be unnecessary as
events should be considered static after delivery, so g_object_ref()
should be just as good. There's a few exceptional cases that the event
is copied and then modifier for later processing, those cases should be
reconsidered individually.

And gdk_event_free() could be likewise turned into g_object_unref(),
many callers remain though.
2017-12-14 01:05:48 +01:00
Carlos Garnacho
1e1f2a6e67 gdk: Remove GdkDisplay from GdkEventPrivate
And add it to GdkEventAny.
2017-12-14 01:05:08 +01:00
Carlos Garnacho
8595e4b1d1 gdk: Figure out the GdkSeat of an event from the GdkDevice
Removes the need for gdk_event_set_seat() and the GdkSeat field from
GdkEventPrivate.
2017-12-14 00:58:32 +01:00
Carlos Garnacho
526486da6b gdk: Use allocated events
Stack allocated GdkEvent structs will not be ok when events become
objects.
2017-12-14 00:58:32 +01:00
Carlos Garnacho
59cab36035 gdk: Fold GdkEventPrivate fields into event structs
Now all events structs are private, it doesn't make as much sense
having GdkEventPrivate wrapping allocating events. This is a first
step towards removing it.
2017-12-14 00:58:32 +01:00