Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit cc1cb1f

Browse files
authored
Merge pull request #9278 from mono/backport-pr-9276-to-release-8.4
[release-8.4] Fixes drag and drop in toolbox when current event is IntPtr.Zero
2 parents 88a8f27 + ba9ffe4 commit cc1cb1f

File tree

1 file changed

+3
-5
lines changed
  • main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport

1 file changed

+3
-5
lines changed

main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxPad.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,10 @@ void Toolbox_DragBegin (object sender, EventArgs args)
130130
// Gtk.Application.CurrentEvent and other copied gdk_events seem to have a problem
131131
// when used as they use gdk_event_copy which seems to crash on de-allocating the private slice.
132132
IntPtr currentEvent = GtkWorkarounds.GetCurrentEventHandle ();
133-
if (currentEvent != IntPtr.Zero) {
134-
Gtk.Drag.Begin (widget, targets, Gdk.DragAction.Copy | Gdk.DragAction.Move, 1, new Gdk.Event (currentEvent, false));
133+
Gtk.Drag.Begin (widget, targets, Gdk.DragAction.Copy | Gdk.DragAction.Move, 1, new Gdk.Event (currentEvent, false));
135134

136-
// gtk_drag_begin does not store the event, so we're okay
137-
GtkWorkarounds.FreeEvent (currentEvent);
138-
}
135+
// gtk_drag_begin does not store the event, so we're okay
136+
GtkWorkarounds.FreeEvent (currentEvent);
139137
}
140138
}
141139

0 commit comments

Comments
 (0)