SUMMARY wayland kwin script api gives 0 to client.windowId when 'workspace.clientAdded.connect' event is triggered. The windowId is however given to the client.windowId variable when the application is run using Xwayland. STEPS TO REPRODUCE 1. Alt+F2, then type 'plasma-interactiveconsole --kwin' 2. Paste this script into the code field. ``` workspace.clientAdded.connect((client) => {console.log(client.windowId);}); ``` 3. start a terminal emulator and type 'journalctl -g "js:" -f' 4. Execute the code in plasma-interactiveconsole. 5. Open a non Xwayland application, any will suffice. OBSERVED RESULT It should give 0 for each wayland application opened. EXPECTED RESULT The expected result should be a windowId similar to this 10485803. If you open an Xwayland Application you should see the expected result SYSTEM INFORMATION Operating System: Arch Linux KDE Plasma Version: 5.26.4 KDE Frameworks Version: 5.101.0 Qt Version: 5.15.7 Kernel Version: 6.1.1-arch1-1 (64-bit) Graphics Platform: Wayland Processors: 24 × AMD Ryzen 9 3900X 12-Core Processor Memory: 31.3 GiB of RAM Graphics Processor: NVIDIA GeForce GTX 1080/PCIe/SSE2 Manufacturer: Gigabyte Technology Co., Ltd. Product Name: X570 AORUS ELITE System Version: -CF
windowId only exist for X11 windows. src/x11window.h: Q_PROPERTY(qulonglong windowId READ window CONSTANT) as it maps to the underlying X11 window ID type. For something universal use: src/window.h: Q_PROPERTY(QUuid internalId READ internalId CONSTANT)