Commit 13578c7e authored by Florian Müllner's avatar Florian Müllner
Browse files

pasteManager: Catch newly-added gjs exception

gjs 1.58.2 started throwing an exception when encountering a parameter that
is an array of plain structs, as that case is not currently supported.

The exception is overly broad though, and also broke the one case that is
supported: An empty array where the actually struct type isn't relevant.

We cannot fix this in Polari, but at least we can catch the exception to
fail gracefully, so only DND drop target support gets broken instead of
the whole interface.

GNOME/polari#114
parent 5b8ac8c0
Pipeline #133491 passed with stages
in 9 minutes and 7 seconds
......@@ -87,7 +87,15 @@ var DropTargetIface = GObject.registerClass({
addTargets(widget) {
this._dragHighlight = false;
widget.drag_dest_set(0, [], Gdk.DragAction.COPY);
// Broken in gjs 1.58.2
try {
widget.drag_dest_set(0, [], Gdk.DragAction.COPY);
} catch (e) {
if (!DropTargetIface.__brokenWarning)
log('Failed to set up DND drop target.');
DropTargetIface.__brokenWarning = true;
return;
}
let targetList = widget.drag_dest_get_target_list();
if (!targetList)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment