[kwin script] window.frameGeometry seems to be readonly even if the docs states otherwise

Hello! I wrote this kwin script I use to toggle the visibility of some windows (whatsapp web and telegram desktop in particular). However, the resizing of the window really does not want to work. I tried:

win.frameGeometry.height = newvalue;

and it did nothing. I tried also

let frameGeometry = win.frameGeometry;
frameGeometry.height = newvalue;
win.frameGeometry = frameGeometry

with the same result. here’s the output taken from journalctl (of the function resize(key) of the script in the linked git repo):

Jun 15 18:02:48 tubbadu-dell kwin_wayland[920]: js: setting height to 650
Jun 15 18:02:48 tubbadu-dell kwin_wayland[920]: js: setting width to 920
Jun 15 18:02:48 tubbadu-dell kwin_wayland[920]: js: old frame geometry: QRectF(0, 0, 1204, 800)
Jun 15 18:02:48 tubbadu-dell kwin_wayland[920]: js: new frame geometry: QRectF(0, 0, 1204, 800)
Jun 15 18:02:48 tubbadu-dell kwin_wayland[920]: js: after assignment: QRectF(0, 0, 1204, 800)

it seems that the frameGeometry object is readonly, but on the docs it’s listed in the readwrite properties… am I missing something or it’s a bug?

The code I use:

let q = Object.assign({}, w.frameGeometry);
q.width=x;
q.height=y;
w.frameGeometry = q;
1 Like

It works like a charm! Thank you very much! Perhaps it would be good to add this in the docs?