F11 now put the activities window in fullscreen,
This commit is contained in:
parent
122c0dad16
commit
9c4da3c172
@ -22,7 +22,7 @@ class Chat(gtk.Window):
|
|||||||
SERVICE_PORT = 6100
|
SERVICE_PORT = 6100
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
gtk.Window.__init__(self)
|
gtk.Window.__init__(self, gtk.WINDOW_POPUP)
|
||||||
|
|
||||||
self._stream_writer = None
|
self._stream_writer = None
|
||||||
|
|
||||||
|
@ -11,10 +11,7 @@ class PresenceWindow(gtk.Window):
|
|||||||
_MODEL_COL_BUDDY = 2
|
_MODEL_COL_BUDDY = 2
|
||||||
|
|
||||||
def __init__(self, activity_container):
|
def __init__(self, activity_container):
|
||||||
gtk.Window.__init__(self)
|
gtk.Window.__init__(self, gtk.WINDOW_POPUP)
|
||||||
|
|
||||||
self.set_decorated(False)
|
|
||||||
self.set_skip_taskbar_hint(True)
|
|
||||||
|
|
||||||
self._activity_container = activity_container
|
self._activity_container = activity_container
|
||||||
|
|
||||||
|
@ -15,12 +15,49 @@ class WindowManager:
|
|||||||
ABSOLUTE = 0
|
ABSOLUTE = 0
|
||||||
SCREEN_RELATIVE = 1
|
SCREEN_RELATIVE = 1
|
||||||
|
|
||||||
|
VISIBLE = 0
|
||||||
|
SLIDED_IN = 1
|
||||||
|
HIDDEN = 2
|
||||||
|
|
||||||
def __init__(self, window):
|
def __init__(self, window):
|
||||||
self._window = window
|
self._window = window
|
||||||
window.connect("key-press-event", self.__key_press_event_cb)
|
self._visibility = WindowManager.HIDDEN
|
||||||
|
|
||||||
WindowManager.__managers_list.append(self)
|
WindowManager.__managers_list.append(self)
|
||||||
|
|
||||||
|
window.connect("key-press-event", self.__key_press_event_cb)
|
||||||
|
window.connect("focus-in-event", self.__focus_in_event_cb)
|
||||||
|
window.connect_after("focus-out-event", self.__focus_out_event_cb)
|
||||||
|
|
||||||
|
def has_focus(self):
|
||||||
|
return self._window.has_toplevel_focus()
|
||||||
|
|
||||||
|
def _update_visibility(self):
|
||||||
|
visible = False
|
||||||
|
|
||||||
|
if self._visibility is WindowManager.VISIBLE:
|
||||||
|
visible = True
|
||||||
|
elif self._visibility is WindowManager.HIDDEN:
|
||||||
|
visible = False
|
||||||
|
elif self._visibility is WindowManager.SLIDED_IN:
|
||||||
|
for manager in WindowManager.__managers_list:
|
||||||
|
if manager.has_focus():
|
||||||
|
visible = True
|
||||||
|
|
||||||
|
if self._window.get_property('visible') != visible:
|
||||||
|
self._window.set_property('visible', visible)
|
||||||
|
|
||||||
|
def __focus_change_idle(self):
|
||||||
|
for manager in WindowManager.__managers_list:
|
||||||
|
manager._update_visibility()
|
||||||
|
return False
|
||||||
|
|
||||||
|
def __focus_in_event_cb(self, window, event):
|
||||||
|
gobject.idle_add(self.__focus_change_idle)
|
||||||
|
|
||||||
|
def __focus_out_event_cb(self, window, event):
|
||||||
|
gobject.idle_add(self.__focus_change_idle)
|
||||||
|
|
||||||
def __key_press_event_cb(self, window, event):
|
def __key_press_event_cb(self, window, event):
|
||||||
manager = None
|
manager = None
|
||||||
|
|
||||||
@ -80,13 +117,16 @@ class WindowManager:
|
|||||||
self._window.resize(width, height)
|
self._window.resize(width, height)
|
||||||
|
|
||||||
def slide_window_in(self):
|
def slide_window_in(self):
|
||||||
self._window.show()
|
self._visibility = WindowManager.SLIDED_IN
|
||||||
|
self._update_visibility()
|
||||||
|
|
||||||
def slide_window_out(self):
|
def slide_window_out(self):
|
||||||
self._window.hide()
|
self._visibility = WindowManager.HIDDEN
|
||||||
|
self._update_visibility()
|
||||||
|
|
||||||
def show(self):
|
def show(self):
|
||||||
self._window.show()
|
self._visibility = WindowManager.VISIBLE
|
||||||
|
|
||||||
def manage(self):
|
def manage(self):
|
||||||
self._update_size_and_position()
|
self._update_size_and_position()
|
||||||
|
self._update_visibility()
|
||||||
|
Loading…
Reference in New Issue
Block a user