Example #1
0
 def do_clean_x11_properties(self, *properties):
     root = get_default_root_window()
     for prop in properties:
         try:
             prop_del(root, prop)
         except Exception as e:
             log("prop_del(%s, %s) %s", root, prop, e)
Example #2
0
def _set_gtk_x11_window_menu(add,
                             wid,
                             window,
                             menus,
                             application_action_callback=None,
                             window_action_callback=None):
    from xpra.x11.dbus.menu import setup_dbus_window_menu
    from xpra.x11.gtk_x11.prop import prop_set, prop_del
    window_props = setup_dbus_window_menu(add, wid, menus,
                                          application_action_callback,
                                          window_action_callback)
    #window_props may contains X11 window properties we have to clear or set
    if not window_props:
        return
    if not window:
        #window has already been closed
        #(but we still want to call setup_dbus_window_menu above to ensure we clear things up!)
        return
    menulog("will set/remove the following window properties for wid=%i: %s",
            wid, window_props)
    try:
        from xpra.gtk_common.error import xsync
        with xsync:
            for k, v in window_props.items():
                if v is None:
                    prop_del(window, k)
                else:
                    vtype, value = v
                    prop_set(window, k, vtype, value)
    except Exception as e:
        menulog.error("Error setting menu window properties:")
        menulog.error(" %s", e)
Example #3
0
File: wm.py Project: qmutz/xpra
 def cleanup(self):
     remove_fallback_receiver("xpra-client-message-event", self)
     remove_fallback_receiver("child-map-request-event", self)
     for win in tuple(self._windows.values()):
         win.unmanage(True)
     with xswallow:
         prop_del(self._ewmh_window, "_NET_SUPPORTING_WM_CHECK")
         prop_del(self._ewmh_window, "_NET_WM_NAME")
     destroy_world_window()
Example #4
0
File: base.py Project: chewi/xpra
 def move_to_workspace(self, workspace : int):
     #we send a message to ourselves, we could also just update the property
     current = self.get_property("workspace")
     if current==workspace:
         workspacelog("move_to_workspace(%s) unchanged", workspacestr(workspace))
         return
     workspacelog("move_to_workspace(%s) current=%s", workspacestr(workspace), workspacestr(current))
     with xswallow:
         if workspace==WORKSPACE_UNSET:
             workspacelog("removing _NET_WM_DESKTOP property from window %#x", self.xid)
             prop_del(self.client_window, "_NET_WM_DESKTOP")
         else:
             workspacelog("setting _NET_WM_DESKTOP=%s on window %#x", workspacestr(workspace), self.xid)
             prop_set(self.client_window, "_NET_WM_DESKTOP", "u32", workspace)
Example #5
0
def _set_gtk_x11_window_menu(add, wid, window, menus, application_action_callback=None, window_action_callback=None):
    from xpra.x11.dbus.menu import setup_dbus_window_menu
    from xpra.x11.gtk_x11.prop import prop_set, prop_del
    window_props = setup_dbus_window_menu(add, wid, menus, application_action_callback, window_action_callback)
    #window_props may contains X11 window properties we have to clear or set
    if not window_props:
        return
    if not window:
        #window has already been closed
        #(but we still want to call setup_dbus_window_menu above to ensure we clear things up!)
        return
    menulog("will set/remove the following window properties for wid=%i: %s", wid, window_props)
    try:
        from xpra.gtk_common.error import xsync
        with xsync:
            for k,v in window_props.items():
                if v is None:
                    prop_del(window, k)
                else:
                    vtype, value = v
                    prop_set(window, k, vtype, value)
    except Exception as e:
        menulog.error("Error setting menu window properties:")
        menulog.error(" %s", e)
Example #6
0
 def pdel(key):
     return prop_del(w, key)
Example #7
0
 def reset_icc_profile(self):
     screenlog("reset_icc_profile()")
     from xpra.x11.gtk_x11.prop import prop_del
     prop_del(self.root_window, "_ICC_PROFILE")
     prop_del(self.root_window, "_ICC_PROFILE_IN_X_VERSION")
     self.icc_profile = b""
Example #8
0
 def reset_icc_profile(self):
     screenlog("reset_icc_profile()")
     from xpra.x11.gtk_x11.prop import prop_del
     prop_del(self.root_window, "_ICC_PROFILE")
     prop_del(self.root_window, "_ICC_PROFILE_IN_X_VERSION")
Example #9
0
 def pdel(key):
     return prop_del(w, key)