gtk4.git
5 years agodragsource: Fix cancellation
Matthias Clasen [Tue, 7 Jan 2020 01:46:08 +0000 (20:46 -0500)]
dragsource: Fix cancellation

We need to properly end the drag.

5 years agofilechooser: Stop using gtk_drag_source_get_drag
Matthias Clasen [Tue, 7 Jan 2020 01:42:18 +0000 (20:42 -0500)]
filechooser: Stop using gtk_drag_source_get_drag

5 years agoplacessidebar: Update a comment
Matthias Clasen [Tue, 7 Jan 2020 01:31:23 +0000 (20:31 -0500)]
placessidebar: Update a comment

5 years agoRemove an unused enum
Matthias Clasen [Tue, 7 Jan 2020 01:30:41 +0000 (20:30 -0500)]
Remove an unused enum

We are not using GtkDragResult anymore.

5 years agotestdnd2: Update to the api change in the previous commit
Matthias Clasen [Tue, 7 Jan 2020 01:30:14 +0000 (20:30 -0500)]
testdnd2: Update to the api change in the previous commit

5 years agodragsource: Rename ::drag-failed to ::drag-cancel
Matthias Clasen [Tue, 7 Jan 2020 01:29:42 +0000 (20:29 -0500)]
dragsource: Rename ::drag-failed to ::drag-cancel

This matches the names of the GdkDrag signals.

5 years agodragsource: Tweak docs more
Matthias Clasen [Tue, 7 Jan 2020 01:21:00 +0000 (20:21 -0500)]
dragsource: Tweak docs more

5 years agodragsource: Document prepare
Matthias Clasen [Tue, 7 Jan 2020 01:20:45 +0000 (20:20 -0500)]
dragsource: Document prepare

5 years agodragsource: Make ::prepare return a boolean
Matthias Clasen [Tue, 7 Jan 2020 01:09:47 +0000 (20:09 -0500)]
dragsource: Make ::prepare return a boolean

Make ::prepare return TRUE to start a drag.
The default handler simply checks that we
have a content provider and actions.

5 years agodragsource: Drop gtk_drag_get_source
Matthias Clasen [Tue, 7 Jan 2020 01:03:24 +0000 (20:03 -0500)]
dragsource: Drop gtk_drag_get_source

5 years agonotebook: Stop using gtk_drag_get_source
Matthias Clasen [Tue, 7 Jan 2020 01:02:33 +0000 (20:02 -0500)]
notebook: Stop using gtk_drag_get_source

5 years agodragsource: Drop gtk_drag_source_get_origin
Matthias Clasen [Tue, 7 Jan 2020 00:55:43 +0000 (19:55 -0500)]
dragsource: Drop gtk_drag_source_get_origin

5 years agofilechooserwidget: Stop using gtk_drag_source_get_origin
Matthias Clasen [Tue, 7 Jan 2020 00:54:52 +0000 (19:54 -0500)]
filechooserwidget: Stop using gtk_drag_source_get_origin

5 years agonotebook: Stop using gtk_drag_source_get_origin
Matthias Clasen [Tue, 7 Jan 2020 00:51:46 +0000 (19:51 -0500)]
notebook: Stop using gtk_drag_source_get_origin

5 years agotesttoolbar: Use gtk_widget_add_controller for drag source
Matthias Clasen [Tue, 7 Jan 2020 06:13:51 +0000 (01:13 -0500)]
testtoolbar: Use gtk_widget_add_controller for drag source

5 years agotestlist3: Use gtk_widget_add_controller for drag source
Matthias Clasen [Tue, 7 Jan 2020 06:13:35 +0000 (01:13 -0500)]
testlist3: Use gtk_widget_add_controller for drag source

5 years agotestdnd2: Use gtk_widget_add_controller for drag source
Matthias Clasen [Tue, 7 Jan 2020 06:13:11 +0000 (01:13 -0500)]
testdnd2: Use gtk_widget_add_controller for drag source

5 years agotestdnd: Use gtk_widget_add_controller for drag source
Matthias Clasen [Tue, 7 Jan 2020 06:12:48 +0000 (01:12 -0500)]
testdnd: Use gtk_widget_add_controller for drag source

