diff --git a/src/sugar3/graphics/palettewindow.py b/src/sugar3/graphics/palettewindow.py
index c48ae55..d3d0e99 100644
a
|
b
|
import math |
29 | 29 | from gi.repository import Gdk |
30 | 30 | from gi.repository import Gtk |
31 | 31 | from gi.repository import GObject |
| 32 | from gi.repository import GLib |
32 | 33 | |
33 | 34 | from gi.repository import SugarGestures |
34 | 35 | from sugar3.graphics import palettegroup |
35 | 36 | from sugar3.graphics import animator |
36 | 37 | from sugar3.graphics import style |
37 | 38 | |
| 39 | _RECONNECT_TIMEOUT = 300 |
| 40 | |
38 | 41 | |
39 | 42 | def _calculate_gap(a, b): |
40 | 43 | """Helper function to find the gap position and size of widget a""" |
… |
… |
class PaletteWindow(GObject.GObject): |
675 | 678 | def _invoker_toggle_state_cb(self, invoker): |
676 | 679 | if self.is_up() and self._palette_state == self.SECONDARY: |
677 | 680 | self.popdown(immediate=True) |
| 681 | self._invoker.disconnect_then_connect_delayed() |
678 | 682 | else: |
679 | 683 | self.popup(immediate=True, state=self.SECONDARY) |
680 | 684 | |
… |
… |
class WidgetInvoker(Invoker): |
1102 | 1106 | self._long_pressed_controller.detach(self._widget) |
1103 | 1107 | self._long_pressed_controller.disconnect(self._long_pressed_hid) |
1104 | 1108 | |
| 1109 | def disconnect_then_connect_delayed(self): |
| 1110 | def reconnect(): |
| 1111 | self._release_hid = self._widget.connect('button-release-event', |
| 1112 | self.__button_release_event_cb) |
| 1113 | if GObject.signal_lookup('clicked', self._widget) != 0: |
| 1114 | self._click_hid = self._widget.connect('clicked', |
| 1115 | self.__click_event_cb) |
| 1116 | |
| 1117 | self._widget.disconnect(self._release_hid) |
| 1118 | if self._click_hid: |
| 1119 | self._widget.disconnect(self._click_hid) |
| 1120 | GLib.timeout_add(_RECONNECT_TIMEOUT, reconnect) |
| 1121 | |
1105 | 1122 | def get_rect(self): |
1106 | 1123 | allocation = self._widget.get_allocation() |
1107 | 1124 | window = self._widget.get_window() |