Preventing terminal windows in Windows#20436
Preventing terminal windows in Windows#20436gerritsangel wants to merge 2 commits intodarktable-org:masterfrom
Conversation
|
We have a work around that launches a shell, then starts darktable from there. It's been incorporated into the installer, so it works by default. I'm wondering if the added complexity and maintenance is worth the change? The one issue we struggle with is UTF and filenames. I don't know if this change alleviates any of that by using the Windows API, but if it does it might be worth the "expense". |
|
@wpferguson Is that fix incorporated into the nightly builds? I just installed darktable-5.5.0+448.g73f7976e53-win64.exe and I'm seeing no change in the popups. (Windows 11. In the issue thread @jeanrenaud mentioned some possible reasons a powershell-based fix might not work for some people, but for now I'll go back to using a .vbs script as a launcher.) |
|
Windows-specific variants of io.* functions are more appropriately contributed to upstream Lua, and only added to darktable if not accepted there. |
|
@lefth I know it was discussed, but I'm not sure if we did it? @victoryforce did we change the launcher? |
I tried to have it added there (I also think it's much better directly changed at upstream Lua, because it affects every project), but they didn't want to have the changes.
Ah okay, sorry then I didn't read properly. Will try it. I think having issues with Unicode filenames is not really optimal though. I assume many people cannot name their pictures then how they would like to. I don't see why the windows APIs would not properly support it. There are UTF-16 versions of the APIs available, and other applications support it as well. But if it at least fixes the terminal popups, might be nice. |
|
Not yet. And I agree with @ralfbrown that it would be more appropriate to make the necessary changes to upstream Lua than to implement workarounds when launch darktable. |
| static lua_CFunction init_funcs[] | ||
| = { dt_lua_init_glist, dt_lua_init_image, dt_lua_init_styles, dt_lua_init_print, | ||
| dt_lua_init_configuration, dt_lua_init_preferences, dt_lua_init_database, dt_lua_init_gui, | ||
| dt_lua_init_luastorages, dt_lua_init_tags, dt_lua_init_film, dt_lua_init_call, | ||
| dt_lua_init_view, dt_lua_init_events, dt_lua_init_init, dt_lua_init_widget, | ||
| dt_lua_init_lualib, dt_lua_init_gettext, dt_lua_init_guides, dt_lua_init_cairo, | ||
| dt_lua_init_password, dt_lua_init_util, NULL }; | ||
|
|
||
| dt_lua_init_password, NULL }; |
There was a problem hiding this comment.
you need to keep dt_lua_init_util
| dt_lua_init_luastorages, dt_lua_init_tags, dt_lua_init_film, dt_lua_init_call, | ||
| dt_lua_init_view, dt_lua_init_events, dt_lua_init_init, dt_lua_init_widget, | ||
| dt_lua_init_lualib, dt_lua_init_gettext, dt_lua_init_guides, dt_lua_init_cairo, | ||
| dt_lua_init_password, dt_lua_init_windows, NULL }; |
I agree, but they did not want to change it. I asked on the mailing list (https://groups.google.com/g/lua-l/c/i7h5srLfxIY/m/kqwoFPmWCgAJ), but was declined. |
| @@ -175,7 +175,7 @@ LUA_API int lua_absindex (lua_State *L, int idx) { | |||
|
|
|||
| LUA_API int lua_gettop (lua_State *L) { | |||
| return cast_int(L->top.p - (L->ci->func.p + 1)); | |||
| } | |||
| }° | |||
There was a problem hiding this comment.
You probably want to get rid of whatever that character is after the curly brace.
|
@gerritsangel I read the thread and I can see their point of view, and I don't disagree with it. So now it falls back on us. My thoughts
@gerritsangel could you resolve the conflicts and my comments so that I can pull and test? Thanks @TurboGit I can live with this if it survives testing, which I think it will |
| "imageio/imageio_tiff.c" | ||
| "libs/lib.c" | ||
| "views/view.c" | ||
| if(WIN32) |
There was a problem hiding this comment.
I think you have to move this out of the GLOB and into the if(USE_LUA) section.. I tried to compile on Liinux and it tried to include lua/windows.c
After the GLOB command add
if(WIN32)
list(APPEND SOURCE_FILES_LUA, "lua/windows.c")
endif(WIN32)
|
@gerritsangel did you ever get this to compile? I keep choking on dt_lua_init_windows. |
This is basically a WIP for #17193.
It is replacing many of the Lua standard implementation by calling Windows APIs directly, which will not open terminal windows. I have mostly copied the Lua source code and adjusted it where necessary, because everything was so tightly coupled that I could not just replace some functions.