Skip to content

Position popup windows on the screen where the mouse cursor is located - #249

Open
shymega wants to merge 1 commit into
devfrom
shymega/make-tk-appear-on-current-screen
Open

Position popup windows on the screen where the mouse cursor is located#249
shymega wants to merge 1 commit into
devfrom
shymega/make-tk-appear-on-current-screen

Conversation

@shymega

@shymega shymega commented Mar 7, 2026

Copy link
Copy Markdown
Member

This commit fixes the Tk windows to appear on the currently focused screen.

I was finding it behaved differently on Hyprland.

@shymega
shymega requested a review from marvin1099 March 7, 2026 22:19
@shymega shymega self-assigned this Mar 7, 2026
@shymega
shymega changed the base branch from main to dev March 7, 2026 22:26
@shymega
shymega force-pushed the shymega/make-tk-appear-on-current-screen branch from 23254d2 to 32da17e Compare March 7, 2026 22:29
@marvin1099

marvin1099 commented Mar 7, 2026

Copy link
Copy Markdown
Collaborator

Would this pace the top left of the window to mouse pos or the middle of the window to mouse pos.

Probably more expected that the window spawns so that the mouse pos is in the middle

@shymega

shymega commented Mar 10, 2026

Copy link
Copy Markdown
Member Author

Would this pace the top left of the window to mouse pos or the middle of the window to mouse pos.

Probably more expected that the window spawns so that the mouse pos is in the middle

I agree, this only does the top left. I also want to test it on KDE, as that's what SteamOS/Bazzite use, but I won't test on X11.

@marvin1099

marvin1099 commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator

I agree, this only does the top left. I also want to test it on KDE, as that's what SteamOS/Bazzite use, but I won't test on X11.

Sounds good.
Probably just remove half the window size in the gui window functions (that shoud be the middle).
Then location parrameter is always expected as center cordinates.

A alternative would be to get the detktop the mouse is on and center it on the desktop.
We could also do that.

@shymega
shymega force-pushed the shymega/make-tk-appear-on-current-screen branch 2 times, most recently from 6100c1d to 5aa9b49 Compare March 20, 2026 20:37
@shymega
shymega force-pushed the shymega/make-tk-appear-on-current-screen branch from 5aa9b49 to 32c43ac Compare March 31, 2026 18:05
@marvin1099

marvin1099 commented Mar 31, 2026

Copy link
Copy Markdown
Collaborator

Is it ready for testing / or did you test.

@shymega

shymega commented Mar 31, 2026

Copy link
Copy Markdown
Member Author

Is it ready for testing / or did you test.

Its ready for testing, but I'm still waiting for my GPD WM2 to come back from China. Its in transit, should have it in a week or two.

@marvin1099 marvin1099 added the test me Added to PRs that look merge‑ready, but still clone and test the code to confirm expected behavior. label Mar 31, 2026
@shymega
shymega force-pushed the shymega/make-tk-appear-on-current-screen branch from 32c43ac to 3c789b4 Compare May 2, 2026 22:42
@shymega
shymega force-pushed the shymega/make-tk-appear-on-current-screen branch from 3c789b4 to e215eca Compare May 11, 2026 23:56
@shymega

shymega commented May 14, 2026

Copy link
Copy Markdown
Member Author

GPD WM2 came back. This kind of works. It doesn't always center, but its an improvement. I wonder if its still worth merging?

Adds get_mouse_location() function that uses tkinter to get the current
mouse position, then passes this location to PySimpleGUI windows so they
appear on the active screen in multi-monitor setups.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@shymega
shymega force-pushed the shymega/make-tk-appear-on-current-screen branch from e215eca to e460738 Compare May 14, 2026 23:35
@marvin1099 marvin1099 added pickup for v2 pickup or re-examine task or change in v2 and removed test me Added to PRs that look merge‑ready, but still clone and test the code to confirm expected behavior. labels Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pickup for v2 pickup or re-examine task or change in v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants