Replace signal used in UnfullscreenButton to enable use with touch - SL #3798

Use clicked instead of button-pressed-event, because button-pressed-event
and the button-release-event are not emitted on a touchscreen device by
a touch in GTK+ 3.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Acked-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
This commit is contained in:
Gonzalo Odiard 2012-08-09 13:09:31 -03:00 committed by Simon Schampijer
parent f70075323c
commit 6532b2d4dd

View File

@ -65,8 +65,8 @@ class UnfullscreenButton(Gtk.Window):
self._button.show() self._button.show()
self.add(self._button) self.add(self._button)
def connect_button_press(self, cb): def connect_button_clicked(self, cb):
self._button.connect('button-press-event', cb) self._button.connect('clicked', cb)
def _reposition(self): def _reposition(self):
x = Gdk.Screen.width() - self._width x = Gdk.Screen.width() - self._width
@ -114,8 +114,8 @@ class Window(Gtk.Window):
self._is_fullscreen = False self._is_fullscreen = False
self._unfullscreen_button = UnfullscreenButton() self._unfullscreen_button = UnfullscreenButton()
self._unfullscreen_button.set_transient_for(self) self._unfullscreen_button.set_transient_for(self)
self._unfullscreen_button.connect_button_press( self._unfullscreen_button.connect_button_clicked(
self.__unfullscreen_button_pressed) self.__unfullscreen_button_clicked)
self._unfullscreen_button_timeout_id = None self._unfullscreen_button_timeout_id = None
def reveal(self): def reveal(self):
@ -253,7 +253,7 @@ class Window(Gtk.Window):
return True return True
return False return False
def __unfullscreen_button_pressed(self, widget, event): def __unfullscreen_button_clicked(self, button):
self.unfullscreen() self.unfullscreen()
def __motion_notify_cb(self, widget, event): def __motion_notify_cb(self, widget, event):