[polari/wip/fmuellner/drop-target: 5/6] pasteManager: Use connect_after() to receive drag data



commit 645089eb776ad3e617d7fd8f7562f981d339d2ae
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri May 6 15:24:31 2016 +0200

    pasteManager: Use connect_after() to receive drag data
    
    GTK+'s text widgets already have built-in DND support which may conflict
    with our own drop target support. Currently that is not an issue, as the
    chat log is not editable, which disables the built-in support. However we
    want to extend the entry's built-in drop target support as well, where
    this will be an issue - in particular as it should use either the regular
    or our custom support.
    Running our custom GtkWidget::drag-data-received handler after the object
    method handler will allow classes to do that by either making the built-in
    handler a NOOP or stopping the signal emission.

 src/pasteManager.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/pasteManager.js b/src/pasteManager.js
index c055d92..7b2a576 100644
--- a/src/pasteManager.js
+++ b/src/pasteManager.js
@@ -118,8 +118,8 @@ const DropTargetIface = new Lang.Interface({
         widget.connect('drag-drop', Lang.bind(this, this._onDragDrop));
         widget.connect('drag-leave', Lang.bind(this, this._onDragLeave));
         widget.connect('drag-motion', Lang.bind(this, this._onDragMotion));
-        widget.connect('drag-data-received',
-                       Lang.bind(this, this._onDragDataReceived));
+        widget.connect_after('drag-data-received',
+                             Lang.bind(this, this._onDragDataReceived));
     },
 
     _onDragDrop: function(widget, context, x, y, time) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]