ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
59.77k stars 10.17k forks source link

Window content is blurry on Wayland with fractional scaling #7433

Open mimi89999 opened 6 months ago

mimi89999 commented 6 months ago

Version/Branch of Dear ImGui:

868facff9ded2d61425c67deeba354eb24275bd1

Back-ends:

glfw+opengl3

Compiler, OS:

Debian Trixie

Full config/build information:

Dear ImGui 1.90.5 WIP (19046)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=201103
define: __linux__
define: __GNUC__=13
--------------------------------
io.BackendPlatformName: imgui_impl_glfw
io.BackendRendererName: imgui_impl_opengl3
io.ConfigFlags: 0x00000003
 NavEnableKeyboard
 NavEnableGamepad
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x0000000E
 HasMouseCursors
 HasSetMousePos
 RendererHasVtxOffset
--------------------------------
io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 512,64
io.DisplaySize: 1280.00,720.00
io.DisplayFramebufferScale: 1.25,1.25
--------------------------------
style.WindowPadding: 8.00,8.00
style.WindowBorderSize: 1.00
style.FramePadding: 4.00,3.00
style.FrameRounding: 0.00
style.FrameBorderSize: 0.00
style.ItemSpacing: 8.00,4.00
style.ItemInnerSpacing: 4.00,4.00

Details:

My Issue:

On Linux systems (didn't test others) with HiDPI screens and Wayland, when fractional scaling is enabled, imgui window content is blurry. It has the correct size though.

Screenshots/Video:

Capture d’écran du 2024-03-23 18-48-58

Minimal, Complete and Verifiable Example code:

Simply run example_glfw_opengl3

cfillion commented 6 months ago

The built-in font is made of 13px bitmaps. Scaling it to anything but an integer will look blurry. Try loading a vector font at the appropriate scaled size.

https://github.com/ocornut/imgui/blob/master/docs/FONTS.md

mimi89999 commented 6 months ago

I loaded the Cantarell and Roboto fonts and nothing changed.

philippludwig commented 1 month ago

Make sure that you increase the font size and don't use the scaling option.