Compare commits

..

10 Commits

Author SHA1 Message Date
Romain Vimont
8eb87ba10e Display disconnected icon before closing
Previously, when the connection to the device was 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.

PR #6662 <https://github.com/Genymobile/scrcpy/pull/6662>
2026-02-25 23:08:55 +01:00
Romain Vimont
cd757dbe35 Track window shown state
Use a flag to determine whether the window is currently shown.

This replaces the old has_video_window flag, which was true only when
the window was shown and video was enabled.

This will simplify displaying a "disconnected" icon on device
disconnection when the window is currently shown.

PR #6662 <https://github.com/Genymobile/scrcpy/pull/6662>
2026-02-25 22:59:41 +01:00
Romain Vimont
0122e09199 Only reject RUN_ON_MAIN_THREAD events on quit
Use SDL_PeepEvents() to consume only SC_EVENT_RUN_ON_MAIN_THREAD events.
Other events are not dropped and can still be processed later.

PR #6662 <https://github.com/Genymobile/scrcpy/pull/6662>
2026-02-25 22:59:29 +01:00
Romain Vimont
d45aefee26 Add utility to push an SDL event with data
PR #6662 <https://github.com/Genymobile/scrcpy/pull/6662>
2026-02-25 22:58:53 +01:00
Romain Vimont
ac1a8b6ef2 Add function to delete current texture
PR #6662 <https://github.com/Genymobile/scrcpy/pull/6662>
2026-02-25 22:58:41 +01:00
Romain Vimont
362daa5bad Add filename parameter to icon loading
Replace scrcpy_icon_load(), which loaded the unique scrcpy app icon,
with sc_icon_load(filename), which can load any icon from the icons
directory.

PR #6662 <https://github.com/Genymobile/scrcpy/pull/6662>
2026-02-25 22:58:22 +01:00
Romain Vimont
4f63398019 Replace SCRCPY_ICON_PATH with SCRCPY_ICON_DIR
SCRCPY_ICON_PATH defined the path of the scrcpy app icon.
SCRCPY_ICON_DIR defines the directory where scrcpy icons reside.

This change prepares for the addition of other icons.

PR #6662 <https://github.com/Genymobile/scrcpy/pull/6662>
2026-02-25 22:56:48 +01:00
Romain Vimont
f0a6e7658d Extract function to build file paths
Add a utility function to create a full path from a directory and a
filename.

PR #6662 <https://github.com/Genymobile/scrcpy/pull/6662>
2026-02-25 22:56:19 +01:00
Romain Vimont
6586f0bc7c Rename icon.png to scrcpy.png
This makes the icon name consistent everywhere.

PR #6662 <https://github.com/Genymobile/scrcpy/pull/6662>
2026-02-25 22:55:03 +01:00
Romain Vimont
10e0c3226c Fix typo in documentation
Refs #6667 comment <https://github.com/Genymobile/scrcpy/pull/6667#pullrequestreview-3848495119>

Suggested-by: anotheruserofgithub
2026-02-24 16:01:00 +01:00
2 changed files with 4 additions and 1 deletions

View File

@@ -1006,6 +1006,9 @@ sc_screen_handle_disconnection(struct sc_screen *screen) {
sc_icon_destroy(icon_disconnected);
break;
}
case SDL_EVENT_WINDOW_EXPOSED:
sc_screen_render(screen, true);
break;
case SC_EVENT_DISCONNECTED_TIMEOUT:
LOGD("Closing after device disconnection");
return;

View File

@@ -93,4 +93,4 @@ Then just double-click on that file to run it.
To start scrcpy without opening a terminal, double-click `scrcpy-noconsole.vbs`
(note that errors won't be shown). To pass arguments, edit (a copy of)
`scrcpy-noconsole.vbs` add and the desired arguments.
`scrcpy-noconsole.vbs` and add the desired arguments.