Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
53d6c8c2
by wurstsalat at 2020-09-13T10:58:43+02:00
1 changed file:
Changes:
| ... | ... | @@ -18,6 +18,7 @@ |
| 18 | 18 |
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
|
| 19 | 19 |
|
| 20 | 20 |
from gi.repository import Gtk
|
| 21 |
+from gi.repository import Gdk
|
|
| 21 | 22 |
from gi.repository import GLib
|
| 22 | 23 |
from gi.repository import GObject
|
| 23 | 24 |
from gi.repository import Pango
|
| ... | ... | @@ -108,6 +109,18 @@ class MessageInputTextView(Gtk.TextView): |
| 108 | 109 |
self.connect('focus-in-event', self._on_grab_focus)
|
| 109 | 110 |
self.connect('grab-focus', self._on_grab_focus)
|
| 110 | 111 |
self.connect('focus-out-event', self._on_focus_out)
|
| 112 |
+ self.connect('destroy', self._on_destroy)
|
|
| 113 |
+ |
|
| 114 |
+ def _on_destroy(self, *args):
|
|
| 115 |
+ # We restore the TextView’s drag destination to avoid a GTK warning
|
|
| 116 |
+ # when closing the control. ChatControlBase.shutdown() calls destroy()
|
|
| 117 |
+ # on the control’s main box, causing GTK to recursively destroy the
|
|
| 118 |
+ # child widgets. GTK then tries to set a target list on the TextView,
|
|
| 119 |
+ # resulting in a warning because the Widget has no drag destination.
|
|
| 120 |
+ self.drag_dest_set(
|
|
| 121 |
+ Gtk.DestDefaults.ALL,
|
|
| 122 |
+ None,
|
|
| 123 |
+ Gdk.DragAction.DEFAULT)
|
|
| 111 | 124 |
|
| 112 | 125 |
def _on_buffer_changed(self, *args):
|
| 113 | 126 |
text = self.get_text()
|