5 years agopathbar: Use gtk_widget_add_controller for drag source
Matthias Clasen [Tue, 7 Jan 2020 06:08:51 +0000 (01:08 -0500)]
pathbar: Use gtk_widget_add_controller for drag source

5 years agonotebook: Use gtk_widget_add_controller for drag source
Matthias Clasen [Tue, 7 Jan 2020 06:08:31 +0000 (01:08 -0500)]
notebook: Use gtk_widget_add_controller for drag source

5 years agolinkbutton: Use gtk_widget_add_controller for drag source
Matthias Clasen [Tue, 7 Jan 2020 06:08:11 +0000 (01:08 -0500)]
linkbutton: Use gtk_widget_add_controller for drag source

5 years agocolorswatch: Use gtk_widget_add_controller for drag source
Matthias Clasen [Tue, 7 Jan 2020 06:07:45 +0000 (01:07 -0500)]
colorswatch: Use gtk_widget_add_controller for drag source

5 years agocolorbutton: Use gtk_widget_add_controller for drag source
Matthias Clasen [Tue, 7 Jan 2020 06:07:24 +0000 (01:07 -0500)]
colorbutton: Use gtk_widget_add_controller for drag source

5 years agoiconbrowser: Use gtk_widget_add_controller for drag source
Matthias Clasen [Tue, 7 Jan 2020 06:07:02 +0000 (01:07 -0500)]
iconbrowser: Use gtk_widget_add_controller for drag source

5 years agogtk-demo: Use gtk_widget_add_controller for drag source
Matthias Clasen [Tue, 7 Jan 2020 06:06:39 +0000 (01:06 -0500)]
gtk-demo: Use gtk_widget_add_controller for drag source

5 years agofilechooserwidget: wip
Matthias Clasen [Tue, 7 Jan 2020 00:38:17 +0000 (19:38 -0500)]
filechooserwidget: wip

5 years agotreeview: Use gdk_drag_begin
Matthias Clasen [Tue, 7 Jan 2020 00:38:05 +0000 (19:38 -0500)]
treeview: Use gdk_drag_begin

5 years agoiconview: Use gdk_drag_begin
Matthias Clasen [Tue, 7 Jan 2020 00:10:15 +0000 (19:10 -0500)]
iconview: Use gdk_drag_begin

This is a little more involved here.

5 years agoMake GtkDragSource a gesture
Matthias Clasen [Mon, 6 Jan 2020 23:29:18 +0000 (18:29 -0500)]
Make GtkDragSource a gesture

5 years agonotebook: Use gdk_drag_begin
Matthias Clasen [Mon, 6 Jan 2020 23:06:25 +0000 (18:06 -0500)]
notebook: Use gdk_drag_begin

Use gdk_drag_begin for one-off drags.

5 years agoplacessidebar: Use gdk_drag_begin
Matthias Clasen [Mon, 6 Jan 2020 22:50:04 +0000 (17:50 -0500)]
placessidebar: Use gdk_drag_begin

Use gdk_drag_begin for one-off drags.

5 years agotextview: Use gdk_drag_begin
Matthias Clasen [Mon, 6 Jan 2020 22:42:12 +0000 (17:42 -0500)]
textview: Use gdk_drag_begin

Use gdk_drag_begin for one-off drags.

5 years agoentry: Use gdk_drag_begin
Matthias Clasen [Mon, 6 Jan 2020 22:36:18 +0000 (17:36 -0500)]
entry: Use gdk_drag_begin

Use gdk_drag_begin for one-off drags.

5 years agotext: Use gdk_drag_begin
Matthias Clasen [Mon, 6 Jan 2020 22:26:05 +0000 (17:26 -0500)]
text: Use gdk_drag_begin

Use gdk_drag_begin directly for one-off drags.

5 years agocalendar: Use gdk_drag_begin
Matthias Clasen [Mon, 6 Jan 2020 21:12:18 +0000 (16:12 -0500)]
calendar: Use gdk_drag_begin

