Commit Graph

9057 Commits

Author SHA1 Message Date
Benjamin Otte
7cd728a0ea gdk: Make gdk_drop_status() take preferred action
This allows textview/text dnd to properly display a MOVE icon when in
the widget the drag started from but a COPY icon otherwise.
2020-03-02 04:43:56 +01:00
Emmanuele Bassi
7eb7ee33ff Add missing documentation to GdkDevice 2020-02-26 10:23:15 +00:00
Emmanuele Bassi
d4dcb43aa9 Add missing ownership transfer annotations 2020-02-26 10:23:01 +00:00
Emmanuele Bassi
a1bbd25e12 Fix introspection annotation syntax 2020-02-26 10:19:10 +00:00
Matthias Clasen
6fb50ccd0d Drop gdk_surface_is_visible
It has been replaced by gdk_surface_get_mapped.
2020-02-24 19:07:03 -05:00
Matthias Clasen
7a39f2d49d Replace gdk_surface_is_visible by _get_mapped
The property  is called ::mapped, and we want to get
to standard getter naming.
2020-02-24 19:07:03 -05:00
Matthias Clasen
96b7c5f575 Add gdk_surface_get_mapped
Returns the value of the ::mapped property. This is
a direct replacement for gtk_surface_is_visible.
2020-02-24 17:59:12 -05:00
Matthias Clasen
3c95798cd3 Add missing GdkDrag getters 2020-02-24 14:38:42 -05:00
Matthias Clasen
ec76f65d09 surface: Add a getter for autohide 2020-02-24 14:38:42 -05:00
Matthias Clasen
6be9e44786 gdk: Drop GdkDevice::input-mode and rename ::input-source
Drop the input-mode, since it only makes sense for
floating devices, which we don't have anymore. And renamt
::input-source to ::source, to match the getter.

Update all users.
2020-02-24 14:38:42 -05:00
Matthias Clasen
9ce6e98487 device: Add missing getters
This adds getters for a few properties that were
missing them, and renames the input-mode and input-source
properties to match their existing getters.
2020-02-24 08:40:16 -05:00
Matthias Clasen
4ca0a93324 Add a getter for GdkAppLaunchContext::display 2020-02-24 08:32:34 -05:00
Matthias Clasen
247a68d602 broadway: Remove SURFACE_IS_TOPLEVEL
All surfaces are toplevels now.
2020-02-23 18:15:59 -05:00
Benjamin Otte
cc7c1fe108 gdk: Remove GdkAtom
finally!!!!!
2020-02-23 01:59:26 +01:00
Benjamin Otte
f536cf0a43 win32: Get rid of GdkAtom 2020-02-23 01:59:26 +01:00
Benjamin Otte
60307da5b1 wayland: Replace final mention of GdkAtom 2020-02-23 01:59:26 +01:00
Benjamin Otte
6e935d469a x11: Get rid of GdkAtom and APIs supporting it.
replace all uses with const char * (non-interned).
Also remove a lot fo juggling from atom to GdkAtom to string and back.

The X Atom hash table is now mapping to (again, non-interned) strings.
2020-02-23 01:59:26 +01:00
Benjamin Otte
4280ca2263 device: gdk_device_list_axes() => gdk_device_get_axis_names()
Turn a GList of GdkAtom into a char ** - and rename the function to not
cause problems.
2020-02-23 01:59:26 +01:00
Benjamin Otte
28dced597f gdk: Remove gdk_text_property_to_utf8_list_for_display()
A lot of files became empty now, so they have been removed, which makes
this commit seem larger than it is.
2020-02-23 01:59:26 +01:00
Benjamin Otte
6c61c7bf0b Don't use GdkAtom where const char * is used
Those are all forgotten transitions while updating code to new APIs.
2020-02-23 01:59:19 +01:00
Benjamin Otte
6442ec2f8d gdk: Remove gdk_utf8_to_string_target()
Only keep the X11 version around in the backend.
2020-02-23 01:59:00 +01:00
Benjamin Otte
992173c382 x11: Register DND atoms with all other atoms
It's 2020, there's no need to be restrained with registering atoms.
2020-02-23 01:59:00 +01:00
Benjamin Otte
b0f6996892 gdk: Remove gdk_surface_register_dnd()
All surfaces are expected to be DND surfaces from creation.
2020-02-23 01:59:00 +01:00
Matthias Clasen
ec383a2388 Add detail to gdk_drag_begin docs
Mention that GTK keeps a reference while the drag
operation is ongoing.
2020-02-22 19:10:16 -05:00
Matthias Clasen
7c1cfc5533 x11: Fix dnd coordinate handling
We were not properly converting the coordinates we
got to root coordinates. This was showing up as offsets
between the actual drop target and the area where drops
can happen, e.g. when dragging over a stack switcher
to switch pages.
2020-02-22 19:10:16 -05:00
Matthias Clasen
14122d1acb x11: Export gdk_x11_surface_get_root_coords privately
This lets us avoid a roundtrip through the surface vfuncs.
2020-02-22 19:10:16 -05:00
Matthias Clasen
f93d0f8fb5 x11: Keep a ref on GdkDrag objects
It is expected that backends keep a ref on the GdkDrag
objects that they create as long as the drag is ongoing.
2020-02-22 19:02:13 -05:00
Matthias Clasen
833b564946 x11: Avoid crashes in dnd
We were forgetting to clean up the ::xevent signal
handler in some error cases. Move the signal connection
later, when we know the drag is going forward, and
use g_signal_connect_object to make sure the signal
handler is not forgotten.
2020-02-22 19:02:13 -05:00
Matthias Clasen
7edfcc37a3 Merge branch 'wip/wayland-fix-popup-grabs' into 'master'
Fix Wayland popup grabs

See merge request GNOME/gtk!1463
2020-02-22 20:51:32 +00:00
Jonas Ådahl
f0b0076a1c wayland/popup: Emit un-withdrawn event earlier
Otherwise grabbing the seat will appear to have failed.
2020-02-22 20:09:38 +01:00
Jonas Ådahl
71323a8b48 wayland/popup: Remove unnecessary checks when mapping popup
We only call this when we're not already mapped so don't check that. We
also only call this when we should be mapped so don't check that either.
2020-02-22 20:08:37 +01:00
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