~jaytaoko/unity/unity.coverflow.fix

« back to all changes in this revision

Viewing changes to tests/autopilot/unity/emulators/window_manager.py

  • Committer: Jay Taoko
  • Date: 2012-06-14 18:07:29 UTC
  • mfrom: (1897.2.513 unity)
  • Revision ID: jay.taoko@canonical.com-20120614180729-mk56rx7i432uteok
Fixing Coverflow

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
 
2
# Copyright 2012 Canonical
 
3
# Author: Marco Trevisan (Treviño)
 
4
#
 
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.
 
8
#
 
9
 
 
10
from __future__ import absolute_import
 
11
 
 
12
import logging
 
13
from autopilot.keybindings import KeybindingsHelper
 
14
from autopilot.introspection.unity import UnityIntrospectionObject
 
15
 
 
16
logger = logging.getLogger(__name__)
 
17
 
 
18
 
 
19
class WindowManager(UnityIntrospectionObject, KeybindingsHelper):
 
20
    """The WindowManager class."""
 
21
 
 
22
    @property
 
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)
 
26
 
 
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)
 
31
 
 
32
    def leave_show_desktop(self):
 
33
        if self.showdesktop_active:
 
34
            self.keybinding("window/show_desktop")
 
35
            self.showdesktop_active.wait_for(False)