Skip to content

Commit

Permalink
Add patch needed for native_posix display zoom from upstream Zephyr. …
Browse files Browse the repository at this point in the history
…Set zoom to 200%.
  • Loading branch information
jakkra committed Apr 15, 2024
1 parent 4f1708a commit 3ca44a7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/boards/native_posix.conf
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,5 @@ CONFIG_DEBUG_OPTIMIZATIONS=y
CONFIG_SPI_FLASH_LOADER=n

CONFIG_BT_EXT_ADV=n

CONFIG_SDL_DISPLAY_ZOOM_PCT=200
27 changes: 27 additions & 0 deletions app/patches/sdl_display_zoom_touch_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From ccd843ecbd6b670cfa296150bee4999580e8350b Mon Sep 17 00:00:00 2001
From: Jakob Krantz <[email protected]>
Date: Fri, 22 Dec 2023 15:13:01 +0100
Subject: [PATCH] driver: display: sdl: Fix input together with
SDL_DISPLAY_ZOOM_PCT

Using SDL_DISPLAY_ZOOM_PCT would cause mouse pointer/touch input
to not click at the correct position.

Signed-off-by: Jakob Krantz <[email protected]>
---
drivers/display/display_sdl_bottom.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/display/display_sdl_bottom.c b/drivers/display/display_sdl_bottom.c
index 92c09f36fcd9b6..bfeb70a8dba93f 100644
--- a/drivers/display/display_sdl_bottom.c
+++ b/drivers/display/display_sdl_bottom.c
@@ -29,6 +29,8 @@ int sdl_display_init_bottom(uint16_t height, uint16_t width, uint16_t zoom_pct,
return -1;
}

+ SDL_RenderSetLogicalSize(*renderer, width, height);
+
*texture = SDL_CreateTexture(*renderer, SDL_PIXELFORMAT_ARGB8888,
SDL_TEXTUREACCESS_STATIC, width, height);
if (*texture == NULL) {

0 comments on commit 3ca44a7

Please sign in to comment.