/usr/share/cinnamon-screensaver/baseWindow.py is in cinnamon-screensaver 3.2.13-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | #! /usr/bin/python3
from gi.repository import Gtk, GObject, Gdk
from util import trackers
class BaseWindow(Gtk.Revealer):
"""
BaseWindow is the base class for all of the Stage GtkOverlay's immediate
children. It provides functionality for smooth fade-in and -out.
"""
REVEALER_DURATION = 250
def __init__(self, *args):
super(BaseWindow, self).__init__()
self.disabled = False
c = Gdk.RGBA(0, 0, 0, 0)
self.override_background_color (Gtk.StateFlags.NORMAL, c);
self.set_transition_type(Gtk.RevealerTransitionType.CROSSFADE)
self.set_transition_duration(self.REVEALER_DURATION)
def _reveal_idle_callback(self):
self.show_all()
self.set_reveal_child(True)
def reveal(self):
if self.disabled:
return
GObject.idle_add(self._reveal_idle_callback)
def unreveal(self):
if self.disabled:
return
GObject.idle_add(self.set_reveal_child, False)
def blink(self):
self.set_reveal_child(False)
GObject.timeout_add(self.REVEALER_DURATION + 10, self._blink_callback)
def _blink_callback(self):
self.set_reveal_child(True)
return False
def destroy_window(self):
trackers.con_tracker_get().connect_after(self,
"notify::child-revealed",
self.destroy_after_hiding)
self.unreveal()
def destroy_after_hiding(self, pspec, data):
trackers.con_tracker_get().disconnect(self,
"notify::child-revealed",
self.destroy_after_hiding)
self.destroy()
def update_geometry(self):
self.rect = self.screen.get_monitor_geometry(self.monitor_index)
|