Use gdk_drag_begin directly for one-off drags.

5 years agolabel: Use gdk_drag_begin
Matthias Clasen [Mon, 6 Jan 2020 21:00:32 +0000 (16:00 -0500)]
label: Use gdk_drag_begin

Use gdk_drag_begin directly for one-off drags.

5 years agodragsource: Use public drag icon api
Matthias Clasen [Mon, 6 Jan 2020 21:00:17 +0000 (16:00 -0500)]
dragsource: Use public drag icon api

5 years agoMake GtkDragIcon public
Matthias Clasen [Mon, 6 Jan 2020 20:47:25 +0000 (15:47 -0500)]
Make GtkDragIcon public

This is needed if we want to use gdk_drag_begin
for one-off drags, without a GtkDragSource.

5 years agodragsource: Reshuffle api a bit
Matthias Clasen [Mon, 6 Jan 2020 19:46:14 +0000 (14:46 -0500)]
dragsource: Reshuffle api a bit

Remove arguments from the constructor.

For actions, we now default to COPY, which is the most common one
that we should enable by default (MOVE requires handling deletion
on the the source side, and ASK only makes sense if we have
multiple actions).

For the content provider, we add a new ::prepare signal where
it should be provided just-in-time.

5 years agodragsource: Tweak api, update all callers
Matthias Clasen [Mon, 6 Jan 2020 18:28:25 +0000 (13:28 -0500)]
dragsource: Tweak api, update all callers

Add GdkDrag back to signals, drop ::drag-data-delete,
and replace it with a boolean in ::drag-end.

5 years agogdk/x11: Forward suggested action (if any) to XdndStatus
Carlos Garnacho [Sun, 5 Jan 2020 19:20:20 +0000 (20:20 +0100)]
gdk/x11: Forward suggested action (if any) to XdndStatus

Go ahead with the suggested action, so the drag source may update
cursor feedback properly, and eventually result in the correct
action.

5 years agopopover: Use g_signal_connect_object on parent widget signal
Carlos Garnacho [Sun, 5 Jan 2020 19:17:38 +0000 (20:17 +0100)]
popover: Use g_signal_connect_object on parent widget signal

The popover may be destroyed, leaving this dangling signal. This
may cause crashes on future parent widget resizes.

5 years agoRemove gtk_drop_target_get_target
Matthias Clasen [Mon, 6 Jan 2020 05:36:51 +0000 (00:36 -0500)]
Remove gtk_drop_target_get_target

Now that drop targets are event controllers,
we can just use gtk_event_controller_get_widget.
Update all callers.

5 years agoRemove an unused signal
Matthias Clasen [Mon, 6 Jan 2020 05:29:17 +0000 (00:29 -0500)]
Remove an unused signal

5 years agodocs: Tweak GtkDropTarget docs
Matthias Clasen [Mon, 6 Jan 2020 05:29:02 +0000 (00:29 -0500)]
docs: Tweak GtkDropTarget docs

5 years agoMove code over
Matthias Clasen [Mon, 6 Jan 2020 05:21:41 +0000 (00:21 -0500)]
Move code over

Move remaining code from gtkdnd.c to gtkdragdest.c
and nuke gtkdnd.c and gtkdndprivate.h.

5 years agoReplace gtk_drop_target_attach/detach
Matthias Clasen [Mon, 6 Jan 2020 05:12:21 +0000 (00:12 -0500)]
Replace gtk_drop_target_attach/detach

Since drop targets are now just event controller,
gtk_widget_add/remove_controller works just fine
for them.

5 years agoUse normal event propagation for DND events
Matthias Clasen [Mon, 6 Jan 2020 04:49:22 +0000 (23:49 -0500)]
Use normal event propagation for DND events

This works just fine, now that drop targets are
event controllers. There is only a very vestigial
gtk_drag_dest_handle_event() left that deals with
corner cases.

5 years agoGet rid of GtkDragDestInfo
Matthias Clasen [Mon, 6 Jan 2020 04:09:26 +0000 (23:09 -0500)]
Get rid of GtkDragDestInfo

We can just attach the GtkDropTarget directly to
the GdkDrop.

5 years agoTurn GtkDropTarget into an event controller
Matthias Clasen [Mon, 6 Jan 2020 03:53:53 +0000 (22:53 -0500)]
Turn GtkDropTarget into an event controller

We are still propagating the drag events manually,
but we are now calling gtk_widget_run_controllers
to pass them to drop targets.

5 years agoMore internal restructuring
Matthias Clasen [Mon, 6 Jan 2020 02:17:46 +0000 (21:17 -0500)]
More internal restructuring

5 years agodnd: Another internal refactoring step
Matthias Clasen [Mon, 6 Jan 2020 02:08:27 +0000 (21:08 -0500)]
dnd: Another internal refactoring step

5 years agogdk: Make gdk_event_set_coords support dnd events
Matthias Clasen [Mon, 6 Jan 2020 02:07:40 +0000 (21:07 -0500)]
gdk: Make gdk_event_set_coords support dnd events

GTK event propagation code relies on this working.

5 years agodnd: More internal restructuring
Matthias Clasen [Mon, 6 Jan 2020 01:45:28 +0000 (20:45 -0500)]
dnd: More internal restructuring

5 years agodnd: Some internal restructuring
Matthias Clasen [Mon, 6 Jan 2020 01:39:32 +0000 (20:39 -0500)]
dnd: Some internal restructuring

Nudge the code towards being like event controllers.

5 years agoDrop an unused define
Matthias Clasen [Mon, 6 Jan 2020 01:31:58 +0000 (20:31 -0500)]
Drop an unused define

5 years agoStop passing timestamps around
Matthias Clasen [Mon, 6 Jan 2020 01:31:12 +0000 (20:31 -0500)]
Stop passing timestamps around

We were not using these in a useful way in the end,
so stop passing them around.

5 years agodroptarget: Drop the track-motion property
Matthias Clasen [Sun, 5 Jan 2020 22:27:26 +0000 (17:27 -0500)]
droptarget: Drop the track-motion property

It does not have any effect anymore.

Update all callers

5 years agodroptarget: Drop defaults flags
Matthias Clasen [Sun, 5 Jan 2020 22:23:50 +0000 (17:23 -0500)]
droptarget: Drop defaults flags

These no longer have any effect.

Update all callers.

5 years agoSimplify some drag dest internals
Matthias Clasen [Sun, 5 Jan 2020 20:54:46 +0000 (15:54 -0500)]
Simplify some drag dest internals

Change things around to make the default handler
of GtkDropTarget::drag-motion implement the default
handling. Always emit ::drag-motion and ::drag-leave,
and always arm the drop target.

This makes the GTK_DEST_DEFAULT_MOTION flag and
the ::track-motion property unnecessary.

Drop targets that are purely after track-motion
handling for ui switching purposes, such as
GtkStackSwitcher, will have to undo the automatic
arming in a notify::armed handler.

5 years agoDrop GTK_DEST_DEFAULT_HIGHLIGHT
Matthias Clasen [Sun, 5 Jan 2020 14:49:45 +0000 (09:49 -0500)]
Drop GTK_DEST_DEFAULT_HIGHLIGHT

Redo highlight handling slightly. GtkDropTarget now has
a ::armed property that can be tracked to do custom highlighting,
and we always add the dnd style class to armed drop sites.

5 years agodragdest: Clean up internals
Matthias Clasen [Sun, 5 Jan 2020 14:18:47 +0000 (09:18 -0500)]
dragdest: Clean up internals

Remove the no-longer needed GtkDragDest struct
and just attach the GtkDropTarget directly.

5 years agotestdnd2: Add a test for ASK handling
Matthias Clasen [Sat, 4 Jan 2020 17:09:58 +0000 (12:09 -0500)]
testdnd2: Add a test for ASK handling

It is a bit unfortunate that we need to extend the
lifespan of the drop object by keeping our own
ref, but I don't see a better way of doing it.

5 years agoRemove gtkdnd.h
Matthias Clasen [Fri, 3 Jan 2020 21:32:46 +0000 (16:32 -0500)]
Remove gtkdnd.h

