Skip to content

Commit

Permalink
Introduce allow_dpi_override to the lv_windows_window_context_t.
Browse files Browse the repository at this point in the history
  • Loading branch information
MouriNaruto committed Dec 12, 2023
1 parent b213975 commit 4689e33
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
23 changes: 13 additions & 10 deletions LvglWindowsSimulator/win32drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,7 @@ static LRESULT CALLBACK lv_windows_window_message_callback(

context->window_dpi = lv_windows_get_dpi_for_window(hWnd);
context->zoom_level = LV_WINDOWS_ZOOM_LEVEL;
context->allow_dpi_override = LV_WINDOWS_ALLOW_DPI_OVERRIDE;

context->display_timer_object = lv_timer_create(
lv_windows_display_timer_callback,
Expand Down Expand Up @@ -1325,11 +1326,12 @@ static LRESULT CALLBACK lv_windows_window_message_callback(
lv_display_set_driver_data(
context->display_device_object,
hWnd);
#if !LV_WINDOWS_ALLOW_DPI_OVERRIDE
lv_display_set_dpi(
context->display_device_object,
context->window_dpi);
#endif
if (!context->allow_dpi_override)
{
lv_display_set_dpi(
context->display_device_object,
context->window_dpi);
}

context->pointer.state = LV_INDEV_STATE_RELEASED;
context->pointer.point.x = 0;
Expand Down Expand Up @@ -1465,11 +1467,12 @@ static LRESULT CALLBACK lv_windows_window_message_callback(
{
context->window_dpi = HIWORD(wParam);

#if !LV_WINDOWS_ALLOW_DPI_OVERRIDE
lv_display_set_dpi(
context->display_device_object,
context->window_dpi);
#endif
if (!context->allow_dpi_override)
{
lv_display_set_dpi(
context->display_device_object,
context->window_dpi);
}

LPRECT suggested_rect = (LPRECT)lParam;

Expand Down
1 change: 1 addition & 0 deletions LvglWindowsSimulator/win32drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ typedef struct _lv_windows_window_context_t

int32_t window_dpi;
int32_t zoom_level;
bool allow_dpi_override;
bool display_resolution_changed;
lv_point_t requested_display_resolution;

Expand Down

0 comments on commit 4689e33

Please sign in to comment.