Skip to content

Win32: DPI Awareness is broken with OpenGL contexts #321

Closed

Description

@BillyDM

Fractional scaling does not appear to be working on Windows. This is the output I get when running the render_femtovg example with the display set to 125% scale.

Image

The mouse cursor is also not in the correct place.

Egui-baseview also looks pixelated and has an incorrect window size when ran in standalone mode on Windows with fractional scaling:

Image

When ran as a plugin, the window has an incorrect size:

Image

Activity

  1. prokopyl commented on Aug 22, 2026

    @prokopyl
    Member

    Notes from further testing from Discord:

    • This only affects OpenGL, not Wgpu/DirectX, nor softbuffer-based examples.
    • From added logging, baseview does indeed receive the updated DPI information, so this seems to be purely a rendering issue.
    • This has been only reproduced on AMD GPUs, but not tested on others. VMWare virtual GPUs are not affected by this issue somehow.
  2. BillyDM commented on Aug 22, 2026

    @BillyDM
    ContributorAuthor

    I know baseview manages its own OpenGL context. Is there maybe something special you need to do with the context on Windows? We could look into how glutin/glow does this.

  3. prokopyl commented on Aug 24, 2026

    @prokopyl
    Member

    Looking into this again, I just realized that the OpenGL view seems to be actually scaled twice for some reason?

    @BillyDM I'm not sure if this is a regression, have you had this problem with Baseview on windows before? Do you think you could bisect the issue?

  4. BillyDM commented on Aug 24, 2026

    @BillyDM
    ContributorAuthor

    Ok, I'll see if I can recreate the issue on an older version of baseview tomorrow.

  5. BillyDM commented on Aug 24, 2026

    @BillyDM
    ContributorAuthor

    Ok, found that the issue happens from 468c21b onwards (Win32: Migrate to Per-Monitor V2 Thread-based DPI awareness (#266)).

    The commits before that one start off at with the rendered image not filling the whole window, but after resizing the window once, everything works correctly.

  6. prokopyl commented on Aug 25, 2026

    @prokopyl
    Member

    @BillyDM Can you try the fix in this branch to see if it helps? https://github.com/RustAudio/baseview/tree/win32-opengl-fix

  7. BillyDM commented on Aug 25, 2026

    @BillyDM
    ContributorAuthor

    No, that doesn't fix it.

  8. prokopyl commented on Aug 26, 2026

    @prokopyl
    Member

    @BillyDM can you try the latest one on that branch?

    Sorry to use you as a ping-pong like that 😅

  9. danferns commented on Aug 26, 2026

    @danferns

    If you guys can use another hand I'm here :)

  10. danferns commented on Aug 26, 2026

    @danferns

    This also does not fix it.

  11. added
    bugSomething isn't working
    help wantedExtra attention is needed
    Needs more infoNeeds more information or reproducible steps in order to be worked on
    on Aug 30, 2026
  12. changed the title [-]Fractional scaling not working on Windows[/-] [+]Win32: DPI Awareness is broken with OpenGL contexts[/+] on Aug 30, 2026
  13. self-assigned this
    on Aug 30, 2026
  14. 5 remaining items

  15. danferns commented on Sep 5, 2026

    @danferns

    #334 works for me too on AMD!

  16. prokopyl commented on Sep 8, 2026

    @prokopyl
    Member

    Can you guys try if #335 helps for the plugin (embedded window) case?

  17. Soulusions commented on Sep 8, 2026

    @Soulusions

    On nVidia #335 doesn't seem to work (testing thru bitwig).

  18. danferns commented on Sep 9, 2026

    @danferns

    Just tried #335 on AMD. render_femtovg works perfectly. clack_plugin works the first time the window is opened on FL Studio. But if I reopen the window, the GUI is missing.

    Image

    After reopening:

    Image
  19. prokopyl commented on Sep 9, 2026

    @prokopyl
    Member

    @Soulusions @danferns I have added some extra (temporary) logging on Windows in the clack_plugin example, and added a new clack_plugin_femtovg plugin to test the OpenGL behavior, can you guys give it a try and share the plugin's log outputs?

  20. danferns commented on Sep 10, 2026

    @danferns

    Both plugins look good on my system.

    I've added logs from testing in Reaper (since FL Studio turns out to be at 100% scale for me).

    Clack plugin:

    // plugin opened on a 150% scale monitor
    2026-09-10T08:21:15.908358Z DEBUG baseview::platform::win::dpi: Using DPI Awareness Context of type Some(PerMonitorDpiAware).
    // moved to a 100% scale monitor, back and forth a couple of times
    Resized: WindowSize { physical: PhysicalSize { width: 191, height: 96 }, logical: LogicalSize { width: 127.33333333333333, height: 64.0 }, scale_factor: 1.5 }
    Resized: WindowSize { physical: PhysicalSize { width: 400, height: 201 }, logical: LogicalSize { width: 266.6666666666667, height: 134.0 }, scale_factor: 1.5 }
    Resized: WindowSize { physical: PhysicalSize { width: 191, height: 96 }, logical: LogicalSize { width: 127.33333333333333, height: 64.0 }, scale_factor: 1.5 }
    Resized: WindowSize { physical: PhysicalSize { width: 400, height: 201 }, logical: LogicalSize { width: 266.6666666666667, height: 134.0 }, scale_factor: 1.5 }
    // clicked on gui which initiates a resize
    Resized: WindowSize { physical: PhysicalSize { width: 450, height: 201 }, logical: LogicalSize { width: 300.0, height: 134.0 }, scale_factor: 1.5 }
    Resized: WindowSize { physical: PhysicalSize { width: 500, height: 201 }, logical: LogicalSize { width: 333.3333333333333, height: 134.0 }, scale_factor: 1.5 }
    // dragged corner a tiny bit
    Resized: WindowSize { physical: PhysicalSize { width: 499, height: 201 }, logical: LogicalSize { width: 332.6666666666667, height: 134.0 }, scale_factor: 1.5 }
    

    Clack plugin femtovg:

    2026-09-10T08:22:57.559574Z DEBUG baseview::platform::win::dpi: OpenGL context requested: bypassing DPI awareness checking, using process DPI awareness instead.
    2026-09-10T08:22:57.559659Z DEBUG baseview::platform::win::dpi: Using DPI Awareness Context of type Some(PerMonitorDpiAware).
    

    (Moved other issue to #337)

  21. prokopyl commented on Sep 11, 2026

    @prokopyl
    Member

    @danferns Thanks! The logs look like it's behaving correctly. For the other issues you raised, unless they're caused by #335, I think filing them as separate issues would be better, yes. 🙂

  22. prokopyl commented on Sep 11, 2026

    @prokopyl
    Member

    I just got my hands on an NVIDIA Windows system, and while I could reproduce the original issue, it seems #335 fixes it (both standalone and in Bitwig).

    @Soulusions do you still have issues with the latest commits on #335? If not then I think we'll be able to close this issue. 🙂

  23. added this to the v0.3.X milestone on Sep 11, 2026
  24. Soulusions commented on Sep 11, 2026

    @Soulusions

    I can't get logs due to bitwig running plugins in a "server", but it looks like now the behavior in femtosvg with opengl is good.

  25. BillyDM commented on Sep 11, 2026

    @BillyDM
    ContributorAuthor

    I can't get logs due to bitwig running plugins in a "server", but it looks like now the behavior in femtosvg with opengl is good.

    Plugin logs can be found in Bitwig's engine.log file.

  26. prokopyl commented on Sep 12, 2026

    @prokopyl
    Member

    I have just merged #335 and will publish it as part of the next release, since it seems to fix the issue for all of us I will close this issue, but feel free to comment here if the issue arises again. 🙂

  27. danferns commented on Sep 12, 2026

    @danferns

    Thank you Adrien, Billy, and @/Soulusions! Your work is really appreciated! This is not just great news for Rust plugin developers, but also of great benefit to users of said plugins! 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Needs more infoNeeds more information or reproducible steps in order to be worked onbugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions