-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: Skip cmd for release builds #5416
Conversation
👎 The console window is helpful to develop mods and finding bugs. Compared to the debug.txt file all new lines can be viewed in the console instantly. |
Yes I understand that it might usefull, but here I have some points against it:
EDIT: |
Console is irritating and clutters my taskbar, If I really need it I will enable it in config. Players just want to play, console adds debug/notfinished feel to minetest and I need to damn select the right minetest window every time. |
@SmallJoker cmd for debug build okay, but seems lgtm for release builds, it's not very proper and "profesionnal" |
a16b666
to
46e143b
Compare
I added the cmake option |
46e143b
to
e85637b
Compare
👍 default disable, maybe this could actually be an option in minetest.conf, but, it seems @SmallJoker's concern for debug builds is entire covered this way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice !
@sofar This is a compiler parameter, thus it could be quite hacky to add a minetest.conf setting for the console window.
@adrido Yes, that's true. My comment should only represent my own opinion - not meant as a downvote from a coredev. Blocking this PR if there are people who would like to have this window away would be nonsense. However, thanks for adding the CMake param in :) |
@SmallJoker i think covering the whole usage are good, but for a end user point, console it crap, just permit to enable it for developers is good |
Phew 😅 I thought this would end up in one of that "controversial" PR that does not have any future. This PR changes the subsystem to Windows, this have to be done on link time. Its not possible to change the subsystem on run time. There exist (hacky) ways within the Windows API to allocate a new cmd window at runtime, but I does not know if this would have the wanted effect. |
@adrido i made an issue about this a while ago I'm happy that someone took the time to fix this |
agree that it's useful however it's missing the code that does the same for MinGW |
If this document is a trusted source, the command line arguments might be |
From http:https://www.mingw.org/wiki/FAQ:
Also from https://gcc.gnu.org/onlinedocs/gcc/x86-Windows-Options.html:
|
Maybe the MinGW stuff should be added by someone who have more experience with MinGW than me. I does not like to blindly write code, that I cannot test. |
I can test it right now, I already pasted info above. It does not look like complicated stuff, also main builds are made with mingw. |
I have used |
I've tried it with -mwindows on MINGW64 cross-compilation on debian and had a success - no cmd window, starts up and runs fine, icon is visible in taskbar (but not in alt+tab taskbar switcher, but I'm ok with that). Debug.txt is working.
By default minetest is compiled without cmd window, if needed -DENABLE_CMD_WINDOW=1 enables it, I checked. Cmake setup used:
|
Thanks for testing, but if it does not show up inside the ALT-TAB task switcher, something seems wrong to me. Or could that be because of your Windows version? It looks a bit older. |
Icon in alt-tab mode is visible in console window, if you disable console, the behaviour for main window is the same as before. That can be improved later. I'm interested in getting this PR in for both msvc and mingw. |
Ahh Sorry, did not understand you correctly. I understand that the whole Minetest application is not displayed in Task switcher 😆 . The Icon that is displayed in the Taskbar is the "Application Icon" that icon that's displayed in the "Classic" Task switcher is the "Window Icon". Since Windows 7 (Vista maybe too) the Window is displayed as a thumbnail. As long as Minetest does not have a proper Window Icon set there is nothing to display. If I remember correctly, the Window icon is hard coded by the Irrlicht engine to " Could you please check, if it also work if you do:
|
Indeed! I did this and now I see proper icon for minetest everywhere (Windows 7 sp1)
Yes it does work. |
Is it possible to create a batch file to start with the console? |
No, thats not possible. This is changing the subsystem where the application is running on. This have to be made at compile/ link time, and cannot be done on run time. |
Tested. Thanks 👍 |
Removing console would be a pain for mod makers when it comes to errors, having to refer to debug.txt all the time instead of simply looking at the cmd window... Also, if cmd was removed and minetest was made a windows program only a console would have to be added for just such checking so we would need someone to add that beforehand, which in itself comes with separate problems like when Mt crashes and closes the console window with it. |
Downside of this is you don't see command line commands or any output when you start it from CMD. Relevant: |
I found a simple way to dynamically allocate a console window within pidgin source code. [sarcasm] And it also leads all that useless crap to that console too (like it did before). hope that spam makes people happy again 😛 [/sarcasm] @Fixer-007 you answered while i was compiling and taking that screenshot. Its similar to the last answer of your link. 😆 That solution does require some more programming to do it right, so I may need some more days. |
What happens if Minetest is started from a console? Does it create a new console or use the existing one? |
For that option, I'd suggest simply "--console". |
I use console a lot from Windows version of MT. If it can be an option to enable, and then I run the game as usual and the console is there, it's great, otherwise this will be a huge annoyance. (And if it's not there by default, having to enable an option each time I test a client (and, I assume, then restart the game?) would also be a (slightly) lesser annoyance by itself. |
My idea is to check if |
It looks like we need to also add the option to pop up the console window like it currently does, and also make that behavior configurable in minetest.conf. We can't just decide people shouldn't like the current behavior. |
--console is enough if you also add a batch file |
4000365
to
36f22f3
Compare
should work now except for reading the setting. I does not find the point when the settings-file got parsed, and g_settings is available. |
36f22f3
to
0f12caa
Compare
Status? |
i don't like windows but it's inacceptable for end users to have an opened cmd, minetest is not a Dos game on Windows 95 |
Looking at this patch it adds all the options needed for the console to be easily reachable:
So, 👍 (But I can't test). |
Got very nice results for now on mingw64 cross-compile from lin to win (updating):
Finally that CMD window is gone, Console can be enabled easily via many ways, everyone is satisfied. |
This skips the cmd window on startup for release builds. Startup time is much faster then.
The
/INCREMENTAL:NO
just solves a linker warning (Linking with/LTCG
does not allow/INCREMENTAL
)