Skip to content

Impossible/inconvenient to use dioxus_desktop::Config.with_custom_event_handler() #4777

@for-lack-of-a-better-name-j

Description

Problem
It is either impossible or extremely inconvenient to use dioxus_desktop::Config::with_custom_event_handler().
The type signature f: impl FnMut(&Event<'_, UserWindowEvent>, &EventLoopWindowTarget<UserWindowEvent>) + 'static, is either very difficult or impossible to implement because dioxus_desktop::ipc::UserWindowEvent, the type required in the signature, is not public.

Steps To Reproduce

Steps to reproduce the behavior:

  • Create a dioxus_desktop::Config.
  • Attempt to use .with_custom_event_handler() on it.

Expected behavior

I expect to be able to use a custom callback to match on event loop events.

Environment:

  • Dioxus version: 0.6.3
  • Rust version: rustc 1.90.0, edition 2021
  • OS info: Arch Linux
  • App platform: Desktop
    Questionnaire

I have a workaround for now, but I am wondering if this was an intentional design choice and am hesitant to use it.

The fix is to make the dioxus_desktop::ipc module public.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdesktopSuggestions related to the desktop renderer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions