screeninfo and display are no more
This commit is contained in:
parent
ec575f229b
commit
3c82ae888d
1 changed files with 4 additions and 11 deletions
|
@ -127,7 +127,7 @@ class _Cycle:
|
||||||
|
|
||||||
# show or hide the list and its child widgets
|
# show or hide the list and its child widgets
|
||||||
if len(self.items) > 1:
|
if len(self.items) > 1:
|
||||||
size = self.screeninfo.size()
|
size = self.screen.size()
|
||||||
self.widget.moveresize(otk.Rect((size.width() - width) / 2,
|
self.widget.moveresize(otk.Rect((size.width() - width) / 2,
|
||||||
(size.height() - height) / 2,
|
(size.height() - height) / 2,
|
||||||
width, height))
|
width, height))
|
||||||
|
@ -145,7 +145,6 @@ class _Cycle:
|
||||||
preferably caching it. Data is what's given to callback functions.
|
preferably caching it. Data is what's given to callback functions.
|
||||||
"""
|
"""
|
||||||
self.screen = ob.openbox.screen(data.screen)
|
self.screen = ob.openbox.screen(data.screen)
|
||||||
self.screeninfo = otk.display.screenInfo(data.screen)
|
|
||||||
|
|
||||||
def chooseStartPos(self):
|
def chooseStartPos(self):
|
||||||
"""Set self.menupos to a number between 0 and len(self.items) - 1.
|
"""Set self.menupos to a number between 0 and len(self.items) - 1.
|
||||||
|
@ -346,17 +345,13 @@ class _CycleWindows(_Cycle):
|
||||||
# move the to client's desktop if required
|
# move the to client's desktop if required
|
||||||
if not (client.iconic() or client.desktop() == 0xffffffff or \
|
if not (client.iconic() or client.desktop() == 0xffffffff or \
|
||||||
client.desktop() == self.screen.desktop()):
|
client.desktop() == self.screen.desktop()):
|
||||||
root = self.screeninfo.rootWindow()
|
self.screen.changeDesktop(client.desktop())
|
||||||
ob.send_client_msg(root, otk.atoms.net_current_desktop,
|
|
||||||
root, client.desktop())
|
|
||||||
|
|
||||||
# send a net_active_window message for the target
|
# send a net_active_window message for the target
|
||||||
if final or not client.iconic():
|
if final or not client.iconic():
|
||||||
if final: r = self.RAISE_WINDOW
|
if final: r = self.RAISE_WINDOW
|
||||||
else: r = 0
|
else: r = 0
|
||||||
ob.send_client_msg(self.screeninfo.rootWindow(),
|
client.focus(final, r)
|
||||||
otk.atoms.openbox_active_window,
|
|
||||||
client.window(), final, r)
|
|
||||||
if not final:
|
if not final:
|
||||||
focus._skip += 1
|
focus._skip += 1
|
||||||
|
|
||||||
|
@ -468,9 +463,7 @@ class _CycleDesktops(_Cycle):
|
||||||
desktop = self.items[self.menupos]
|
desktop = self.items[self.menupos]
|
||||||
except IndexError: return
|
except IndexError: return
|
||||||
|
|
||||||
root = self.screeninfo.rootWindow()
|
self.screen.changeDesktop(desktop.index)
|
||||||
ob.send_client_msg(root, otk.atoms.net_current_desktop,
|
|
||||||
root, desktop.index)
|
|
||||||
|
|
||||||
CycleDesktops = _CycleDesktops()
|
CycleDesktops = _CycleDesktops()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue