'operation (e.g. mouse click) when window not focused' BUG
See original GitHub issueExpected Behavior
Until windows 10 latest update (19043.1237) pywinauto ‘background processing’ worked like charm. So, e.g. it was possible to click on a window even if it wasnt focused and set foreground with code like:
app = Application()
app.connect(handle=target_window)
app.window(title=window_title).click(button='left', coords=(int(x_cor),int(y_cor)))
Actual Behavior
Now, the same code stopped working, to be exact: the code always set the window focused and foreground, 😦 I am not sure how many people affected by this in practice, but I assume this is a relatively large bug/correction would be great to have fixed if possible.
Steps to Reproduce the Problem
- install windows version updates 19043.1237 or higher.
- run a simple code like above and and bug reproduced.
Short Example of Code to Demonstrate the Problem
Shown above.
Specifications
- Pywinauto version: 0.6.8
- Python version and bitness: 3.9.7
- Platform and OS: Windows 10 19043.1237
BIG thank you for your help and time to look into this
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Mouse deselects active window, wont respond until ctrl alt del
The problem that I'm having is that my mouse sporadically "unfocuses" my current active window when I click, and will not interact with ......
Read more >Unable to click on windows, mouse clicks defocus all windows
Note: you can usually get usability for a while by pressing just ctrl + esc or ctrl + alt + delete and then...
Read more >Bug #1131428 “Loss of correct mouse focus (interference with ...
The bug seems to be due to an interference between the application and the desktop window manager (DWM) or an application accessing to...
Read more >26213 – window focus for mouse stuck (was: after some time ...
A minor addition to his description: - Once you left-click in a window which has no context menu on a right-click, you are...
Read more >c# - programmatically mouse click in another window
What program are you trying to click on? Some programs (mostly games) have mechanisms to handle what you are trying to do and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
BIG thanks for your response, time and help! Actually, I love to keep things simple, so I do use it as simple as possible, here is the real code:
`# ---------------------- mouse click (WITHOUT the need of make it active and foreground) def left_click (x_coordinate, y_coordinate):
Steps to reproduce the issue: 1) Open Chrome, I have version:
2) open www.google.com or any other website, the critical thing to choose simple website to make sure it doesnt has nested content (eg. typical in online games) as thats cant be clicked. So just something simple website for testing.
3) open notepad and maximize it.
4) Now execute the code above in python with setting any x,y coordinate,
When the click happen: Chrome window will come forward, front of notepad window.
Does it happen at your side as well ?
Appreciate your response, fully understanding, looking forward to your feedback in November. Once again, BIG thanks for letting me know and lots of strength for handling the overload.