Ejemplo n.º 1
0
 def do_setup_xprops(self, *args):
     log("do_setup_xprops(%s)", args)
     ROOT_PROPS = [
         "RESOURCE_MANAGER", "_NET_WORKAREA", "_NET_CURRENT_DESKTOP"
     ]
     try:
         self.init_x11_filter()
         from xpra.gtk_common.gtk_util import get_default_root_window
         from xpra.x11.xsettings import XSettingsWatcher
         from xpra.x11.xroot_props import XRootPropWatcher
         root = get_default_root_window()
         if self._xsettings_watcher is None:
             self._xsettings_watcher = XSettingsWatcher()
             self._xsettings_watcher.connect("xsettings-changed",
                                             self._handle_xsettings_changed)
             self._handle_xsettings_changed()
         if self._root_props_watcher is None:
             self._root_props_watcher = XRootPropWatcher(ROOT_PROPS, root)
             self._root_props_watcher.connect(
                 "root-prop-changed", self._handle_root_prop_changed)
             #ensure we get the initial value:
             self._root_props_watcher.do_notify("RESOURCE_MANAGER")
     except ImportError as e:
         log("do_setup_xprops%s", args, exc_info=True)
         log.error(
             "Error: failed to load X11 properties/settings bindings:")
         log.error(" %s", e)
         log.error(" root window properties will not be propagated")
Ejemplo n.º 2
0
 def do_setup_xprops(self, *args):
     log("do_setup_xprops(%s)", args)
     if is_gtk3():
         log("x11 root properties and XSETTINGS are not supported yet with GTK3"
             )
         return
     ROOT_PROPS = [
         "RESOURCE_MANAGER", "_NET_WORKAREA", "_NET_CURRENT_DESKTOP"
     ]
     try:
         from xpra.x11.xsettings import XSettingsWatcher
         from xpra.x11.xroot_props import XRootPropWatcher
         if self._xsettings_watcher is None:
             self._xsettings_watcher = XSettingsWatcher()
             self._xsettings_watcher.connect("xsettings-changed",
                                             self._handle_xsettings_changed)
             self._handle_xsettings_changed()
         if self._root_props_watcher is None:
             self._root_props_watcher = XRootPropWatcher(ROOT_PROPS)
             self._root_props_watcher.connect(
                 "root-prop-changed", self._handle_root_prop_changed)
             #ensure we get the initial value:
             self._root_props_watcher.do_notify("RESOURCE_MANAGER")
     except ImportError as e:
         log.error(
             "failed to load X11 properties/settings bindings: %s - root window properties will not be propagated",
             e)
Ejemplo n.º 3
0
 def __init__(self, root, resize_exact=False):
     WindowDamageHandler.__init__(self, root)
     WindowModelStub.__init__(self)
     self.root_prop_watcher = XRootPropWatcher(["WINDOW_MANAGER", "_NET_SUPPORTING_WM_CHECK"], root)
     self.root_prop_watcher.connect("root-prop-changed", self.root_prop_changed)
     self.update_icon()
     self.resize_exact = resize_exact
Ejemplo n.º 4
0
def main():
    ROOT_PROPS = ["RESOURCE_MANAGER", "_NET_WORKAREA"]
    xrpw = XRootPropWatcher(ROOT_PROPS)
    gobject.timeout_add(1000, xrpw.notify_all)
    try:
        gtk.main()
    finally:
        xrpw.cleanup()
Ejemplo n.º 5
0
def main():
    ROOT_PROPS = ["RESOURCE_MANAGER", "_NET_WORKAREA"]
    root = gtk.gdk.get_default_root_window()
    xrpw = XRootPropWatcher(ROOT_PROPS, root)
    gobject.timeout_add(1000, xrpw.notify_all)
    try:
        gtk.main()
    finally:
        xrpw.cleanup()
Ejemplo n.º 6
0
def main():
    logging.basicConfig(format="%(asctime)s %(message)s")
    logging.root.setLevel(logging.INFO)

    ROOT_PROPS = ["RESOURCE_MANAGER", "_NET_WORKAREA"]
    xrpw = XRootPropWatcher(ROOT_PROPS)
    gobject.timeout_add(1000, xrpw.notify_all)
    try:
        gtk.main()
    finally:
        xrpw.cleanup()
Ejemplo n.º 7
0
 def setup_xprop_xsettings(client):
     log.debug("setup_xprop_xsettings(%s)", client)
     try:
         from xpra.x11.xsettings import XSettingsWatcher
         from xpra.x11.xroot_props import XRootPropWatcher
         self._xsettings_watcher = XSettingsWatcher()
         self._xsettings_watcher.connect("xsettings-changed",
                                         self._handle_xsettings_changed)
         self._handle_xsettings_changed()
         self._root_props_watcher = XRootPropWatcher(
             self.ROOT_PROPS.keys())
         self._root_props_watcher.connect(
             "root-prop-changed", self._handle_root_prop_changed)
         self._root_props_watcher.notify_all()
     except ImportError, e:
         log.error(
             "failed to load X11 properties/settings bindings: %s - root window properties will not be propagated",
             e)
Ejemplo n.º 8
0
 def do_setup_xprops(self, *args):
     log.debug("do_setup_xprops(%s)", args)
     ROOT_PROPS = ["RESOURCE_MANAGER", "_NET_WORKAREA"]
     try:
         from xpra.x11.xsettings import XSettingsWatcher
         from xpra.x11.xroot_props import XRootPropWatcher
         self._xsettings_watcher = XSettingsWatcher()
         self._xsettings_watcher.connect("xsettings-changed",
                                         self._handle_xsettings_changed)
         self._handle_xsettings_changed()
         self._root_props_watcher = XRootPropWatcher(ROOT_PROPS)
         self._root_props_watcher.connect("root-prop-changed",
                                          self._handle_root_prop_changed)
         #ensure we get the initial value:
         self._root_props_watcher.do_notify("RESOURCE_MANAGER")
     except ImportError, e:
         log.error(
             "failed to load X11 properties/settings bindings: %s - root window properties will not be propagated",
             e)