Skip to content

The Window size (client area) is incorrect when using Windows display driver.  #86

Open
@sliang951753

Description

@sliang951753

LVGL version

v9.0.0

What happened?

When using lv_windows_create_display() to create LVGL display, the Window's client area always smaller than the specified screen resolution.
for example, lv_windows_create_display(L"LVGL Window", 1024, 600, 100, true, false);
then, the created window is at the resolution of 1024*600, however, its client area is smaller and about to 1000 * 550.

This is because the specified display resolution does not consider the window caption and client edge size.

Here's a possible fix for this issue.
In lv_windows_display_thread_entrypoint() function, calling AdjustWindowRectEx before CreateWindowExW.

` RECT rc = {0, 0, data->hor_res, data->ver_res};
AdjustWindowRectEx(&rc, window_style, FALSE, WS_EX_CLIENTEDGE);

HWND window_handle = CreateWindowExW(
                         WS_EX_CLIENTEDGE,
                         L"LVGL.Window",
                         data->title,
                         window_style,
                         CW_USEDEFAULT,
                         0,
                         rc.right - rc.left,
                         rc.bottom - rc.top,
                         NULL,
                         NULL,
                         NULL,
                         data);`

How to reproduce?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions