Bug 381106 - Effects: windowGeometryShapeChanged not triggered when window moved
Summary: Effects: windowGeometryShapeChanged not triggered when window moved
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: scripting (show other bugs)
Version: 5.10.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-11 18:06 UTC by Tom B
Modified: 2021-12-06 04:39 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom B 2017-06-11 18:06:54 UTC
Using the javascript scripting engine, there seems to be no way to detect when a window has been moved grammatically.

Using 

```
effects.windowGeometryShapeChanged.connect()
```

This is triggered as expected when the shape is changed, however, if the X/Y co-ordinates change (e.g. by a kwin script) this method is not triggered.

There appears to be no method to trigger an animation from a kwin script to move windows around. 

As a workaround, I've used the same effect and done this:

```
var geo = client.geometry;
geo.x += 100;

//Add 1 to the width to trigger the effect
geo.width = geo.width + 1;
client.geometry = geo;
        
//now put the window back to its original size
geo.width = geo.width = geo.width -1;
client.geometry = geo;
```

But this is a horrible hack! Either windowGeometryShapeChanged should be triggered when the x/y co-ordinates change or windowGeometryChanged should be implemented.
Comment 1 Martin Flöser 2017-06-17 12:36:46 UTC
> when a window has been moved grammatically.

What do you mean by that?

Please note the following in the documentation of windowGeometryShapeChanged:

Signal emitted when the geometry or shape of a window changed. This is caused if the window changes geometry without user interaction. E.g. the decoration is changed. This is in opposite to windowUserMovedResized which is caused by direct user interaction
Comment 2 Tom B 2017-06-17 12:59:29 UTC
Sorry that should be "programatically".


The following kwin script 


```

var geo = client.geometry;
geo.x += 100;
client.geometry = geo;
```

Will not trigger windowGeometryShapeChanged in an effect

Either:

1) This is a bug and the effect should be triggered as the geometry has changed (it's x position has been updated) 

or 2) This is not a bug, windowGeometryShapeChanged should only be triggered when the width/height are changed but there is no way to write a kwin effect (in javascript) that responds to windows being moved (but not resized)



> This is caused if the window changes geometry without user interaction

Since window.geometry includes the properties x, x, width and height, I would expect that a change to any of these four properties would trigger windowGeometryShapeChanged. As it stands, it's only triggered when width or height are changed.
Comment 3 kde.org 2021-11-06 19:41:38 UTC
This issue report is quite old. Can you please confirm, that it still persists with KDE 5.23?
Comment 4 Bug Janitor Service 2021-11-21 04:39:49 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Bug Janitor Service 2021-12-06 04:39:08 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!