def deopacify(self): # always called from deopacify_request (with timeout) # If another window button has called opacify, don't deopacify. if self.globals.opacified and not self.opacified: return False if self.globals.opacity_values is None: return False try: compiz_call('obs/screen0/opacity_values','set', self.globals.opacity_values) compiz_call('obs/screen0/opacity_matches','set', self.globals.opacity_matches) except: try: compiz_call('core/screen0/opacity_values','set', self.globals.opacity_values) compiz_call('core/screen0/opacity_matches','set', self.globals.opacity_matches) except: print "Error: Couldn't set opacity back to normal." self.globals.opacity_values = None self.globals.opacity_matches = None return False
def opacify(self): # Makes all windows but the one connected # to this windowbutton transparent. if self.globals.opacity_values is None: try: self.globals.opacity_values = compiz_call( 'obs/screen0/opacity_values','get') except: try: self.globals.opacity_values = compiz_call( 'core/screen0/opacity_values','get') except: return if self.globals.opacity_matches is None: try: self.globals.opacity_matches = compiz_call( 'obs/screen0/opacity_matches','get') except: try: self.globals.opacity_matches = compiz_call( 'core/screen0/opacity_matches','get') except: return self.globals.opacified = True self.opacified = True ov = [self.globals.settings['opacify_alpha']] om = ["!(xid=%s)"%self.window.get_xid() + \ " & !(class=Dockbarx_factory.py) & (type=Normal | type=Dialog)"] try: compiz_call('obs/screen0/opacity_values','set', ov) compiz_call('obs/screen0/opacity_matches','set', om) except: try: compiz_call('core/screen0/opacity_values','set', ov) compiz_call('core/screen0/opacity_matches','set', om) except: return