question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fullscreen window width greater than screen width

See original GitHub issue

Describe the bug When the application is in the fullscreen state the width is greater than my screen size. This may cause some elements to be not fully displayed.

To Reproduce Steps to reproduce the behavior:

  • Create a new project from Avalonia MVVM template
  • Add ExtendClientAreaToDecorationsHint="true" to MainWindow.axaml
  • Change the alignment of the text to HorizontalAlignment="Left"
  • Run the app and change the state to fullscreen

Expected behavior The message should be fully visible

Screenshots Screen from the debugger (My screen resolution is 1920x1080px): image

Example of the bug: image

Desktop (please complete the following information):

  • OS: Windows 10
  • Version 0.10.0

Additional context At first, I thought it is the bug in https://github.com/AvaloniaUI/XamlControlsGallery/issues/8 , but it is reproducible for all windows that use ExtendClientAreaToDecorationsHint="true".

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
amwxcommented, May 3, 2021

This is a Win32 thing. To hide the system border when maximized, Windows enlarges the window ~8px on each side, but when the frame is extended, windows doesn’t turn this logic off automatically and requires special handling of WM_NCCALCSIZE to adjust the client rect which is now the whole window.

The simplest solution though is just to add 8px of padding to the window only when maximized:

<Style Selector="Window[WindowState=Maximized]">
        <Setter Property="Padding" Value="8" />
</Style>
4reactions
radoslawikcommented, Mar 22, 2022

It hasn’t been fixed yet, the issue can be reproduced in version 0.10.13

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is window.innerWidth smaller than screen.width even ...
When my browser window is in full screen mode, the inner width of the window still seems to be smaller than my screen...
Read more >
why is reported screen size smaller than display ...
It seems like full screen mode is "inheriting" the dimensions of that temporary window once it gets to full screen.
Read more >
Window size displayed as bigger than my screen resolution?
Yes, that is an interesting observation. You have probably maximized your Form1 before you took its size. Now, what Windows does when it ......
Read more >
Screen: width property - Web APIs - MDN Web Docs
The Screen.width read-only property returns the width of the screen in CSS pixels.
Read more >
JavaScript Window Screen
Window Screen Width ​​ The screen.width property returns the width of the visitor's screen in pixels.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found