Rust Winit
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    1
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Winit meeting Date: 2024-08-23T15:00:00Z (UTC) Attended: @madsmtm, @daxpedda, @kchibisov, @MarijnS95 Last meeting notes: <https://hackmd.io/_YK76P6-TQq2Rw3s3Y3y_g> ## [Nominated](https://github.com/rust-windowing/winit/labels/C%20-%20nominated) issues and PRs ### https://github.com/rust-windowing/winit/pull/3479 Either get it in, or rewrite that part of the docs. ### https://github.com/rust-windowing/winit/pull/3751 John: The more the merrier, people have issues on certain niche targets. Idea: Tier system - Tier 1: It works - Tier 2: It compiles Problem: The CI gets longer and longer for "little gain". Would it make sense to only run on release? Rustix: Has to test all of the targets, since there's a lot of subtleties. Conclusion: John will open a new PR, with a deeper discussion of which targets we actually "support" Done: https://github.com/rust-windowing/winit/pull/3887 ### https://github.com/rust-windowing/winit/pull/3776 Monitors could become invalidated if you wait too long before you poll the event loop. And we don't want to provide users with things without a lifetime outside of the event loop. ### https://github.com/rust-windowing/winit/pull/3786 / https://github.com/rust-windowing/winit/issues/3779 ### https://github.com/rust-windowing/winit/pull/3795 Moving to explicit methods instead of `From`. ## Converting everything to `dyn` https://github.com/rust-windowing/winit/issues/3433 Case: https://github.com/rust-windowing/winit/pull/3857 Might be a bit late for me to start this discussion, but I _feel_ like this refactor might not be sufficiently motivated? It definitely complicates the user-facing API! Just to understand, what are the _actual_ problems that we're trying to solve? - Allow backends outside `winit` repo. - GTK - QT? - DRM/KMS - Redox/Orbital - N Wayland backends - Allow backends to define platform-specific behaviour and callbacks/handlers without polluting the global handler. Is that all? Or is there something here I'm missing? If that is the problems we're trying to solve, then I believe there are better solutions (not necessarily better in terms of the implementation, but definitely in terms of the user). Please don't take this wrongly, I'm just concerned that we might be complicating something we don't need to! **Primary motivation**: Social. Maintainers come and go. ### Window trait There are different kinds of window that share common logic. - Subsurfaces, ... Doesn't really need `dyn`? ### Different protocols Wayland protocol extensions, Wayland users could define custom ways to build the window. X11 could also use ... ### Maybe don't expose `dyn` to the user, but instead wrap ```rust struct Window(Box<dyn winit_core::Window>); trait winit_core::Window { fn set_title(&self, title: &str) { ... } } impl Deref for Window { type Target = dyn winit_core::Window; fn deref(&self) -> { // ... } } ``` ### Idea for external backends Backends outside repo alternative hacky: Declare the backend in `Cargo.toml`: ```toml [features] unstable-gtk = ["gtk-backend-tauri"] [dependencies] # Intentionally `~version`, since we e.g. add a method in Winit core, # and that would break this, and then we'd need the ... gtk-backend-tauri = { version = "~1.2.3", optional = true } ``` In `platform_impl`, do something like: ```rust #[cfg(feature = "unstable-gtk")] use gtk_backend_tauri::*; #[cfg(not(feature = "unstable-gtk"))] // ... ``` This would only require us to: - Expose the core types (which we have to do anyways with the other approach) - Keep a list of alternative backends around - Update the backend once the inner crate is updated to support newer Winit APIs We don't even have to provide CI that runs this, we could just say that's up to the external implementation ### `WindowEnum` We can consider providing something like this: ```rust enum WindowEnum { AppKit(winit_app_kit::Window), UIKit(winit_ui_kit::Window), X11(winit_x11::Window), // ... } impl winit_core::Window for WindowEnum { // ... } ``` ## PointerCancel vs. PointerLeft https://github.com/rust-windowing/winit/issues/3833 / https://github.com/rust-windowing/winit/pull/3876 Touch doesn't have a concept of leave. Provided that users track pointer button clicks, they can determine whether it was a cancel or a leave. The question is: Is there a use-case where we expose PointerCancel? Conclusion: Merge `CursorLeft` and `TouchCancel` into `PointerLeft`, but should be documented that we have chosen to do this, and that the user can open an issue if there is a use-case for them being separate. ## https://github.com/rust-windowing/winit/pull/3864 Good to move forwards with. ## Merging public API PRs without full approval from everyone Two approvals for public API, then it's fine to merge, as long as we have enough people that review. ## `MonitorHandle` It works something like this internally: ```rust struct MonitorHandle { internal_id: *const InnerHandle, cached_refresh_rate: Arc<Mutex<u32>>, // ... } impl MonitorHandle { fn refresh_rate(&self) -> u32 { *self.cached_refresh_rate.lock() } } impl EventLoop { // Internal fn monitor_handle_update(&self) { *self.monitors.get(id).cached_refresh_rate.lock() = new_refresh_rate; } } ``` Should use `Rc<Cell<u32>>` instead, so it's only main-thread safe.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully