The Edge backend doesn't dispatch events when the window is being dragged around
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 179
- PR merge metrics
- No merged PRs in 30d
Description
When I drag the window around, my callbacks issued through the `Handle` don't get called.
This does **not** happen with the IE backend (without the "edge" feature).
From my very short debugging, the `PostThreadMessage` call inside webview-sys still returns `TRUE` even when this happens.
**Cargo.toml**
```toml
[dependencies]
web-view = { version = "0.7", features = ["edge"] }
```
**main.rs**
```rust
use std::time::Duration;
use web_view::*;
fn main() {
let html = r#"
function change_text(text) {
document.getElementById('mybutton').value = text;
}
"#;
builder()
.content(Content::Html(html))
.user_data(())
.invoke_handler(|webview, arg| match arg {
"button_click" => {
{
let webview = webview.handle();
std::thread::spawn(move || {
std::thread::sleep(Duration::from_secs(2));
webview.dispatch(|webview|
// if you are dragging the window around, this doesn't get invoked
webview.eval("change_text('Goodbye, world!')"))
});
}
Ok(())
}
_ => unimplemented!(),
})
.run()
.unwrap();
}
```
Affected versions:\
- 0.7.2
- master
- (possibly others)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the issue with the Cargo.toml dependency and main.rs example, then inspect the webview-sys PostThreadMessage path used by Handle::dispatch. Done means callbacks still dispatch while the Edge window is being dragged, matching the IE backend behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, rust
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100