1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2
# Copyright 2012 Canonical
3
# Author: Marco Trevisan (Treviño)
5
# This program is free software: you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 3, as published
7
# by the Free Software Foundation.
10
from __future__ import absolute_import
13
from autopilot.keybindings import KeybindingsHelper
14
from autopilot.introspection.unity import UnityIntrospectionObject
16
logger = logging.getLogger(__name__)
19
class WindowManager(UnityIntrospectionObject, KeybindingsHelper):
20
"""The WindowManager class."""
23
def screen_geometry(self):
24
"""Returns a tuple of (x,y,w,h) for the screen."""
25
return (self.x, self.y, self.width, self.height)
27
def enter_show_desktop(self):
28
if not self.showdesktop_active:
29
self.keybinding("window/show_desktop")
30
self.showdesktop_active.wait_for(True)
32
def leave_show_desktop(self):
33
if self.showdesktop_active:
34
self.keybinding("window/show_desktop")
35
self.showdesktop_active.wait_for(False)