Matthias Clasen
1af94d0bce
x11: Fix a crash in event handling
...
This was overlooked in 79b4510c6d
.
2020-02-22 16:41:29 +00:00
Benjamin Otte
b002572824
Merge branch 'wip/otte/dnd' into 'master'
...
stuff
See merge request GNOME/gtk!1460
2020-02-22 14:53:13 +00:00
Matthias Clasen
767849d6d2
Remove GdkSeatGrabPrepareFunc from headers
...
It is not used in public api anymore.
2020-02-22 08:11:34 -05:00
Matthias Clasen
76e115b910
Add a warning when a grab fails
...
This reveals that the grabs for popover menus
always fail now, causing the menus to not properly
hide.
2020-02-22 08:11:34 -05:00
Benjamin Otte
f9b7825a47
device: Inline function into return_if_fail()
2020-02-22 07:33:40 +01:00
Benjamin Otte
e3aee62b18
drop: Guard variable with correct compiler flags
2020-02-22 07:33:40 +01:00
Benjamin Otte
ce3ed45e81
surface: Inline function
...
Fixes compile error with -DG_DISBALE_CHECKS
2020-02-22 07:33:40 +01:00
Benjamin Otte
be4b34aa8f
events: Use GdkDrop as event sequence
...
This allows treating drop events like touch events, which GTK groups by
event sequence.
It's a bit ugly that we just case the GdkDrop pointer, but event
sequences are only meant to be unique pointer ids, so it's fine.
2020-02-22 07:33:40 +01:00
Jonas Ådahl
2f13ac2e4d
gdk/wayland: Avoid relayout with the same properties
...
When a popup is already showing, and gdk_surface_present_popup() is
called, if the layout didn't change, we're not really interested in
relayouting.
In the future, we'll be able to get notified if position of the popup
would change by some environmental changes, but until then, just don't
support it.
2020-02-21 21:55:16 +01:00
Jonas Ådahl
1d6100e7b0
gdk/popup-layout: Remove leftover struct field
...
The layouts never "seal", as they did in an earlier revision, so remove
the seal field.
2020-02-21 21:42:52 +01:00
Benjamin Otte
5577cfa40c
surface: Don't take a display argument in gdk_surface_new_popup()
...
The display can be taken from the surface, it must not be different.
2020-02-21 21:13:09 +01:00
Benjamin Otte
608e624ecf
x11: When clearing old Drop, emit LEAVE event
...
This can happen when the old DND operation died (like due to a crash or
a broken XWayland compositor.
2020-02-21 18:19:16 +01:00
Benjamin Otte
808961564c
gdk: Make DRAG_ENTER event take x/y coordinates
...
Make it mirror the behavior of ENTER/LEAVE events.
2020-02-21 18:19:16 +01:00
Matthias Clasen
d7d7957b04
profiling: Avoid one extra printf
...
We already format the message, no need to use
printf again to combine that with the kind string.
2020-02-21 07:26:19 -05:00
Matthias Clasen
376f5eacbd
profiling: Avoid criticals
...
With events no longer GObjects, the type class is
longer around for peeking.
2020-02-21 07:23:40 -05:00
Matthias Clasen
497a43a4ba
gdk: Drop event structs from the headers
...
All events are GdkEvents now.
2020-02-21 00:51:03 -05:00
Matthias Clasen
4947b94a41
Stop exporting check_event_sanity
2020-02-21 00:51:03 -05:00
Matthias Clasen
7bb6abb1d4
win32: Remove some leftover event struct access
...
And leftover old event api calls.
2020-02-21 00:51:03 -05:00
Matthias Clasen
de91e10a1b
wayland: Fix a release build warning
2020-02-21 00:51:03 -05:00
Matthias Clasen
1ef30c110f
Clean up GdkEventType docs
2020-02-21 00:51:03 -05:00
Matthias Clasen
6fd913b361
Some event struct packing improvements
...
Rearrange a few things, and move some booleans
into the Any struct, by using a bitfield there.
Some more cleanup could be done - the flags field
with its PENDING and FLUSHED members appears
entirely unused. Nobody is setting those flags.
2020-02-21 00:51:03 -05:00
Matthias Clasen
84edce3732
Streamline event structs
...
Use proper types (GdkModifierType, double), and drop
some unused fields (send_event, display).
2020-02-21 00:51:03 -05:00
Matthias Clasen
2cce508b33
x11: Remove some leftover event struct access
2020-02-21 00:51:03 -05:00
Matthias Clasen
56d44b4cec
x11: Stop using the send_event event field
...
The only use of this field is printing it out in a
debug message. We are going to drop it.
2020-02-21 00:51:03 -05:00
Matthias Clasen
563dd65530
Always deliver focus events to toplevels
...
Its was GTK expects. This change gets rid of the "Ignoring an
unexpected focus event from GDK on a non-toplevel surface."
warning.
2020-02-21 00:51:03 -05:00
Matthias Clasen
b1eaa502df
events: reorganize getters
...
Restructure the getters for event fields to
be more targeted at particular event types.
Update all callers, and replace all direct
event struct access with getters.
As a side-effect, this drops some unused getters.
2020-02-21 00:51:03 -05:00
Matthias Clasen
f1cf0eb3fc
Drop gdk_set/get_show_events
...
We don't need a separate api to turn on debugging
for events.
2020-02-21 00:51:02 -05:00
Matthias Clasen
31bf9da63a
Strip const from GdkEvent
...
Events are refcounted structs, and we generally don't
pass these as const.
2020-02-21 00:51:02 -05:00
Matthias Clasen
1026bfb1ac
events: Drop all setters
...
GdkEvent is now truly readonly.
2020-02-21 00:51:02 -05:00
Matthias Clasen
92288205d4
events: Drop target and related target
...
GTK no longer uses this, so we can drop it.
2020-02-21 00:51:02 -05:00
Matthias Clasen
e5223b1cee
main: Stop calling gdk_event_set_target
...
GTK is no longer relying on this.
2020-02-21 00:51:02 -05:00
Matthias Clasen
cd2b58574d
Drop GDK_NOTHING
...
Events of type GDK_NOTHING are good for nothing.
2020-02-21 00:47:53 -05:00
Matthias Clasen
3830e13b98
Make GdkEvent a boxed type
2020-02-21 00:47:53 -05:00
Matthias Clasen
c343031a0e
Stop using g_object_ref/unref on events
...
Use gdk_event_ref/unref instead of g_object_ref/unref.
Events will stop being object soon.
2020-02-21 00:47:53 -05:00
Matthias Clasen
835556c270
Drop gdk_event_new and gdk_event_copy
...
These functions are no longer used outside of gdkevents.c.
2020-02-21 00:47:52 -05:00
Matthias Clasen
59cc216985
display: Stop using gdk_event_copy
...
Events are effectively readonly in GDK now, so we can just
take a reference, no need for a copy.
2020-02-21 00:47:52 -05:00
Matthias Clasen
fe21223d48
win32: Use event constructors
2020-02-21 00:47:52 -05:00
Matthias Clasen
f11b1d258b
x11: Pass the right surface to the dnd filter
2020-02-21 00:47:52 -05:00
Matthias Clasen
e45711e727
x11: Remove an unnecessary check
...
We are not creating GDK_NOTHING events anymore. Yay
2020-02-21 00:47:52 -05:00
Matthias Clasen
79b4510c6d
x11: change event translator interface
...
Make the event translator return a new event, instead of
filling in a half-constructed one.
Update the two implementation in GdkX11Display and
GdkDeviceManagerXI2.
2020-02-21 00:47:51 -05:00
Matthias Clasen
15501afdbb
x11: Change the wm protocols filter api
...
Instead of passing a half-constructed event and expect
it to be filled in, pass the surface as in argument, and
add an out argument for a newly constructed GdkEvent.
2020-02-21 00:40:52 -05:00
Matthias Clasen
94fe0944cc
x11: Don't pass a GdkEvent to shape cache filters
...
The filter functions never look at that event, and
we want to get out of the business of passing half-
constructed events around.
2020-02-21 00:40:52 -05:00
Matthias Clasen
9c4f19e8ed
x11: Don't pass a GdkEvent to xsettings filters
...
The filter functions never look at that event, and
we want to get out of the business of passing half-
constructed events around.
2020-02-21 00:40:52 -05:00
Matthias Clasen
9a1497f582
events: Drop GDK_DESTROY
...
No backend is emitting GDK_DESTROY events anymore, so no
need to carry this around.
2020-02-21 00:40:52 -05:00
Matthias Clasen
047c18844c
x11: Don't generate GDK_DESTROY events
...
GTK does not differentiate between GDK_DESTROY and GDK_DELETE
anyway.
2020-02-21 00:40:52 -05:00
Matthias Clasen
30740f0e2c
x11: use event constructors
...
This is not quite complete and only handles the
simple cases.
2020-02-21 00:40:52 -05:00
Matthias Clasen
c9d9ccdb8c
broadway: Use event constructors
...
Convert all of Broadways event handling to use the new
constructors.
2020-02-21 00:40:52 -05:00
Matthias Clasen
324aa39cb8
gdk: Use constructor for grab broken
2020-02-21 00:40:52 -05:00
Matthias Clasen
d6c5ecbea3
gdk: Use event constructors for dnd
2020-02-21 00:40:50 -05:00
Matthias Clasen
ef004c64c6
events: Drop x_root/y_root
...
We are not using these fields anymore.
2020-02-21 00:39:43 -05:00