Bug 487703

Summary: workspace.activateWindow missing
Product: [Plasma] kwin Reporter: Manuel Amador (Rudd-O) <rudd-o>
Component: scriptingAssignee: KWin default assignee <kwin-bugs-null>
Status: REPORTED ---    
Severity: normal CC: fanzhuyifan, kde
Priority: NOR    
Version: 6.0.5   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Manuel Amador (Rudd-O) 2024-05-28 17:30:30 UTC
Cannot call activateWindow on workspacewrapper JS object, despite being documented here: https://develop.kde.org/docs/plasma/kwin/api/#read-only-properties-4

raiseWindow does not focus the supplied window so this is not the same as activating and is not enough.

Sample code at https://rudd-o.com/linux-and-free-software/how-to-raise-a-window-under-wayland-or-x11-when-using-kde-kwin-plasma/ see commented try/catch block.
Comment 1 David Redondo 2024-05-29 07:23:02 UTC
I think the comment is wrong and you need to use  the active window property

https://develop.kde.org/docs/plasma/kwin/api/#read-write-properties
Comment 2 Manuel Amador (Rudd-O) 2024-05-29 15:24:06 UTC
Yep it appears the comment is wrong and it should be fixed, but activeWindow property works.