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

Initial window size not correct on Linux #2657

Open
4 tasks done
andrewdavidmackenzie opened this issue Nov 1, 2024 · 0 comments
Open
4 tasks done

Initial window size not correct on Linux #2657

andrewdavidmackenzie opened this issue Nov 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@andrewdavidmackenzie
Copy link

Is your issue REALLY a bug?

  • My issue is indeed a bug!
  • I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.

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?

I am seeing this problem on Linux but not Macos:

I set an initial window size with Iced::application() in my main()

.window_size(LayoutSelector::get_default_window_size())

of this size:

const BOARD_LAYOUT_SIZE: Size = Size {
    width: 1400.0,
    height: 720.0,
};

The window appears with a size smaller than specified, and scroll bars are shown, "Measuring" window size with a screen capture tool I get these sizes:

Initial: 1289x727 pixels

After changing layout (and size) using my app's layout selector, and then changing back to the same (requested) size, I get:
Resized : 1369x751 pixels

I'm not sure why narrower than requested, and additional height is the window manager/title bar I assume.

Its hard to tell if this is an Iced bug, or the window manager overriding the initial window size.

Is there any way to force the initial window size?

This is running on Pop! with Cosmic Desktop, using crates.io release 0.13.1

Code can be found here

What is the expected behavior?

The initial window size is the requested window size (or slightly adjusted as we see above), that coincides with the size achieved when using window_resize() later and the window displays without the need forscrollbars.

Version

crates.io release

Operating System

Linux

Do you have any log output?

N/A
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

1 participant