def reparent(self, who, wm_state): self.parent = who if self.workspace.screen is None: geo = self.geo_virt else: geo = self.absolute_geometry() self.__con.core.ReparentWindow(self.id, self.parent, geo.x, geo.y) change_property(PropMode.Replace, self.id, runtime.wm_atoms["WM_STATE"], Atom.CARDINAL, 32, 1, wm_state)
def register_properties(): wm_atom_names = ["WM_STATE", "WM_CLASS"] get_atoms(wm_atom_names, runtime.wm_atoms) net_wm_atom_names = ["_NET_SUPPORTED", "_NET_SUPPORTING_WM_CHECK", "_NET_WM_NAME", "_NET_WM_PID"] # "_NET_STARTUP_ID", "_NET_CLIENT_LIST", "_NET_CLIENT_LIST_STACKING", "_NET_NUMBER_OF_DESKTOPS", # "_NET_CURRENT_DESKTOP", "_NET_DESKTOP_NAMES", "_NET_ACTIVE_WINDOW", "_NET_DESKTOP_GEOMETRY", # "_NET_CLOSE_WINDOW", "_NET_WM_STRUT_PARTIAL", "_NET_WM_ICON_NAME", "_NET_WM_VISIBLE_ICON_NAME", # "_NET_WM_DESKTOP", "_NET_WM_WINDOW_TYPE", "_NET_WM_WINDOW_TYPE_DESKTOP", "_NET_WM_WINDOW_TYPE_DOCK", # "_NET_WM_WINDOW_TYPE_TOOLBAR", "_NET_WM_WINDOW_TYPE_MENU", "_NET_WM_WINDOW_TYPE_UTILITY", # "_NET_WM_WINDOW_TYPE_SPLASH", "_NET_WM_WINDOW_TYPE_DIALOG", "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", # "_NET_WM_WINDOW_TYPE_POPUP_MENU", "_NET_WM_WINDOW_TYPE_TOOLTIP", "_NET_WM_WINDOW_TYPE_NOTIFICATION", # "_NET_WM_WINDOW_TYPE_COMBO", "_NET_WM_WINDOW_TYPE_DND", "_NET_WM_WINDOW_TYPE_NORMAL", "_NET_WM_ICON", # "_NET_WM_STATE", "_NET_WM_STATE_STICKY", "_NET_WM_STATE_SKIP_TASKBAR", "_NET_WM_STATE_FULLSCREEN", # "_NET_WM_STATE_MAXIMIZED_HORZ", "_NET_WM_STATE_MAXIMIZED_VERT", "_NET_WM_STATE_ABOVE", # "_NET_WM_STATE_BELOW", "_NET_WM_STATE_MODAL", "_NET_WM_STATE_HIDDEN", "_NET_WM_STATE_DEMANDS_ATTENTION" get_atoms(net_wm_atom_names, runtime.net_wm_atoms) change_property(PropMode.Replace, runtime.viewport.root, runtime.net_wm_atoms["_NET_SUPPORTED"], Atom.ATOM, 32, len(runtime.net_wm_atoms), runtime.net_wm_atoms.itervalues()) wm_win = runtime.con.generate_id() runtime.con.core.CreateWindow(runtime.viewport.root_depth, wm_win, runtime.viewport.root, -1,-1,1,1,0, WindowClass.CopyFromParent, runtime.viewport.root_visual, 0, []) change_property(PropMode.Replace, runtime.viewport.root, runtime.net_wm_atoms["_NET_SUPPORTING_WM_CHECK"], Atom.WINDOW, 32, 1, wm_win) change_property(PropMode.Replace, wm_win, runtime.net_wm_atoms["_NET_SUPPORTING_WM_CHECK"], Atom.WINDOW, 32, 1, wm_win) change_property(PropMode.Replace, wm_win, runtime.net_wm_atoms["_NET_WM_NAME"], Atom.STRING, 8, len(runtime.wmname), runtime.wmname) change_property(PropMode.Replace, wm_win, runtime.net_wm_atoms["_NET_WM_PID"], Atom.CARDINAL, 32, 1, os.getpid()) fp_wm_atom_names = ["_FP_WM_WORKSPACE"] get_atoms(fp_wm_atom_names, runtime.fp_wm_atoms)
def __set_workspace(self, workspace): self.workspace = workspace change_property(PropMode.Replace, self.id, runtime.fp_wm_atoms["_FP_WM_WORKSPACE"], Atom.STRING, 8, len(self.workspace.name), self.workspace.name)