Changeset 11311:13976e39b13f in orange


Ignore:
Timestamp:
02/14/13 17:12:33 (14 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Children:
11315:b2956eaa2e6a, 11320:4a8d643fe709, 11322:139b5656b465
Message:

Fixed 'is_dwm_compositing_enabled' function check.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/gui/utils.py

    r11232 r11311  
    8282        return False 
    8383    elif sys.platform == "darwin": 
    84         try: 
    85             # Test if Qt was build against X11. 
    86             from PyQt4.QtGui import QX11Info 
    87             return QX11Info.isCompositingManagerRunning() 
    88         except ImportError: 
    89             # Assuming Quartz compositor is running. 
     84        if has_x11(): 
     85            return is_x11_compositing_enabled() 
     86        else: 
     87            # Quartz compositor 
    9088            return True 
    9189    elif sys.platform.startswith("linux"): 
     
    9492    elif sys.platform.startswith("freebsd"): 
    9593        return is_x11_compositing_enabled() 
    96     elif os.name == "": 
    97         # Any other system (Win, OSX) is assumed to support it 
     94    elif has_x11(): 
     95        return is_x11_compositing_enabled() 
     96    else: 
     97        return False 
     98 
     99 
     100def has_x11(): 
     101    """ 
     102    Is Qt build against X11 server. 
     103    """ 
     104    try: 
     105        from PyQt4.QtGui import QX11Info 
    98106        return True 
     107    except ImportError: 
     108        return False 
    99109 
    100110 
     
    118128    try: 
    119129        DwmIsCompositionEnabled = ctypes.windll.dwmapi.DwmIsCompositionEnabled 
    120     except AttributeError: 
     130    except (AttributeError, WindowsError): 
    121131        # dwmapi or DwmIsCompositionEnabled is not present 
    122132        return False 
Note: See TracChangeset for help on using the changeset viewer.