-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Bug: ScrCpy either steals focus or closes itself completely when orientation changes and it has no focus #3947
Comments
Does it also happen when you don't pass
100% reproducible? If you keep a terminal, what is the error message? |
What do you mean "behavior from SDL." ? I don't want it to ever steal focus, let alone just because of orientation change. I can always reproduce this. The closing of ScrCpy happens even without being on top, using this command:
As for stealing focus, because the other app is on top, ScrCpy can't be on top of it when stealing focus, so removing "--always-on-top" won't show the issue. Which command do you want me to try? Please show me the exact command to write |
You are reporting two different problems. The one about focus stealing with "always on top" is out of control of scrcpy: it is the behavior from your window manager (or maybe SDL). For example, it does not happen on my window manager on Linux/XFCE. I can reproduce your second issue about rotation while minimized (only on Windows). On scrcpy 2.0, the error is:
On scrcpy dev branch, the error is:
Scrcpy should probably not create or touch textures while a window is minimized. That will be annoying to fix, I added it on my TODO list. (Refs for myself: libsdl-org/SDL#7651) |
About the "always on top" issue that steals focus, can you please fix it somehow using a workaround? Would the fix of being minimized help with this issue too? |
Please test branch
Does it fix the rotation while minimized? |
The focus stealing still exists (occurs when it tries to rotate, not minimized), but the issue of it being closed (occurs when it tries to rotate while being minimized) doesn't exist. Please try to fix the focus stealing too. Is it OK if I keep using this release for now? No serious issues? |
Great! Thank you for your test 👍
Focus stealing is not a scrcpy issue. You request
Sure, it also includes #3978, so you could also test if you want :) |
But I want to use it as always-on-top. |
Then report to SDL that when always on top is set, changing the window size steals the focus on your system. |
|
It's the framework used by scrcpy to handle window/textures/etc. https://github.com/libsdl-org/SDL For example, I opened an issue/question about your first problem: libsdl-org/SDL#7651
No. That would be a recipe for disaster anyway. |
Wait, are you saying you've reported about it for me, about the focus stealing? About the check, is it hard? |
@rom1v Can you please open a ticket where you thought about, and explain the problem there? |
@AndroidDeveloperLB Either report it directly to https://github.com/libsdl-org/SDL/issues, or open a new scrcpy issue with a detailed explanation of the focus stealing issue alone (so that I can reference it without all the noise about the other issue fixed in this thread). Btw, a video showing the problem could help. |
Environment
OS: [e.g. Debian, Windows, macOS...]
Windows
scrcpy version: [e.g. 1.12.1]
2.0
installation method: [e.g. manual build, apt, snap, brew, Windows release...]
Extract from the ZIP file
device model:
Pixel 6
Android version: [e.g. 10]
13
Describe the bug
I've launched an app that decided to change the device orientation after some time. During this time, I was actually using a very different window on Windows OS.
When it changed the orientation, ScrCpy stole focus. As it was in a full screen online game, it was very annoying because I lost the context and had to quickly switch back.
When I tried to reproduce it via a sample, I've also noticed that if ScrCpy is just minimized to the taskbar, it will close itself completely when the orientation changes.
The command I use for ScrCpy is:
Here's a sample app to simulate this, which changes the orientation after 5 seconds since shown. During this time, switch to another window, and wait for it to happen.
My Application.zip
app-debug.zip
Code:
On errors, please provide the output of the console (and
adb logcat
if relevant).There are no errors.
However, here's a video showing the issue:
2023-04-25_00-34-32.zip
And here's a video showing the issue when there is another window, on top, that needs to stay on focus (a video player app) :
2023-04-25_00-42-13_1.zip
The text was updated successfully, but these errors were encountered: