Skip to content
Snippets Groups Projects
Commit 53d6c8c2 authored by Daniel Brötzmann's avatar Daniel Brötzmann
Browse files

MessageInputTextView: Fix GTK warning when closing chat control

Fixes #10146
parent 1cb58072
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GLib
from gi.repository import GObject
from gi.repository import Pango
......@@ -108,6 +109,18 @@ def __init__(self):
self.connect('focus-in-event', self._on_grab_focus)
self.connect('grab-focus', self._on_grab_focus)
self.connect('focus-out-event', self._on_focus_out)
self.connect('destroy', self._on_destroy)
def _on_destroy(self, *args):
# We restore the TextView’s drag destination to avoid a GTK warning
# when closing the control. ChatControlBase.shutdown() calls destroy()
# on the control’s main box, causing GTK to recursively destroy the
# child widgets. GTK then tries to set a target list on the TextView,
# resulting in a warning because the Widget has no drag destination.
self.drag_dest_set(
Gtk.DestDefaults.ALL,
None,
Gdk.DragAction.DEFAULT)
def _on_buffer_changed(self, *args):
text = self.get_text()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment