https://bugs.kde.org/show_bug.cgi?id=469834

andy <a...@digitalsignalperson.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |a...@digitalsignalperson.co
                   |                            |m

--- Comment #4 from andy <a...@digitalsignalperson.com> ---
(In reply to Antonio Russo from comment #3)
> Yes, I suspected that the async operations were doing this, but I was never
> able to figure out how to overcome that.  In particular, I don't know how to
> instantiate a QRect object (is it spelled "rect"?)?
> 
> Could you please give me the exact script that you are saying will allow me
> to change both the width and height at the same time?  If such a script
> indeed exists, I definitely agree this bug should be closed.
> 
> Thank you,
> Antonio

I figured it out (for plasma 6). You can set the entire frameGeometry object at
once. 

var x = 2000
var y = 2000
var width = 200
var height = 200
var left = x
var right = x + width
var top = y
var bottom = y + height
workspace.activeWindow.frameGeometry =
{"x":x,"y":y,"width":width,"height":height,"left":left,"right":right,"top":top,"bottom":bottom}

If I query the geometry again (this is in the shell scripting console) I get
{"x":2000,"y":2000,"width":200,"height":339,"left":2000,"right":2200,"top":2000,"bottom":2339}

I was wondering if we have to specify all that or just x,y,width,height. If I
don't specify left/right/top/bottom
 workspace.activeWindow.frameGeometry =
{"x":x,"y":y,"width":width,"height":height}

if I query the result I get slightly different positioning, but same width and
height

{"x":2000,"y":1861,"width":200,"height":339,"left":2000,"right":2200,"top":1861,"bottom":2200}

But for just a move this works
workspace.activeWindow.frameGeometry = {"x":x,"y":y}


For just a resize lol this doesn't work, it moves the window to (0,0) which is
off-screen for my monitor setup.
workspace.activeWindow.frameGeometry = {"width":width,"height":height}

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to