5 years agoRemove gdk_drag_get_data
Matthias Clasen [Fri, 3 Jan 2020 21:26:15 +0000 (16:26 -0500)]
Remove gdk_drag_get_data

This is not used anymore, so we can remove it,
and the GtkDropTarget::drag-data-received signal
that it emits.

5 years agotreeview: Stop using ::drag-data-received
Matthias Clasen [Fri, 3 Jan 2020 21:15:22 +0000 (16:15 -0500)]
treeview: Stop using ::drag-data-received

5 years agoiconview: Avoid drag-data-received
Matthias Clasen [Fri, 3 Jan 2020 07:22:56 +0000 (02:22 -0500)]
iconview: Avoid drag-data-received

5 years agotesttreednd: Use the new asyn selection read
Matthias Clasen [Fri, 3 Jan 2020 06:06:28 +0000 (01:06 -0500)]
testtreednd: Use the new asyn selection read

5 years agotestlist3: Use async read api for selection
Matthias Clasen [Fri, 3 Jan 2020 05:46:31 +0000 (00:46 -0500)]
testlist3: Use async read api for selection

5 years agofilechooser: Convert to GtkDropTarget
Matthias Clasen [Thu, 2 Jan 2020 13:46:30 +0000 (08:46 -0500)]
filechooser: Convert to GtkDropTarget

5 years agoplacessidebar: Port to GtkDropTarget
Matthias Clasen [Thu, 2 Jan 2020 06:26:02 +0000 (01:26 -0500)]
placessidebar: Port to GtkDropTarget

5 years agoiconview: Port to GtkDropTarget
Matthias Clasen [Thu, 2 Jan 2020 06:00:44 +0000 (01:00 -0500)]
iconview: Port to GtkDropTarget

A small api change here is that
gtk_icon_view_enable_model_drag_dest now returns
a GtkDropTarget that can be used to connect signals.

5 years agoAdd an async read function for selection
Matthias Clasen [Fri, 3 Jan 2020 05:14:49 +0000 (00:14 -0500)]
Add an async read function for selection

This is meant as a replacement for ::drag-data-received
in cases where a #GtkSelectionData object is still needed,
such as when using GtkTreeModel DND support.

5 years agoRemove old drag dest api
Matthias Clasen [Thu, 2 Jan 2020 14:09:22 +0000 (09:09 -0500)]
Remove old drag dest api

5 years agoMove some remaining api over
Matthias Clasen [Thu, 2 Jan 2020 15:12:44 +0000 (10:12 -0500)]
Move some remaining api over

5 years agolistbox: Remove unhighlighting
Matthias Clasen [Thu, 2 Jan 2020 14:37:43 +0000 (09:37 -0500)]
listbox: Remove unhighlighting

This will have to be done differently, if necessary.

5 years agonotebook: Convert to GtkDropTarget
Matthias Clasen [Thu, 2 Jan 2020 14:01:20 +0000 (09:01 -0500)]
notebook: Convert to GtkDropTarget

5 years agotesttreednd: Convert to GtkDropTarget
Matthias Clasen [Thu, 2 Jan 2020 13:53:33 +0000 (08:53 -0500)]
testtreednd: Convert to GtkDropTarget

5 years agotestnotebookdnd: Fix, partially
Matthias Clasen [Thu, 2 Jan 2020 13:51:20 +0000 (08:51 -0500)]
testnotebookdnd: Fix, partially

Make this mostly work again.

5 years agotesttoolbar: Convert to GtkDropTarget
Matthias Clasen [Thu, 2 Jan 2020 13:37:06 +0000 (08:37 -0500)]
testtoolbar: Convert to GtkDropTarget

5 years agotestlist3: Convert to GtkDropTarget
Matthias Clasen [Thu, 2 Jan 2020 13:21:49 +0000 (08:21 -0500)]
testlist3: Convert to GtkDropTarget

5 years agotestdnd: Convert to GtkDropTarget
Matthias Clasen [Thu, 2 Jan 2020 06:46:26 +0000 (01:46 -0500)]
testdnd: Convert to GtkDropTarget

5 years agotestdnd2: Port to GtkDropTarget
Matthias Clasen [Thu, 2 Jan 2020 06:31:14 +0000 (01:31 -0500)]
testdnd2: Port to GtkDropTarget

5 years agotreeview: Port to GtkDropTarget
Matthias Clasen [Thu, 2 Jan 2020 05:40:35 +0000 (00:40 -0500)]
treeview: Port to GtkDropTarget

A small api change here is that
gtk_tree_view_enable_model_drag_dest now returns
a GtkDropTarget that can be used to connect signals.

5 years agotextview: Port to GtkDropTarget
Matthias Clasen [Thu, 2 Jan 2020 05:21:19 +0000 (00:21 -0500)]
textview: Port to GtkDropTarget

5 years agofilechoserbutton: Convert to GtkDropTarget
Matthias Clasen [Thu, 2 Jan 2020 06:51:07 +0000 (01:51 -0500)]
filechoserbutton: Convert to GtkDropTarget

5 years agostackswitcher: Port to GtkDropTarget
Matthias Clasen [Thu, 2 Jan 2020 05:21:01 +0000 (00:21 -0500)]
stackswitcher: Port to GtkDropTarget

5 years agoexpander: Port to GtkDropTarget
Matthias Clasen [Thu, 2 Jan 2020 04:28:51 +0000 (23:28 -0500)]
expander: Port to GtkDropTarget

5 years agowindow: Port to GtkDragDest
Matthias Clasen [Thu, 2 Jan 2020 04:28:33 +0000 (23:28 -0500)]
window: Port to GtkDragDest

5 years agotext: Port to GtkDropTarget
Matthias Clasen [Thu, 2 Jan 2020 01:47:19 +0000 (20:47 -0500)]
text: Port to GtkDropTarget

5 years agocolorswatch: Port to GtkDropTarget
Matthias Clasen [Wed, 1 Jan 2020 20:19:04 +0000 (15:19 -0500)]
colorswatch: Port to GtkDropTarget

5 years agocolorbutton: Port to GtkDropTarget
Matthias Clasen [Wed, 1 Jan 2020 19:40:49 +0000 (14:40 -0500)]
colorbutton: Port to GtkDropTarget

5 years agocalendar: Port to GtkDropTarget
Matthias Clasen [Wed, 1 Jan 2020 19:19:48 +0000 (14:19 -0500)]
calendar: Port to GtkDropTarget

5 years agogtk-demo: Convert clipboard demo to GtkDropTarget
Matthias Clasen [Wed, 1 Jan 2020 18:13:39 +0000 (13:13 -0500)]
gtk-demo: Convert clipboard demo to GtkDropTarget

5 years agodrop: Add a convenience api
Matthias Clasen [Thu, 2 Jan 2020 18:05:29 +0000 (13:05 -0500)]
drop: Add a convenience api

This is a question that drag-drop handlers frequently
need to answer, so make it easy.

5 years agodragdest: doc improvements
Matthias Clasen [Sun, 5 Jan 2020 14:36:02 +0000 (09:36 -0500)]
dragdest: doc improvements

5 years agoAdd a GtkDropTarget object
Matthias Clasen [Tue, 31 Dec 2019 06:54:43 +0000 (01:54 -0500)]
Add a GtkDropTarget object

Add an explicit GtkDropTarget object, and move the destination-side
DND signals here. The object is used by connecting to its signals
and attaching it to a widget with gtk_drop_target_attach().

5 years agoHook up the GtkDragSource docs
Matthias Clasen [Wed, 1 Jan 2020 19:08:14 +0000 (14:08 -0500)]
Hook up the GtkDragSource docs

5 years agoMove the rest of the drag-source api over
Matthias Clasen [Wed, 1 Jan 2020 18:22:29 +0000 (13:22 -0500)]
Move the rest of the drag-source api over

Just reshuffling some source.

5 years agodocs: Mention DND in the migration guide
Matthias Clasen [Wed, 1 Jan 2020 17:55:21 +0000 (12:55 -0500)]
docs: Mention DND in the migration guide