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

Commit d012070

Browse files
authored
Merge pull request #9114 from mono/fix-998490
Don't start Drag in cases of no currentEvent from Gtk
2 parents 4fd225a + 9fdbbcf commit d012070

File tree

1 file changed

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

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,12 @@ 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-
Gtk.Drag.Begin (widget, targets, Gdk.DragAction.Copy | Gdk.DragAction.Move, 1, new Gdk.Event (currentEvent, false));
133+
if (currentEvent != IntPtr.Zero) {
134+
Gtk.Drag.Begin (widget, targets, Gdk.DragAction.Copy | Gdk.DragAction.Move, 1, new Gdk.Event (currentEvent, false));
134135

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

0 commit comments

Comments
 (0)