Cleanups of the frame activation code.
Do not hide the frame on clicks.
This commit is contained in:
parent
0ef5c4b891
commit
4f72fd1c27
@ -138,7 +138,6 @@ class Frame(object):
|
|||||||
self._shell = shell
|
self._shell = shell
|
||||||
self._current_position = 0.0
|
self._current_position = 0.0
|
||||||
self._animator = None
|
self._animator = None
|
||||||
self._hover = False
|
|
||||||
|
|
||||||
self._event_area = EventArea()
|
self._event_area = EventArea()
|
||||||
self._event_area.connect('enter', self._enter_corner_cb)
|
self._event_area.connect('enter', self._enter_corner_cb)
|
||||||
@ -289,24 +288,14 @@ class Frame(object):
|
|||||||
gobject.timeout_add(2000, lambda: self.hide())
|
gobject.timeout_add(2000, lambda: self.hide())
|
||||||
|
|
||||||
def _enter_notify_cb(self, window, event):
|
def _enter_notify_cb(self, window, event):
|
||||||
# FIXME clicks cause leave/notify, ignore
|
if event.detail != gtk.gdk.NOTIFY_INFERIOR:
|
||||||
if event.state == gtk.gdk.BUTTON1_MASK:
|
self._mouse_listener.mouse_enter()
|
||||||
return
|
|
||||||
if self._hover:
|
|
||||||
return
|
|
||||||
|
|
||||||
self._hover = True
|
|
||||||
self._mouse_listener.mouse_enter()
|
|
||||||
|
|
||||||
def _leave_notify_cb(self, window, event):
|
def _leave_notify_cb(self, window, event):
|
||||||
# FIXME clicks cause leave/notify, ignore
|
if event.detail == gtk.gdk.NOTIFY_INFERIOR:
|
||||||
if event.state == gtk.gdk.BUTTON1_MASK:
|
|
||||||
return
|
|
||||||
if not self._hover:
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if not self._is_hover() and not self._palette_group.is_up():
|
if not self._is_hover() and not self._palette_group.is_up():
|
||||||
self._hover = False
|
|
||||||
self._mouse_listener.mouse_leave()
|
self._mouse_listener.mouse_leave()
|
||||||
|
|
||||||
def _palette_group_popdown_cb(self, group):
|
def _palette_group_popdown_cb(self, group):
|
||||||
|
@ -93,10 +93,12 @@ class FrameWindow(gtk.Window):
|
|||||||
self.window.set_accept_focus(False)
|
self.window.set_accept_focus(False)
|
||||||
|
|
||||||
def _enter_notify_cb(self, window, event):
|
def _enter_notify_cb(self, window, event):
|
||||||
self.hover = True
|
if event.detail != gtk.gdk.NOTIFY_INFERIOR:
|
||||||
|
self.hover = True
|
||||||
|
|
||||||
def _leave_notify_cb(self, window, event):
|
def _leave_notify_cb(self, window, event):
|
||||||
self.hover = False
|
if event.detail != gtk.gdk.NOTIFY_INFERIOR:
|
||||||
|
self.hover = False
|
||||||
|
|
||||||
def _size_changed_cb(self, screen):
|
def _size_changed_cb(self, screen):
|
||||||
self._update_size()
|
self._update_size()
|
||||||
|
Loading…
Reference in New Issue
Block a user