2323import Xlib .ext
2424from Xlib .xobject .drawable import Window as XWindow
2525
26- from pywinctl ._main import BaseWindow , Re , _WatchDog , _findMonitorName , getAllScreens , getScreenSize , getWorkArea , displayWindowsUnderMouse
26+ from ._main import BaseWindow , Re , _WatchDog , _findMonitorName , getAllScreens , getScreenSize , getWorkArea , displayWindowsUnderMouse
2727from pywinbox import Box , Size , Point , Rect , pointInBox
2828from ewmhlib import Props , RootWindow , EwmhWindow , defaultRootWindow
2929from ewmhlib ._ewmhlib import _xlibGetAllWindows
@@ -50,12 +50,14 @@ def getActiveWindow() -> Optional[LinuxWindow]:
5050 """
5151 Get the currently active (focused) Window in default root
5252
53+ WAYLAND
5354 This will not work on Wayland unless you activate unsafe_mode:
5455 - Press alt + f2
5556 - write "lg" (without the quotation marks) and press Enter
5657 - In the command entry box (at the bottom of the window), write "global.context.unsafe_mode = true" (without the quotation marks) and press Enter
5758 - To exit the "lg" program, click on any of the options in the upper right corner, then press Escape (it seems a lg bug!)
5859 - You can set unsafe_mode off again by following the same steps, but in this case, using "global.context.unsafe_mode = false"
60+ Anyway, it will not work with all windows (especially built-in/"official" apps do not populate xid nor X-Window object)
5961
6062 :return: Window object or None
6163 """
@@ -94,12 +96,14 @@ def getAllWindows():
9496 """
9597 Get the list of Window objects for all visible windows in default root
9698
99+ WAYLAND
97100 This will not work on Wayland unless you activate unsafe_mode:
98101 - Press alt + f2
99102 - write "lg" (without the quotation marks) and press Enter
100103 - In the command entry box (at the bottom of the window), write "global.context.unsafe_mode = true" (without the quotation marks) and press Enter
101- - To exit the "lg" program, click on any of the options in the upper right corner, and press Escape (it seems a lg bug!)
104+ - To exit the "lg" program, click on any of the options in the upper right corner, then press Escape (it seems a lg bug!)
102105 - You can set unsafe_mode off again by following the same steps, but in this case, using "global.context.unsafe_mode = false"
106+ Anyway, it will not work with all windows (especially built-in/"official" apps do not populate xid nor X-Window object)
103107
104108 :return: list of Window objects
105109 """
0 commit comments