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

App resolution is too high and does not follow system settings #2404

Open
2 tasks done
sang-shelton opened this issue Apr 24, 2024 · 3 comments
Open
2 tasks done

App resolution is too high and does not follow system settings #2404

sang-shelton opened this issue Apr 24, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@sang-shelton
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

This issue is mentioned in detail here and here.

Screenshots of the issue with iced apps

Screenshot_2024-04-24_22-40-21

Screenshot_2024-04-24_22-38-38

As you can see, the resolution is too high and the components are smaller than normal on the screen.

What is the expected behavior?

The apps should display correctly respecting the custom window scaling and DPI.
GTK3 and 4 apps display well as far as i tested.

Version

master

Operating System

Linux

Do you have any log output?

cargo r --package tour

    Finished dev [unoptimized + debuginfo] target(s) in 0.12s
     Running `/home/chakra/Projects/rust/iced/target/debug/tour`
2024-04-24T19:49:36.514414Z  INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 0.78125    
2024-04-24T19:49:36.538735Z  WARN wgpu_hal::vulkan::instance: InstanceFlags::VALIDATION requested, but unable to find layer: VK_LAYER_KHRONOS_validation    
2024-04-24T19:49:36.544730Z  INFO wgpu_hal::vulkan::instance: Debug utils not enabled: debug_utils_user_data not passed to Instance::from_raw    
2024-04-24T19:49:36.548421Z  INFO wgpu_hal::gles::egl: Using X11 platform    
2024-04-24T19:49:36.550329Z  WARN wgpu_hal::gles::egl: No config found!    
2024-04-24T19:49:36.550343Z  WARN wgpu_hal::gles::egl: EGL says it can present to the window but not natively    
2024-04-24T19:49:36.554307Z  INFO iced_wgpu::window::compositor: Settings {
    present_mode: AutoVsync,
    backends: Backends(
        VULKAN | GL | METAL | DX12 | BROWSER_WEBGPU,
    ),
    default_font: Font {
        family: SansSerif,
        weight: Normal,
        stretch: Normal,
        style: Normal,
    },
    default_text_size: Pixels(
        16.0,
    ),
    antialiasing: None,
}    
2024-04-24T19:49:36.577351Z  INFO wgpu_core::instance: Adapter Vulkan AdapterInfo { name: "NVIDIA GeForce RTX 3060", vendor: 4318, device: 9351, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "525.147.05", backend: Vulkan }    
2024-04-24T19:49:36.577416Z  INFO wgpu_core::instance: Adapter Vulkan AdapterInfo { name: "llvmpipe (LLVM 15.0.6, 256 bits)", vendor: 65541, device: 0, device_type: Cpu, driver: "llvmpipe", driver_info: "Mesa 23.1.2-1~mx23ahs (LLVM 15.0.6)", backend: Vulkan }    
2024-04-24T19:49:36.614211Z  INFO wgpu_core::instance: Adapter Gl AdapterInfo { name: "NVIDIA GeForce RTX 3060/PCIe/SSE2", vendor: 4318, device: 0, device_type: Other, driver: "", driver_info: "", backend: Gl }    
2024-04-24T19:49:36.614296Z  INFO iced_wgpu::window::compositor: Available adapters: [
    AdapterInfo {
        name: "NVIDIA GeForce RTX 3060",
        vendor: 4318,
        device: 9351,
        device_type: DiscreteGpu,
        driver: "NVIDIA",
        driver_info: "525.147.05",
        backend: Vulkan,
    },
    AdapterInfo {
        name: "llvmpipe (LLVM 15.0.6, 256 bits)",
        vendor: 65541,
        device: 0,
        device_type: Cpu,
        driver: "llvmpipe",
        driver_info: "Mesa 23.1.2-1~mx23ahs (LLVM 15.0.6)",
        backend: Vulkan,
    },
    AdapterInfo {
        name: "NVIDIA GeForce RTX 3060/PCIe/SSE2",
        vendor: 4318,
        device: 0,
        device_type: Other,
        driver: "",
        driver_info: "",
        backend: Gl,
    },
]    
2024-04-24T19:49:36.621105Z  INFO wgpu_core::instance: Adapter Vulkan AdapterInfo { name: "NVIDIA GeForce RTX 3060", vendor: 4318, device: 9351, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "525.147.05", backend: Vulkan }    
2024-04-24T19:49:36.621138Z  INFO iced_wgpu::window::compositor: Selected: AdapterInfo {
    name: "NVIDIA GeForce RTX 3060",
    vendor: 4318,
    device: 9351,
    device_type: DiscreteGpu,
    driver: "NVIDIA",
    driver_info: "525.147.05",
    backend: Vulkan,
}    
2024-04-24T19:49:36.621269Z  INFO iced_wgpu::window::compositor: Available formats: Copied {
    it: Iter(
        [
            Bgra8UnormSrgb,
            Bgra8Unorm,
        ],
    ),
}    
2024-04-24T19:49:36.621281Z  INFO iced_wgpu::window::compositor: Available alpha modes: [
    Opaque,
]    
2024-04-24T19:49:36.621289Z  INFO iced_wgpu::window::compositor: Selected format: Bgra8UnormSrgb with alpha mode: Auto    
2024-04-24T19:49:36.742533Z  WARN fontdb: Failed to load a font face 0 from '/home/chakra/.fonts/PIE4MAP.TTF' cause font doesn't have a family name.    
2024-04-24T19:49:36.742673Z  INFO cosmic_text::font::system: Parsed 491 font faces in 30ms.
@sang-shelton sang-shelton added the bug Something isn't working label Apr 24, 2024
@hecrj
Copy link
Member

hecrj commented Apr 24, 2024

winit has a hard time figuring out the proper DPI scaling on Linux. As you can see from your logs:

INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 0.78125

You probably want that to be 2.0. I believe you can add yet another hint for winit and other Linux apps to use proper scaling in your ~/.Xresources file. Try:

Xft.dpi: 192

@sang-shelton
Copy link
Author

I believe you can add yet another hint for winit and other Linux apps to use proper scaling in your ~/.Xresources file.

.Xresources was not in my home dir so i had to create it and add that line. I rebooted and nothing changed.

@sang-shelton
Copy link
Author

Is it possible when developing an iced app to let the user setup the interface scaling manually from within the app, like veloren does ?

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

No branches or pull requests

2 participants