Philipp Hörist pushed to branch master at gajim / gajim


Commits:
e3a787f6 by wurstsalat at 2020-11-01T10:33:51+01:00
HtmlTextview: Fix warning regarding TargetList on destroy

- - - - -


1 changed file:

- gajim/gtk/htmltextview.py


Changes:

=====================================
gajim/gtk/htmltextview.py
=====================================
@@ -716,6 +716,7 @@ def __init__(self, account, standalone=False):
         self.drag_dest_unset()
 
         self.connect('copy-clipboard', self._on_copy_clipboard)
+        self.connect('destroy', self._on_destroy)
         self.get_buffer().eol_tag = self.get_buffer().create_tag('eol')
 
         self.account = account
@@ -726,6 +727,17 @@ def __init__(self, account, standalone=False):
             self.connect('query-tooltip', self._query_tooltip)
             self.create_tags()
 
+    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 create_tags(self):
         color = app.css_config.get_value('.gajim-url', StyleAttr.COLOR)
 



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/e3a787f6b9d81e702f9eb2982fdd57b69a6b8525

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/e3a787f6b9d81e702f9eb2982fdd57b69a6b8525
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to