Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pointermove events on Windows crash with InvalidType #2385

Open
1 of 3 tasks
esimkowitz opened this issue May 2, 2024 · 3 comments
Open
1 of 3 tasks

pointermove events on Windows crash with InvalidType #2385

esimkowitz opened this issue May 2, 2024 · 3 comments
Labels
bug Something isn't working desktop Suggestions related to the desktop renderer windows

Comments

@esimkowitz
Copy link
Contributor

esimkowitz commented May 2, 2024

Problem

The onpointermove event appears broken on Windows. When a component that binds to this event is present, the moment the user moves the cursor, the main thread panics with an InvalidType error.

Steps To Reproduce

Steps to reproduce the behavior:

  • Create a component that binds to the onpointermove event.
  • On Windows, run dx serve --platform desktop
  • Access the component with the bound event
  • Try moving the mouse
  • Observe that the application crashes

Expected behavior

Binding to the onpointermove event should return an Event<PointerData> event to the event handler.

Screenshots

N/A

Environment:

  • Dioxus version: 0.5.1
  • Rust version: 1.78.0
  • OS info: Windows 11 (22631.3527)
  • App platform: desktop

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later
@esimkowitz
Copy link
Contributor Author

Adding the stack trace:

thread 'main' panicked at C:\Users\Gaming PC\.cargo\registry\src\index.crates.io-6f17d22bba15001f\dioxus-html-0.5.1\src\transit.rs:41:17:
Failed to deserialize event data for event pointermove:  InvalidType(
    Float(
        462.484375,
    ),
    "i32",
)
'Map(
    {
        String(
            "alt_key",
        ): Bool(
            false,
        ),
        String(
            "button",
        ): I64(
            -1,
        ),
        String(
            "buttons",
        ): U64(
            0,
        ),
        String(
            "client_x",
        ): U64(
            691,
        ),
        String(
            "client_y",
        ): U64(
            176,
        ),
        String(
            "ctrl_key",
        ): Bool(
            false,
        ),
        String(
            "height",
        ): U64(
            1,
        ),
        String(
            "is_primary",
        ): Bool(
            true,
        ),
        String(
            "meta_key",
        ): Bool(
            false,
        ),
        String(
            "offset_x",
        ): F64(
            462.484375,
        ),
        String(
            "offset_y",
        ): F64(
            129.296875,
        ),
        String(
            "page_x",
        ): U64(
            691,
        ),
        String(
            "page_y",
        ): U64(
            176,
        ),
        String(
            "pointer_id",
        ): U64(
            1,
        ),
        String(
            "pointer_type",
        ): String(
            "mouse",
        ),
        String(
            "pressure",
        ): U64(
            0,
        ),
        String(
            "screen_x",
        ): U64(
            907,
        ),
        String(
            "screen_y",
        ): U64(
            435,
        ),
        String(
            "shift_key",
        ): Bool(
            false,
        ),
        String(
            "tangential_pressure",
        ): U64(
            0,
        ),
        String(
            "tilt_x",
        ): U64(
            0,
        ),
        String(
            "tilt_y",
        ): U64(
            0,
        ),
        String(
            "twist",
        ): U64(
            0,
        ),
        String(
            "width",
        ): U64(
            1,
        ),
    },
)'
stack backtrace:
   0:     0x7ff78149f41a - <unknown>
   1:     0x7ff7814c05db - <unknown>
   2:     0x7ff78149b7f1 - <unknown>
   3:     0x7ff78149f206 - <unknown>
   4:     0x7ff7814a162f - <unknown>
   5:     0x7ff7814a12c7 - <unknown>
   6:     0x7ff7814a1b6d - <unknown>
   7:     0x7ff7814a1a29 - <unknown>
   8:     0x7ff78149fd29 - <unknown>
   9:     0x7ff7814a16e6 - <unknown>
  10:     0x7ff7814c9357 - <unknown>
  11:     0x7ff780ef75e4 - <unknown>
  12:     0x7ff780ee97cd - <unknown>
  13:     0x7ff780ef6f6c - <unknown>
  14:     0x7ff780f75a81 - <unknown>
  15:     0x7ff780f18f5a - <unknown>
  16:     0x7ff780f026f3 - <unknown>
  17:     0x7ff780f65a1c - <unknown>
  18:     0x7ff780f8e645 - <unknown>
  19:     0x7ff780f82834 - <unknown>
  20:     0x7ff780f35f84 - <unknown>
  21:     0x7ff780f54904 - <unknown>
  22:     0x7ff780f5a493 - <unknown>
  23:     0x7ff780f542da - <unknown>
  24:     0x7ff780f788d9 - <unknown>
  25:     0x7ff780f801c5 - <unknown>
  26:     0x7ff780f8255b - <unknown>
  27:     0x7ff780f7ff1c - <unknown>
  28:     0x7ff780f708c3 - <unknown>
  29:     0x7ff780f70718 - <unknown>
  30:     0x7ff780eb8fd7 - <unknown>
  31:     0x7ff780f36011 - <unknown>
  32:     0x7ff780f5485d - <unknown>
  33:     0x7ff780f5a493 - <unknown>
  34:     0x7ff780f5470b - <unknown>
  35:     0x7ff780f788c1 - <unknown>
  36:     0x7ff780f81372 - <unknown>
  37:     0x7ff780f6fc99 - <unknown>
  38:     0x7ffd096cd7bc - DefSubclassProc
  39:     0x7ffd096cd65c - DefSubclassProc
  40:     0x7ffd180289a1 - DispatchMessageW
  41:     0x7ffd18028461 - DispatchMessageW
  42:     0x7ff780f5a13f - <unknown>
  43:     0x7ff780f65779 - <unknown>
  44:     0x7ff780f65dfb - <unknown>
  45:     0x7ff780f7f6e1 - <unknown>
  46:     0x7ff780f02202 - <unknown>
  47:     0x7ff780f02c2e - <unknown>
  48:     0x7ff780eefa27 - <unknown>
  49:     0x7ff780eef94c - <unknown>
  50:     0x7ff780f87000 - <unknown>
  51:     0x7ff780f86a91 - <unknown>
  52:     0x7ff780eadff6 - <unknown>
  53:     0x7ff780f7c149 - <unknown>
  54:     0x7ff780f57f28 - <unknown>
  55:     0x7ff780f7c104 - <unknown>
  56:     0x7ff780f0a5b7 - <unknown>
  57:     0x7ff780f02a80 - <unknown>
  58:     0x7ff780f02e6e - <unknown>
  59:     0x7ff780ea83f2 - <unknown>
  60:     0x7ff780ca4988 - <unknown>
  61:     0x7ff780ca22be - <unknown>
  62:     0x7ff780ca1252 - <unknown>
  63:     0x7ff780ca1f3b - <unknown>
  64:     0x7ff780ca12ee - <unknown>
  65:     0x7ff780ca1631 - <unknown>
  66:     0x7ff781497582 - <unknown>
  67:     0x7ff780ca160a - <unknown>
  68:     0x7ff780ca12d9 - <unknown>
  69:     0x7ff7814c695c - <unknown>
  70:     0x7ffd184f257d - BaseThreadInitThunk
  71:     0x7ffd19d8aa48 - RtlUserThreadStart

@DogeDark
Copy link
Member

DogeDark commented May 3, 2024

I am unable to reproduce it on Windows 10. Perhaps it's a Windows 11 issue? I used this code snippet (is this what causes the crash for you?)

rsx! {
    div {
        style: "width: 10vw; height: 10vh; background-color: red;",
        onpointermove: move |data| {
            println!("hi | {:?}", data);
        }
    }
}

@DogeDark DogeDark added bug Something isn't working desktop Suggestions related to the desktop renderer windows labels May 3, 2024
@esimkowitz
Copy link
Contributor Author

esimkowitz commented May 3, 2024

I am unable to reproduce it on Windows 10. Perhaps it's a Windows 11 issue? I used this code snippet (is this what causes the crash for you?)

Yeah this is what caused the issue for me. The event handler is never getting reached, it seems like it's crashing in the event mapping code. I can try to dig into it a bit more and see if there's some field that is getting added for Windows 11 that we're missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working desktop Suggestions related to the desktop renderer windows
Projects
None yet
Development

No branches or pull requests

2 participants