Fixed the resolution on fullscreen toggle to be like the workbench (#4)

This commit is contained in:
George Sokianos 2022-01-02 23:47:50 +00:00
parent de6c0fd575
commit 1c3f766e6b
3 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -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;

View File

@ -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);