Open
Conversation
Collaborator
Author
|
I fixed some issues and updated the icon. The new icon is derived from this one. I think it makes it clear that the communication with the device is lost:
|
anotheruserofgithub
left a comment
There was a problem hiding this comment.
Hi, first I noticed a few possible issues.
anotheruserofgithub
left a comment
There was a problem hiding this comment.
One last suggested improvement from my side.
Collaborator
Author
|
When the disconnected icon is shown, we should still handle events (to leave fullscreen mode for example). I will need to rework that before merging. |
rom1v
added a commit
that referenced
this pull request
Mar 15, 2026
Collaborator
Author
Done. Ready to be merged. (Please review and test if you can) |
anotheruserofgithub
left a comment
There was a problem hiding this comment.
Small details of style (just to nitpick).
|
I still couldn't test for real, I'd need to buy a new phone… one day. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

When the connection to the device is lost while mirroring, the window closed immediately, suggesting scrcpy had crashed.
To make it clear that a disconnection occurred, display a disconnected icon for 2 seconds before closing the window.
The icon replaces the screen content immediately:
On purpose, the last frame is immediately removed. For example, during a presentation, the device might inadvertently show some private content on screen, the user should be able to immediately disconnects the USB cable to remove the content.
I intentionally did not add an option to configure the timeout delay (it's hardcoded to 2 seconds), there are already a lot of options…
The implementation is a bit "ad hoc", but hey it works.
I replaced
SCRCPY_ICON_PATH(which defined the unique scrcpy icon) withSCRCPY_ICON_DIRnow that there are several icons.I get the (temporary) disconnected icon from a free icons website (I can't remember where).
@varlesh As the author of the main icon (#1987 (comment)), may I ask you to create an icon for this use case?
This is an "Android disconnection"
so this is not specifically for USB or Wifi (and even less wall socket). If it needs to represent something physical, USB is probably fine though.