aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2024-06-23Fix window memory allocation bug.PR/window-allocationAdam Harrison
2024-06-22fix(dirmonitor): avoid calling the change callback multiple times in the ↵Guldoman
same notification (#1824)
2024-06-22move window creation and management to Lua (#1751)Jan
* remove scaling logic from font code for the time being its been hardcoded to 1 for the non SDL Renderer basewin setup, so nothing is lost for non MacOS users. will be revisited in the future when scaling is improved with SDL3 and moved into scripts. * remove unused window_renderer argument from font functions * move window logic to lua, pass window via argument * rename window creation functions `*_create`, `*_destroy`, add real init * Set active window when processing frame * get size directly from RenWindow, get active window size from renderer * correct reverted draw calls * fix window not reappearing on restart * add simple logic to persist the core window * fix style * add renwindow documentation * make windows hidden by default again * reorder ren_update_rects execution, add comment to note future work
2024-06-21Update font scale on monitor scale change for `RENDERER` backend (macOS) (#1650)Guldoman
* Update font scale on monitor scale change for `RENDERER` backend (macOS) * fix(renderer): check every font of a fontgroup for scale changes in `update_font_scale` It is needed because fonts can be reused between groups and outside of them. So if the first font of a group has already been scaled, we still need to check if the others still needs to be scaled.
2024-05-23api/system: fix newlines returned by get_clipboard (#1788)Takase
2024-05-17build: fix dirmonitor backend selection (#1790)Guldoman
When a backend was specified using meson, the relative source files weren't being added.
2024-04-15Fix BufferSize in g_read for Windows (#1722)Andrei Vinca
2024-03-18Add SerenityOS platform support (#1745)Jan
* Add SerenityOS platform support * remove cpp_std default option
2024-02-05process: fix unitialized variables (#1719)Takase
* process: fix potential unitialized variables * process: fix brace initializer error on Windows
2024-01-23Add system.setenv (#1706)Chloé Vulquin
* add system.setenv * document system.setenv * system.setenv: use wide versions of functions on windows * do not include processenv.h * system.setenv: report failure, including of utfconv * system.setenv: free utfconv output
2024-01-21process: style changes (#1709)Takase
2024-01-20Memory fixes (#1705)Chloé Vulquin
* fix: free-before-init in renwin_init_surface when using sdl renderer `ren->rensurface.surface` presupposes zero-initialized rensurface. Rensurface was not actually zero-initialized. It is now. * fix: heap buffer overflow in process_env_free `process_env_free` presupposed that it was null-terminated. Pass length to free instead. * use calloc instead of memset for zero-init Co-authored-by: Guldoman <giulio.lettieri@gmail.com> --------- Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2023-12-06turn window_renderer into managed pointer (#1683)Jan
* turn window_renderer into managed pointer this will make it easier to move it into userdata in the future * remove unused function, remove comment
2023-11-30feat(process): allow commands and envs on proces_start (#1477)Takase
* feat(process): allow commands and envs on proces_start * refactor(process): copy process arguments once whenever possible Refactors the code to use an arglist type which is just lpCmdline on Windows and a list in Linux. The function automatically escapes the command when it is needed, avoiding a second copy. This also allows UTF-8 commands btw. * fix(process): fix invalid dereference * refactor(process): mark xstrdup as potentially unused * feat(process): add parent process environment when launching process * fix(process): fix operator precedence with array operators * fix(process): fix segfault when freeing random memory * fix(process): fix wrong check for setenv() * fix(process): fix accidentally initializing an array by assignment * fix(process): clear return value if success
2023-11-29Use x offset to define render command rect in `rencache_draw_text` (#1618)Guldoman
* Return x offset for the first character in `ren_font_group_get_width` * Use x offset to define render command rect in `rencache_draw_text`
2023-11-29Scale mouse coordinates by window scale (#1630)Guldoman
* Update window scale on resize * Scale mouse coordinates by window scale * Avoid scaling mouse coordinates while using `LITE_USE_SDL_RENDERER`
2023-11-29Fix `dirmonitor` sorting issues (#1599)Guldoman
* Use `PATHSEP` in path-related functions * Don't stop on digits when getting the common part in `system.path_compare` * Avoid sorting multiple times in `dirwatch.get_directory_files` This also fixes the timeout detection in `recurse_pred`.
2023-11-29Limit `system.{sleep,wait_event}` to timeouts >= 0 (#1666)Guldoman
Otherwise we might wait forever by mistake.
2023-10-21fix(dirmonitor): deadlock if error handler jumps somewhere else (#1647)Takase
* fix: deadlock if error handler jumps somewhere else * docs(dirmonitor): fix wrong data type in error callback * docs(dirmonitor): clarify coroutines and deadlocks * docs(dirmonitor): wording Co-authored-by: Guldoman <giulio.lettieri@gmail.com> --------- Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2023-10-21Set SDL hint to prefer software render driver (#1646)Guldoman
2023-10-14fix: dim rendering when antialiasing is turned off (#1641)Takase
2023-09-30Remove DPI detection for default `SCALE`Guldoman
This often leads to `SCALE` values that are way off, and makes Lite XL unusable, so we now just default it to 1.
2023-08-03feat(src/renderer): unify fontgroup baseline (#1560)Takase
* feat(src/renderer): unify fontgroup baseline * fix(src/renderer): use the first font's baseline for the text run
2023-07-10feat(src/renderer): stream fonts with SDL_RWops on all platforms (#1555)Takase
* feat(src/renderer): stream fonts with SDL_RWops on all platforms This fixes #1529 where the font itself carries the font file, which gets copied around. This commit streams the file, so the file is not entirely in memory. * style(src/renderer): use standard C types * refactor(src/renderer): implement FT_Stream.close * fix(src/renderer): fix SDL_RWops double free
2023-07-09style(src/renderer): use FreeType header names (#1554)Takase
2023-07-03Allow setting custom glyphset size (#1542)Guldoman
* Properly set glyphset size * Rename `MAX_GLYPHSET` to `GLYPHSET_SIZE` * Use more appropriate types for font metrics
2023-06-16Attach command buffer to Renderer Window (#1472)Jan
2023-06-13Increase number of loadable glyphsets (#1524)Guldoman
This should be enough to load every unicode codepoint.
2023-05-19Close lua state when exiting on a runtime error (#1487)Jefferson González
* Close lua state when exiting on a runtime error * This change allows calling the garbage collector before exiting the application for a cleaner shutdown. * Components like the shared memory object on #1486 will have a better chance at destroying no longer needed resources. * Overriden os.exit to always close the state * Allow setting close param on os.exit override * Simplified the os.exit override a bit more Co-authored-by: Guldoman <giulio.lettieri@gmail.com> --------- Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2023-05-16fix(renderer): fix memory leak when freeing glyphsetstakase1121
2023-04-23fix(rencache): fix compiler warning for printing size_ttakase1121
2023-04-18fix(process): check for HANDLE_INVALID (#1475)Takase
2023-04-18Make `system.path_compare` more digit-aware (#1474)Jan
This allows a human friendly sorting filenames with numbers in them So - asd1 - asd10 - asd2 becomes - asd1 - asd2 - asd10
2023-04-17Process API improvements (again) (#1370)Takase
* feat(process): add push_error * refactor(process): use push_error for better errors * style(process): consistent error messages * refactor(process): reimplement process.strerror() with push_error * refactor(process): implement close_fd only once * refactor(process): rename process_handle to process_handle_t * fix(process): prevent errors from a NULL error message * refactor(process): refactor push_error into 2 functions * fix(process): fix wrong error message * fix(process): check if push_error_string actually pushed something * refactor(process): make error messages descriptive * fix(process): check for empty table instead of aborting * refactor(process): make error messages descriptive on Windows * refactor(process): rename process_stream_handle to process_stream_t * refactor(process): fix wrong usage of process_handle_t * fix(process): fix wrong type name * refactor(process): incoporate kill_list_thread into process_kill_list_t * refactor(process): make kill_list per-state data
2023-04-14Show error message in crash message box (#1461)Guldoman
* Save to `error.txt` the same traceback shown on stdout * Show error message in crash message box
2023-04-11Fix for api_require wrong macro && conditions (#1465)Jefferson González
This mistake escaped my eyes when reviewing #1437 and causes some symbols to not be exported, because the preprocessor macros are expecting multiple LUA versions to evaluate as true at once. The fix is to replace `&&` with `||`.
2023-04-07Make `system.path_compare` more case-aware (#1457)Guldoman
* Use Lua-provided string lengths for `system.path_compare` * Make `system.path_compare` more case-aware Before, strings like `README.md` would be sorted before `changelog.md`, because we only looked at the raw ascii values. Now the character case is considered as a secondary sorting key.
2023-04-07Update api_require to expose more symbols (#1437)Takase
* feat(system): update api_require for more symbols * fix(system): fix missing 5.1 symbols * fix(system): add more missing symbols * fix(system): add all symbols We got'em this time. I swear. * fix(system): fix undefined symbols due to conditional compilation There is only pain and suffering. Turns out some of the symbols are only exported when the options are enabled. We need to preprocess the header.
2023-04-07fix: fix differing stacktrace on stdout and file (#1404)Takase
* fix(c-bootstrap): produce identical stack traces
2023-04-07Fix invalid EXEFILE and EXEDIR on Windows (#1396)Takase
* fix(main): fix get_exe_filename returning invalid result on Windows * fix(main): fix bootstrap not intepreting UTF-8 properly
2023-04-07Added in support for foreground and background events. (#1395)Adam
2023-04-07Added in explicit touchscreen keyboard support. (#1389)Adam
2023-03-22Asynchronous process reaping (#1412)Takase
* refactor(process): introduce process_stream_handle separate from process_handle * feat(process): introduce process_handle helper functions * feat(process): add asynchronous process reaping * feat(process): wait for shorter period if possible * style(process): remove unecessary brackets * style(process): fix parentheses * refactor(process): remove useless setvbuf call * style(process): remove unecessary value * refactor(process): add size field into kill_list * refactor(process): use SDL_Delay for sleeping * style(process): remove trailing whitespace * fix(main): destroy window before closing lua * fix(process): check for timeout correctly * refactor(process): remove unecessary if check * refactor(process): remove size from the list * fix(process): fix invalid delay calculation Co-authored-by: Guldoman <giulio.lettieri@gmail.com> --------- Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2023-03-19Aggregate `SDL_Surface`s and their scale in `RenSurface` (#1429)Guldoman
2023-03-14Use clipping functions provided by SDL (#1426)Guldoman
2023-03-09Improve text width calculation precision (#1408)Guldoman
In some extreme cases (~30000 chars) text width precision takes a hit. Using double instead of float fixes that.
2023-03-09refactor(main): move SetProcessDPIAware to manifests (#1413)Takase
2023-03-04Split `Command` struct into different structs for each command type (#1407)Guldoman
This reduces the space needed for each command.
2023-03-03Add manifest on Windows (#1405)Takase
* fix(gitignore): add exclusion for manifest files * feat(windows): add application manifest * feat(build): use application manifest on windows * refactor(build): use genrate_file to generate the manifest * style(manifest): remove trailing whitespace
2023-02-15Added in ability to specify prefix via env variable. (#1388)Adam