Romain Vimont
02448d62b2
Remove obsolete workaround for macOS
...
Refs #3031 <https://github.com/Genymobile/scrcpy/pull/3031 >
Refs SDL/#5340 <https://github.com/libsdl-org/SDL/issues/5340 >
Refs SDL/#5976 <https://github.com/libsdl-org/SDL/issues/5976 >
PR #6216 <https://github.com/Genymobile/scrcpy/pull/6216 >
2026-01-04 14:21:28 +01:00
Romain Vimont
b474f508d7
Fix asynchronous SDL window state handling
...
The SDL3 migration guide [1] says:
> The following window operations are now considered to be asynchronous
requests and should not be assumed to succeed unless a corresponding
event has been received […]
Remove the boolean fields used to track the window state, as they were
fundamentally inconsistent with SDL's internal state. Use
SDL_GetWindowFlags() explicitly instead.
[1]: <https://wiki.libsdl.org/SDL3/README-migration >
Refs #6216 comment <https://github.com/Genymobile/scrcpy/pull/6216#discussion_r2651810005 >
PR #6216 <https://github.com/Genymobile/scrcpy/pull/6216 >
2026-01-04 14:20:45 +01:00
Romain Vimont
4b01203fbe
Disable "resize to pixel-perfect" when maximized
...
This improves consistency and will simplify further refactors.
PR #6216 <https://github.com/Genymobile/scrcpy/pull/6216 >
2026-01-04 14:20:19 +01:00
Romain Vimont
8be8840314
Check programming errors reported by SDL3
...
Refs #6216 comment <https://github.com/Genymobile/scrcpy/pull/6216#issuecomment-3399353701 >
Refs SDL/#14223 <https://github.com/libsdl-org/SDL/issues/14223 >>
PR #6216 <https://github.com/Genymobile/scrcpy/pull/6216 >
2026-01-04 14:15:12 +01:00
Romain Vimont
661103a5fa
Migrate from SDL2 to SDL3
...
Refs <https://wiki.libsdl.org/SDL3/README-migration >
PR #6216 <https://github.com/Genymobile/scrcpy/pull/6216 >
2026-01-04 14:14:42 +01:00
Romain Vimont
f8e0b9be4b
Improve color space conversion
...
Use both the color space and color range from FFmpeg to determine the
appropriate SDL YUV conversion mode.
PR #6216 <https://github.com/Genymobile/scrcpy/pull/6216 >
2026-01-04 14:14:33 +01:00
Romain Vimont
ed62ca124c
Set color range during texture creation
...
This prepares for the migration to SDL3, where the color range can only
be specified at the time of texture creation.
PR #6216 <https://github.com/Genymobile/scrcpy/pull/6216 >
2026-01-04 14:14:18 +01:00
Romain Vimont
3571fe62ed
Create texture on first frame
...
The texture was created as soon as the initial video size was known,
even before the first frame arrived.
However, texture creation will require other data, such as the color
range, which is only available once the first frame is received.
Therefore, delay texture creation until the first frame.
PR #6216 <https://github.com/Genymobile/scrcpy/pull/6216 >
2026-01-04 14:13:33 +01:00
Romain Vimont
bca98133d1
Remove prepare_for_frame()
...
Inline the function body into its only caller to simplify further
refactors.
PR #6216 <https://github.com/Genymobile/scrcpy/pull/6216 >
2026-01-04 14:12:12 +01:00
Romain Vimont
881c71b2e8
Handle mouse integer scrolling locally
...
Do not rely on SDL to expose integer scroll values, as they are not
available in all versions.
It was reimplemented in SDL 3.2.12 by this commit:
<0447c2f3c3 >
Refs #6156 <https://github.com/Genymobile/scrcpy/issues/6156 >
PR #6216 <https://github.com/Genymobile/scrcpy/pull/6216 >
2026-01-04 14:11:51 +01:00
Romain Vimont
b0da401e6d
Fix documentation of input_events.h
...
Add missing reference to sc_gamepad_processor.
Refs #6216 comment <https://github.com/Genymobile/scrcpy/pull/6216#pullrequestreview-3616928335 >
2026-01-04 14:04:34 +01:00
Romain Vimont
dba2a3778f
Include USB header only if HAVE_USB
2026-01-02 14:59:10 +01:00
Romain Vimont
06fd3b4786
Bump version to 3.3.4
2025-12-17 19:57:50 +01:00
Romain Vimont
6f9eb31d52
Add missing test for START_APP serialization
...
A test for Java deserialization of the START_APP control message was
already present, but the corresponding C-side serialization test was
missing.
Refs 13ce277e1f
2025-11-25 00:13:13 +01:00
Romain Vimont
3281fda6ef
Set URL explicitly in dependency build scripts
...
Explicitly set the URL of each dependency at the beginning of its
script.
PROJECT_DIR and FILENAME are internal details.
2025-10-30 22:31:16 +01:00
Romain Vimont
925949d54a
Refactor dependency build scripts initialization
...
Rename "common" to "_init" because it not only exposes common functions
but also initializes environment variables.
Call _init in a single line in all dependency build scripts.
2025-10-30 22:27:17 +01:00
Romain Vimont
3e40b24737
Fix UHID_OUTPUT message parsing
...
The bounds check was incorrect.
Fixes #6415 <https://github.com/Genymobile/scrcpy/issues/6415 >
2025-10-09 09:35:14 +02:00
Romain Vimont
10a0974f43
Bump version to 3.3.3
2025-09-23 21:18:45 +02:00
Romain Vimont
be21e43be5
Fix frame leak on pending frame update
...
The previous pending frame was not unreferenced before referencing the
new one, causing frames to leak whenever a texture update failed
(typically on Windows when the window is minimized with D3D9).
Refs 6298ef095f
Fixes #4297 <https://github.com/Genymobile/scrcpy/issues/4297 >
Fixes #6357 <https://github.com/Genymobile/scrcpy/issues/6357 >
2025-09-23 21:18:45 +02:00
Romain Vimont
bfb0872493
Avoid resetting pending frame
...
The function update_texture() calls update_texture_internal() and falls
back to set_pending_frame() if it fails.
When the frame passed is the pending frame, call only the _internal()
version instead.
This will prevent issues with frame reference counts by ensuring the
source and destination frames are never the same.
Refs 6298ef095f
Refs #6357 <https://github.com/Genymobile/scrcpy/issues/6357 >
2025-09-23 21:18:08 +02:00
Romain Vimont
2506d1768b
Bump version to 3.3.2
2025-09-06 14:36:37 +02:00
Filip Buda
8057835a0d
Catch CTRL_BREAK_EVENT signal on Windows
...
This ensures the process can terminate properly when a CTRL_BREAK_EVENT
signal is sent programmatically.
PR #6244 <https://github.com/Genymobile/scrcpy/pull/6244 >
Signed-off-by: Romain Vimont <rom@rom1v.com >
2025-08-12 18:17:32 +02:00
Yan
e47529ab9c
Fix gl_context declared type
...
The field gl_context is initialized from SDL_GL_CreateContext(), which
returns a raw SDL_GLContext, not a pointer.
The type mismatch was silently ignored by SDL2 because SDL_GLContext
was defined as an alias to `void *` (in SDL3, it is instead an alias to
`struct SDL_GLContextState *`, so compilation fails).
Refs #3895 <https://github.com/Genymobile/scrcpy/pull/3895 >
PR #6259 <https://github.com/Genymobile/scrcpy/pull/6259 >
Signed-off-by: Romain Vimont <rom@rom1v.com >
2025-08-12 18:08:22 +02:00
Romain Vimont
eb576c44f8
Replace __WINDOWS__ by _WIN32
...
Replace the SDL2-specific preprocessor macro __WINDOWS__ by the
"standard" _WIN32 macro.
2025-07-17 18:23:25 +02:00
Romain Vimont
0522d02d40
Add missing includes
...
The headers were implicitly included recursively, but include them
explicitly.
2025-07-17 18:23:12 +02:00
Romain Vimont
30bfc80f9b
Fix style for 80-char limit
2025-07-17 13:20:45 +02:00
Romain Vimont
a79ddc35a7
Update platform-tools checksums
...
The release binaries of platform-tools_r36.0.0 have changed upstream.
Both releases versions are referenced from
<https://dl.google.com/android/repository/repository2-2.xml >
Refs #6214 <https://github.com/Genymobile/scrcpy/issues/6214 >
Refs <https://issuetracker.google.com/issues/431119334 >
2025-07-17 13:20:45 +02:00
Romain Vimont
04542a9f58
Fix window leak on icon error
2025-07-17 13:19:15 +02:00
Romain Vimont
8761dcb7a8
Fix SDL dependency script error message
...
Commit 360936248c mistakenly left an
additional 'H' when replacing $HOST with $DIRNAME.
Refs <https://github.com/Genymobile/scrcpy/pull/6216#issuecomment-3076069802 >
2025-07-16 19:09:47 +02:00
Romain Vimont
5b18ce0d2e
Bump version to 3.3.1
2025-06-20 19:54:16 +02:00
Romain Vimont
4841fdd1ef
Add horizontal scrolling support for HID mouse
...
PR #6172 <https://github.com/Genymobile/scrcpy/pull/6172 >
2025-06-20 19:54:16 +02:00
Romain Vimont
fc75319bb2
Fix HID mouse support with SDL precise scrolling
...
Over HID, only integral scroll values can be sent. When SDL precise
scrolling is active, scroll events may include fractional values (e.g.,
0.05), which are truncated to 0 in the HID event.
To fix the problem, use the integral scroll value reported by SDL, which
internally accumulates fractional deltas.
Fixes #6156 <https://github.com/Genymobile/scrcpy/issues/6156 >
PR #6172 <https://github.com/Genymobile/scrcpy/pull/6172 >
2025-06-20 19:54:16 +02:00
Romain Vimont
7c8bdccbdc
Extend value range for SDK mouse scrolling
...
SDL precise scrolling can sometimes produce values greater than 1 or
less than -1.
On the wire, the value is encoded as a 16-bit fixed-point number.
Previously, the range was interpreted as [-1, 1], using 1 bit for the
integral part (the sign) and 15 bits for the fractional part.
To support larger values, interpret the range as [-16, 16] instead,
using 5 bits for the integral part and 11 bits for the fractional part
(which is more than enough).
PR #6172 <https://github.com/Genymobile/scrcpy/pull/6172 >
2025-06-20 19:54:16 +02:00
Romain Vimont
9787fe5d26
Preserve original scroll values in mouse event
...
Clamp scroll values to [-1, 1] only for the SDK mouse.
HID mouse implementations perform their own clamping to [-127, 127] (in
hid_mouse.c).
PR #6172 <https://github.com/Genymobile/scrcpy/pull/6172 >
2025-06-20 18:30:50 +02:00
berk ziya
38256d8ff9
Fix deprecated brew command
...
`brew cask` is an outdated command, replaced by `brew install --cask`.
Refs #5398 <https://github.com/Genymobile/scrcpy/pull/5398 >
PR #6149 <https://github.com/Genymobile/scrcpy/pull/6149 >
Signed-off-by: Romain Vimont <rom@rom1v.com >
2025-06-12 15:30:04 +02:00
Romain Vimont
dc169e425e
Bump version to 3.3
2025-06-11 19:39:48 +02:00
Romain Vimont
454beaa757
Upgrade libusb (1.0.29)
2025-06-11 19:39:02 +02:00
Romain Vimont
1a9ffb3814
Upgrade SDL (2.32.8)
2025-06-11 19:38:29 +02:00
Romain Vimont
ac16be54c8
Upgrade platform-tools (36.0.0)
2025-06-11 19:36:22 +02:00
Colin Kinloch
d2cc930975
Add app name SDL hint
...
This allows pulseaudio to label the audio stream "scrcpy" rather than
"SDL Application".
PR #6107 <https://github.com/Genymobile/scrcpy/pull/6107 >
Signed-off-by: Romain Vimont <rom@rom1v.com >
2025-06-05 19:59:59 +02:00
Romain Vimont
70bfa2cf39
Remove useless flag in zsh completion script
...
The -N flag is only useful after a pattern section (-p) to switch back
to listing command names.
Refs <https://zsh.sourceforge.io/Doc/Release/Completion-System.html >
2025-05-22 20:00:58 +02:00
hltdev8642
38f779d9d3
Escape parentheses in zsh completion script
...
PR #6079 <https://github.com/Genymobile/scrcpy/pull/6079 >
Co-authored-by: Romain Vimont <rom@rom1v.com >
Signed-off-by: Romain Vimont <rom@rom1v.com >
2025-05-22 20:00:53 +02:00
Romain Vimont
1a0d300786
Add missing --screen-off-timeout doc in manpage
...
Refs eff5b4b219
2025-04-14 18:07:37 +02:00
Romain Vimont
d2447b5c19
Fix --screen-off-timeout bash completion
...
Only the option must be auto-completed, not its value.
2025-04-14 18:05:08 +02:00
Romain Vimont
882003f314
Fix segfault on SDL event without window
...
Since #5804 , controls have been enabled even with --no-window. As a
result, the Android clipboard is synchronized with the computer, causing
SDL to trigger an SDL_CLIPBOARDUPDATE event.
This event is ignored by scrcpy, but it was still transmitted to the
sc_screen instance, even if it had not been initialized.
Fix the issue by calling sc_screen_handle_event() only when a screen
instance exists.
Refs #5804 <https://github.com/Genymobile/scrcpy/pull/5804 >
Fixes #5970 <https://github.com/Genymobile/scrcpy/issues/5970 >
2025-04-03 08:15:55 +02:00
Romain Vimont
89b624770c
Bump version to 3.2
2025-03-29 15:45:28 +01:00
Romain Vimont
79227af89f
Merge branch 'master' into release
2025-03-29 15:44:29 +01:00
Romain Vimont
5d12d9071d
Upgrade FFmpeg (7.1.1)
2025-03-29 15:34:48 +01:00
Romain Vimont
b7add42154
Upgrade SDL (2.32.2)
...
Also apply this additional patch to fix the build:
<6be87ceb33 >
2025-03-29 15:34:20 +01:00
Romain Vimont
dd1bfae4e0
Upgrade libusb (1.0.28)
2025-03-29 15:02:38 +01:00