It is reported that the built-in lua function os.remove(path) does
not removes empty directories on windows. To fix this a system.rmdir
function is introduced that calls a native win32 function.
Also common.rm(path, recursively) was added which wraps system.rmdir()
to easily delete an entire folder with all its contents.
Groups together consecutive mouse move events like done in core.step()
lua function but on the C side.
It does not introduce any meaningful speedup but it theory is more efficient and
simplifies the Lua code.
The simplification of the Lua code alone is enough to justify this change?
On macos 11.2.3 with sdl 2.0.14 the keyup handler for cmd+w was not
enough. Maybe the quit event started to be triggered from the keydown
handler? In any case, flushing the quit event there too helped.
Introduce a new approach that discriminate coordinates in
points and pixels. Now all the logic from the Lua side and in
rencache is to always use points. The coordinates are converted
to pixels only within the renderer, in the file renderer.c.
In this way the application logic does not need to care about the
scaling of the retina displays.
For non-retina display the scaling between points and pixels is
equal to one so nothing will change.
There is nevertheless a change that leak into the Lua side. The
subpixel coordinates are in sub-pixel, not sub-points so they are
scaled by the retina scaling factor. But no change in the code is
required because the subpixel scaling factor take into account the
retina scaling, when present.
Because the retina scaling factor is not know when the application
starts but only when a window is actually available we introduce a
mechanism to render the font with a given scaling factor only from
the renderer when they are needed. We use therefore FontDesc to
describe the font information but without actually rasterizing the
font at a given scale.
Create the user's config init file if lite user's config directory does
not exists.
No longer use the awkward package.searchers but instead add user's
config dir at the end of package path.
The problem was that when the editor had no events the cursor was not
blinking because the event loop was blocking on wait_event.
Now we no longer calls wait_event without a timeout if the windows has
the focus. When the window has the focus the timeout is set to 1 / fps
so that the cursor can blinks.
In addition we react to the "focus lost" event to ensure the documents
are redrawn without the cursor.