hoffstadt / hoffstadt/DearPyGui

Viewport metrics are not being respected on Windows 11

Open
#2,078 0 comments 1 reaction 0 assignees View on GitHub
state: pending type: bug
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

## Version of Dear PyGui

Version: 1.9.0
Operating System: Windows 11

## My Issue/Question

Passing `width` and `height` to viewport creation is not being respected.

## To Reproduce

```python
import dearpygui.dearpygui as dpg

def save_callback():
print("Save Clicked")

dpg.create_context()
dpg.create_viewport(title="Hello", width=640, height=480)
dpg.setup_dearpygui()

with dpg.window(label="Example Window", pos=[5, 5], width=630, height=470):
pass

dpg.show_viewport()
while dpg.is_dearpygui_running():
config = dpg.get_viewport_configuration("Hello")
print(config["client_width"], config["client_height"])
dpg.render_dearpygui_frame()
dpg.destroy_context()
```

## Expected behavior

A viewport with a visible size of 640x480.

## Screenshots/Video

Note that the window bounds escape the visible screen.

![python_OpxU0aOwQu](https://user-images.githubusercontent.com/23563/230822720-58eeb1c4-8749-4b58-a977-2b208aa03cca.png)

I run at 175% scaling, but I have reproduced the issue at 100% scaling as well.

Output from the console, a print of the client width and height - the width and height look correct before the widgets are visible, but then the client width and height readjust.

```
640 480
640 480
640 480
640 480
640 480
640 480
640 480
624 441
624 441
624 441
624 441
624 441
624 441
```

## Standalone, minimal, complete and verifiable example

See above.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.