Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drag top of the window, not middle of the window #18

Open
PapierFliegr opened this issue Mar 7, 2024 · 5 comments
Open

Drag top of the window, not middle of the window #18

PapierFliegr opened this issue Mar 7, 2024 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@PapierFliegr
Copy link

PapierFliegr commented Mar 7, 2024

Currently, when using the option to move a window, the cursor fixes itself to the middle of a window.
If the cursor fixed itself to the top of the window, then the motion would be smoother.

Edit: Just noticed Latte-Dock places the cursor to the middle as well, but moves the cursor to the window and not the window to the cursor

@luisbocanegra
Copy link
Owner

This is a limitation of the default shortcuts provided by KWin, I think under the hood it uses the same as Right Click window > More Actions > Move.

But it can probably achieved by using a KWin script (similar to what I am planning to do with #8).
Or with C++ but I would need help if is the only option as I don't know much of that. Though ideally, I would like to keep my plasmoids compilation free where possible.

@PapierFliegr
Copy link
Author

I think after executing the action of "drag down" or whatever one uses, you could first move the cursor to the middle of the active window and then move the window (or middle of the current screen, should be easier).
This should make it way smoother, especially in regards of #19.

At least that's how latte-dock implemented it. When doing the dragging motion, the cursor first jumped down and then it dragged the window.

On Plasma5 there was the hotkey Meta+F6 which moved the cursor to the middle of the screen, but it's not usable here for multiple screens, as the hptkey moved the cursor the the middle of all screens combined.
Not sure, whether something similar exists on Plasma6.

@luisbocanegra
Copy link
Owner

Will check if mouse can be positioned and set to drag with KWin Scripting API.

@PapierFliegr
Copy link
Author

With v1.6.1 the drag action is very smooth now.
I don't think you need to implement the dragging of the top of the window anymore.

Vote to close this issue.

@luisbocanegra
Copy link
Owner

With v1.6.1 the drag action is very smooth now.

Thanks for the feedback!

I don't think you need to implement the dragging of the top of the window anymore.

After some experimenting I was able to move the window to the cursor position but was immediately back to the center if it was moved, so I don't think is possible with just KWin scripting.

But I don't want to give up on this just yet lol, let's keep it open in case someone smarter than me figures out how to add compiled alternative if any, I'll ask for help to KDE devs maybe they could implement an alternative that drags from the top

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants