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

Add a "Sticky mouse pointer" feature #62

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add a "Sticky mouse pointer" feature #62

wants to merge 4 commits into from

Conversation

kekh
Copy link

@kekh kekh commented Mar 13, 2016

Ability to make the mouse pointer following the currently manipulated window.

I've needed that feature because of the "Focus follow mouse" setting in Xfce which causes bad behavior with multi display config (ie. every time I move a window via QuickTile to an other monitor I must reposition the mouse on the window to keep QuickTile moving the right window)...

As I'm not at all familiar with Python this was done (or rather tinkered) by deduction at looking your code + hours of Googling. So very sorry if it's suboptimal :-/

Anyway, thank you so much for your great software!!

Ability to make the mouse pointer following the currently manipulated window.
@ssokolow
Copy link
Owner

At the moment, all my time is taken up by my degree project, but I'll leave this open as a TODO for when I can spare some time.

Thanks for taking the effort. :)

@kekh
Copy link
Author

kekh commented Mar 13, 2016

Ok no problem!

@ssokolow
Copy link
Owner

Also, I took a very quick glance over your code and, when I merge it, I'll probably adapt it so it also preserves the pointer's position within the active window. I don't use "focus follows pointer" (obviously), but that seems like something that would be desirable.

@kekh
Copy link
Author

kekh commented Mar 13, 2016

Great! I'm trying to refactore it in order to save you some time and perhaps improve my Python knowledge, who knows... :D

…original classes declaration then because it seems that less code is better...)
@kekh
Copy link
Author

kekh commented Mar 13, 2016

Here it is... I hope you'll find it better!

@ssokolow
Copy link
Owner

Actually, now that I've looked at it more closely, there are a couple of issues with that code:

  1. It's hard for me to explain why, since it's just something I developed a feel for over the years, but get_xdisplay_xroot isn't something I'd want in my code.
  2. I was actually trying to factor out the use of python-xlib as much as possible, so I'd rather you didn't add it back in as a dependency for WindowManager.

Maybe I'm too nice for the good of my own schedule, but I took a few minutes to Google up the proper APIs...

...and implemented it properly. I don't currently have time to expose the option to the end user so people can turn it off, so I can't merge it into master, but take a look at this branch (specifically, the diff of commit 10d1c5c), learn from it, and feel free to use it:

https://github.com/ssokolow/quicktile/tree/focus_follows_mouse

I'll leave this pull request open as a reminder to myself that I need to merge that branch.

@kekh
Copy link
Author

kekh commented Mar 13, 2016

Wow this is super cool! Thank you sooo much for taking of your time to do it!!!

@ssokolow
Copy link
Owner

I'm un-tagging on this temporarily "fix in dev branch" because it didn't make it into the GTK 3 rewrite that's going out as 0.4.0.

However, I've already looked up the chain of calls necessary to get a reference to the pointer and warp it under the new API, so I foresee no problem including this functionality in 0.5.0, which shouldn't take anywhere near as long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants