GNOME Bugzilla – Bug 721708
Drag destination Gtk-WARNING upon quitting the application
Last modified: 2016-01-16 13:18:21 UTC
To reproduce: open and then quit the application. A Gtk-warning is logged as follows: (nfoview:11749): Gtk-WARNING **: Can't set a target list on a widget until you've called gtk_drag_dest_set() to make the widget into a drag destination This happens regardless of whether an nfo file was ever opened or not. The method of opening files (command line argument, loaded through file opening dialog, or drag and drop) also doesn't make any difference. Apart from the warning itself there do not appear to be any negative side effects to usability, hence the low severity. Reported in Debian as http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=731741 - please see there for versions of dependencies etc.
I'm aware of this warning, it has existed since some particular gtk version. The cause of the warning is calling 'drag_dest_unset' on the text view to disable some text view default drag handling thus relaying the drag event to be handled by the window, which I'm using as the drag destination so that you can drop a file on the menubar as well. I don't really understand the warning, my best guess is that gtk tries to set some default drag targets for that text view (after initialization!?) and it fails because the destination has been unset. As you note, the warning is harmless, drag-and-drop and everything else works fine. If someone has a simple fix for this, I'll gladly accept it, but I don't want a complicated work-around for a harmless warning.
Thanks for your quick response. Unfortunately, my knowledge of the inner workings of gtk is non-existent, so I can only wonder why it would try to set default targets for anything on shutdown. I'll leave the debian bug report open as a means of tracking possible future progress and preventing duplicates.
I don't see this anymore with Gtk 3.18.
the Downstream bug-reporter here. I still see this. I am on Debian-mate desktop. Specifically Mate 3.10.2 . I do not know which version of GTK it uses by default. I do have GNOME 3.18 installed as well but use MATE exclusively (as it uses/eats less RAM).
Could you check the version libgtk-3-0 you have installed? e.g. with "apt-cache policy libgtk-3-0" at the command line.
Still shows up in ubuntu 16.04 alpha, with nfoview 1.17 and libgtk-3-0 at 3.18.6-1ubuntu1.
OK, reopening. I also have GTK+ 3.18.6, but I don't see this. If the bug has disappeared with some update, it could also be due to a change in GObject, GLib, or something else.
Upon closer look, with GTK+ 3.18 (or maybe since we switched to use Gtk.Application?), this warning seems to only appear when clicking the window close icon, not when hitting Ctrl+W or Ctrl+Q or the equivalent menu items. This led me to a work-around, which seems to work for me. https://github.com/otsaloma/nfoview/commit/4f9420ebdc99ffb6cd722904e158efd6be8cb537 Could someone else test this as well, preferrably with GTK+ 3.18? Just get the code from GitHub, open a terminal in the source directory and run "python3 bin/nfoview". Check all three ways of closing a window: Ctrl+W, Ctrl+Q and the window close icon. https://github.com/otsaloma/nfoview/archive/master.zip
Using the exact same test system as in my previous comment, your workaround removes the warning.
Thanks. I'll close the bug and make a new release maybe in a week or so.