Skip to content

Commit 1022b99

Browse files
committed
Removed platform-specific screenshot implementation from capture_screenshot_inner and fallback to JVM paint().
1 parent 6eed78c commit 1022b99

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

  • wrywebview/src/main/rust

wrywebview/src/main/rust/lib.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -776,21 +776,11 @@ pub fn drain_ipc_messages(id: u64) -> Result<Vec<String>, WebViewError> {
776776

777777
fn capture_screenshot_inner(id: u64) -> Result<Vec<u8>, WebViewError> {
778778
wry_log!("[wrywebview] capture_screenshot id={}", id);
779-
with_webview(id, |webview| {
780-
#[cfg(target_os = "macos")]
781-
{
782-
webview
783-
.screenshot()
784-
.map_err(|e| WebViewError::Internal(e.to_string()))
785-
}
786-
#[cfg(not(target_os = "macos"))]
787-
{
788-
// For other platforms, wry might not have screenshot() in 0.54
789-
// Fallback to JVM paint() in WryWebViewPanel.kt if this returns error
790-
Err(WebViewError::Internal(
791-
"Native screenshot not implemented for this platform in Rust yet".to_string(),
792-
))
793-
}
779+
with_webview(id, |_webview| {
780+
// Fallback to JVM paint() in WryWebViewPanel.kt if this returns error
781+
Err(WebViewError::Internal(
782+
"Native screenshot not implemented for this platform in Rust yet".to_string(),
783+
))
794784
})
795785
}
796786

0 commit comments

Comments
 (0)