Commit Graph

53161 Commits

Author SHA1 Message Date
Benjamin Otte
b49a9b9933 dnd: Remove gdk_drag_get_selection()
Without selections, drags can't have them either.

Also included is removing the selection from GtkSelectionData.

Includes a bunch of crude cleanups to Wayland code that no longer has to
care about selection atoms.
2017-12-14 04:39:22 +01:00
Benjamin Otte
65fcff87b2 gdk: Remove ability to request selection notifications
Without selections, that's kinda pointless.
2017-12-14 04:20:48 +01: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
Benjamin Otte
82aa0eacb2 broadway: Make compile after GdkEvent objectification 2017-12-14 03:05:34 +01:00
Benjamin Otte
38d8fa0b6a gesture: Fix gcc constness warning 2017-12-14 03:05:34 +01:00
Benjamin Otte
d7f34874ab x11: Make unsetting transient-for work
... and just unset it from GtkWindow instead of fiddling with
properties.
2017-12-14 03:05:34 +01:00
Benjamin Otte
a4b42f0b73 gdk: Remove selection defines
And with it, remove the selections section from the docs.

So selections are gone for good now.
2017-12-14 03:05:34 +01:00
Georges Basile Stavracas Neto
8993a51893 vulkan: Destroy buffer before releasing associate memory
Exact same issue as the previous commit.
2017-12-13 23:14:58 -02:00
Georges Basile Stavracas Neto
147a455171 vulkan: Destroy image before releasing associate memory
VkImage contains a reference to the VkDeviceMemory and, because
the current code frees the VkDeviceMemory before destroying the
VkImage that references it, a warning is triggered by the validation
layers.

This is not critical, since we release both resources at the same
place. But the warning triggered by the validation layers sums up
adding 1 MB per second of extra debug logging, making the debugging
process much more painful.

This commit simply swaps the destruction order, and destroys the
VkImage first, then the now unused VkDeviceMemory.
2017-12-13 22:49:16 -02:00
Piotr Drąg
192bdae280 Update POTFILES.in 2017-12-14 01:15:17 +01:00
Carlos Garnacho
2f65a2f5cc gdk: Make gdk_display_peek_event() Return a reference to the event
No need to copy it.
2017-12-14 01:05:48 +01:00
Carlos Garnacho
332b640cd3 gtk: Make gtk_get_current_event() return a reference
All callers in gtk seem to be ok with it, and it makes sense if
we are dealing with events as "static after delivered".
2017-12-14 01:05:48 +01:00
Carlos Garnacho
ee178947d7 gtk: Avoid some event copies
Those places can do with an extra reference.
2017-12-14 01:05:48 +01:00
Carlos Garnacho
d491e49fd6 gtk: s/gdk_event_free/g_object_unref/ 2017-12-14 01:05:48 +01:00
Carlos Garnacho
b03d3fb268 gdk/wayland: s/gdk_event_free/g_object_unref/ 2017-12-14 01:05:48 +01:00
Carlos Garnacho
3021edc38d gdk/x11: s/gdk_event_free/g_object_unref/ 2017-12-14 01:05:48 +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
47f04afa48 gtk: Remove CONSTRUCT_ONLY flag from GtkEventControllerScroll::flags
There is a gtk_event_controller_scroll_set_flags() call that's meant
to be called after construction (eg. due to scrolledwindow relayouts
hiding/showing scrollbars). The property shouldn't be construct-only
for consistence.
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
0c8c9f59fc gtk: Adapt marshallers to GdkEvent as GObject 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
33330ad001 gtk/a11y: Use allocated events
Using stack allocated GdkEvent will not be ok when they 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
Carlos Garnacho
64decbfd74 gdk: Remove GdkEventType argument from GdkEvent union
It won't stand true anymore that the GdkEventType argument is the
first field of the GdkEvent* structs. All callers have been updated
to use event->any.type instead.
2017-12-14 00:58:32 +01:00
Carlos Garnacho
b9db0b55cb gdk: Refurbish GdkEvent struct hierarchy
Make all specific event structs contain a GdkEventAny, so the base
struct can be extended without modifying structs all over the place.
2017-12-14 00:58:32 +01:00
Matthias Clasen
9aba77e31b Redo drag source event handling
Let the gesture itself handle the events.
2017-12-13 18:56:42 -05:00
Benjamin Otte
54f9aef0d4 gdk: Remove gdk_selection_convert()
It's not used anymore.
2017-12-14 00:44:26 +01:00
Benjamin Otte
ca5f859dc8 dnd: Only send DELETE request on X11
This is Xdnd-specific and doesn't need to happen elsewhere.
2017-12-13 23:52:55 +01:00
Benjamin Otte
4042d5f242 gdk: Remove ability to own a selection
With this, the GDK_EVENT_SELECTION_REQUEST and GDK_EVENT_SELECTION_CLEAR
and the associated GtkWidget signals are gone, too.
2017-12-13 23:39:02 +01:00
Benjamin Otte
53081bd1d8 tests: Remove testselection
With selections goig away, this test is not very useful anymore.
2017-12-13 19:40:24 +01:00
Benjamin Otte
cb3ef5b642 xxx: don't claim dnd selection 2017-12-13 19:37:11 +01:00
Benjamin Otte
b66052f3ce gdk: Remove gdk_selection_add_targets()
It's not needed anymore, now that we can look at the content provider's
formats.

Alose remove all the API in GTK that was used to set it.
2017-12-13 19:27:51 +01:00
Benjamin Otte
65eab87238 x11: Move selection handling to GDK
Instead of claiming the selection in GTK, claim it in the X11 dnd code.
Also handle SelectionRequest and SelectionClear X events there.
2017-12-13 18:31:06 +01:00
Benjamin Otte
8648d5409e dnd: Pass content to gdk_drag_begin()
Instead of just passing the GdkContentFormats, we are now passing the
GdkContentProvider to gdk_drag_begin().
This means that GDK itself can now query the data from the provider
directly instead of having to send selection events.

Use this to provide the private API gdk_drag_context_write() that allows
backends to pass an output stream that this data will be written to.
Implement this as the mechanism for providing drag data on Wayland.

And to make this all work, implement a content provider named
GtkDragContent that is implemented by reverting to the old DND
drag-data-get machinery inside GTK, so for widgets everything works just
like before.
2017-12-13 15:05:27 +01:00
Matthias Clasen
c30cd885dd A forgotten file
These changes belong to the scale button autoscrollling
commit.
2017-12-12 23:23:17 -05:00
Matthias Clasen
9b29369222 Make sure events have displays
This seems to be necessary if you want to call
gdk_display_put_event on them.
2017-12-12 23:21:26 -05:00
Matthias Clasen
7e02ad648c toolbar: Stop using legacy event signals
We can reuse the button gesture here.
2017-12-12 22:55:48 -05:00
Matthias Clasen
fa7ef93bc5 scalebutton: Add autoscrolling
Use the smooth autoscrolling that the scale can do,
and at the same time stop using legacy event signals.
2017-12-12 22:21:43 -05:00
Matthias Clasen
05fbd32c4d button: Add private api to get at the gesture
Attaching another gesture from the outside does not
work currently, so let widgets share their button's
gesture for now.
2017-12-12 22:18:19 -05:00
Matthias Clasen
b891d205dd range: Add private api to autoscroll
This will be used to scroll the scale in scale buttons.
2017-12-12 22:17:49 -05:00
Matthias Clasen
2f6f8a7e6f path bar: Drop non-functional hold-to-scroll code
Scrolling a path bar is of marginal usefulness - you need to
find a really deep place in your filesystem hierarchy in order
to scroll one or two places at best. And the code we had for
this was not working. And it was using legacy event handlers.
Instead of fixing it, remove it.
2017-12-12 20:49:31 -05:00
Benjamin Otte
fb0fdddd76 x11: Refactor xevent filtering some more
We now have a GdkX11Display::xevent signal that gets emitted for every
XEvent and allows you to interrupt processing via TRUE/FALSE return
values.
These return values to correspond to GDK_FILTER_REMOVE and
GDK_FILTER_CONTINUE respectively.

The GDK_FILTER_TRANSLATE case from gdk_window_add_filter() is now meant
to be handled via gdk_display_put_event().
2017-12-13 01:55:56 +01:00
Matthias Clasen
76b93f5598 widget-factory: Avoid a legacy event handler
We can use a gesture instead, here.
2017-12-12 19:46:10 -05:00