def restore_decorations(self): decoration_map = state.read_decorations() for w in self.buffers: key = str(w.get_xid()) gdk_w = gdk_window_for(w) if key in decoration_map: original = decoration_map[key] gdk_w.set_decorations(Gdk.WMDecoration(original))
def toggle_decorated( winman: WindowManager, win: Wnck.Window, state: Dict[str, Any] # pylint: disable=unused-argument ) -> None: """Toggle window decoration state on the active window. :param win: The window to operate on. :param state: Unused """ # Have to specify types in the description pending a fix for # https://github.com/agronholm/sphinx-autodoc-typehints/issues/124 # TODO: Switch to setting this via python-xlib display = winman.gdk_screen.get_display() win = GdkX11.X11Window.foreign_new_for_display(display, win.get_xid()) win.set_decorations( Gdk.WMDecoration(0) if win.get_decorations()[1] else Gdk.WMDecoration. ALL)
#!/usr/bin/env python3 import time import common as c import gi gi.require_version('Gdk', '3.0') from gi.repository import Gdk window = Gdk.Screen.get_active_window(Gdk.Screen.get_default()) d = window.get_decorations().decorations if d == 1: exit() g = window.get_geometry() window.set_decorations(Gdk.WMDecoration(True)) c.update(window) time.sleep(0.01) window.move_resize(g[0], g[1], g[2] + 5, g[3]) window.set_decorations(d) c.update(window)
#!/usr/bin/env python3 import common as c import gi gi.require_version('Gdk', '3.0') from gi.repository import Gdk window = Gdk.Screen.get_active_window(Gdk.Screen.get_default()) window.set_decorations( Gdk.WMDecoration(window.get_decorations().decorations != 1)) c.update(window)
def restore(windows_xid: List[int]): original_decorations = persistor.get_decorations() for xid in windows_xid: if str(xid) in original_decorations: window_for(xid).set_decorations(Gdk.WMDecoration(original_decorations[str(xid)]))