From 1c3f766e6b362d5d19f27e2de16e4c4b2dc59dbd Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Sun, 2 Jan 2022 23:47:50 +0000 Subject: [PATCH] Fixed the resolution on fullscreen toggle to be like the workbench (#4) --- README_OS4.md | 5 ++++- src/api/system.c | 6 +++++- src/main.c | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README_OS4.md b/README_OS4.md index ae692f87..81a41781 100644 --- a/README_OS4.md +++ b/README_OS4.md @@ -44,9 +44,12 @@ https://git.walkero.gr/walkero/lite-xl/issues - Changed the Gfx memory leak solution to a fix that was applied by the editor development team on Lua scripts at a later version. Less custom code for AmigaOS 4 port. +- Now, when return from fullscreen, there is no extra header visible + at the top of the window content ### Fixed -- Fixed the assertion error and crash when the window is resized +- Fixed the assertion error and crash when the window is resized (#2) +- Fixed the resolution on fullscreen toggle to be like the workbench (#4) ## [1.16.12.4] - 2021-12-31 ### Fixed diff --git a/src/api/system.c b/src/api/system.c index 785c3ebe..1ac42b4c 100644 --- a/src/api/system.c +++ b/src/api/system.c @@ -291,7 +291,11 @@ static int f_set_window_mode(lua_State *L) { int n = luaL_checkoption(L, 1, "normal", window_opts); SDL_SetWindowFullscreen(window, n == WIN_FULLSCREEN ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); - if (n == WIN_NORMAL) { SDL_RestoreWindow(window); } + if (n == WIN_NORMAL) + { + ren_resize_window(); + SDL_RestoreWindow(window); + } if (n == WIN_MAXIMIZED) { SDL_MaximizeWindow(window); } if (n == WIN_MINIMIZED) { SDL_MinimizeWindow(window); } return 0; diff --git a/src/main.c b/src/main.c index da0a8e9c..032c83ca 100644 --- a/src/main.c +++ b/src/main.c @@ -135,6 +135,8 @@ int main(int argc, char **argv) { window = SDL_CreateWindow( "", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, dm.w * 0.8, dm.h * 0.8, SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_HIDDEN); + SDL_SetWindowDisplayMode(window, &dm); + init_window_icon(); ren_init(window);