Let t0 be the moment when other user opened the file. GanttProject remembers the last file sync timestamp and for other user sync timestamp is t0
If I make a little change and save immediately when file is opened by other user there is no alert.
Let this moment be t1. File write timestamp is changed to t1 and your sync timestamp is t1
Then i work in the file (and other user too) so I want to save. Other user have already save his modification
Unless there is a bug, other user can't save his changes without warning. He has t0 as file sync timestamp and sees t1>t0 as file modification timestamp. But he may also choose to overwrite the file. Let t2 be this moment. If other user overwrites the changes, file modification timestamp becomes t2
Now you have the sync timestamp t1 and see modification timestamp t2>t1. And you see the warning which is expected. You may choose to overwrite and you may choose to save a copy.
This is the essential minimum which can be provided on application level without additional middleware in heterogeneous environment (different operating systems and file systems). If you really need locking or version control, you need to use additional software, like WebDAV server or version control system.
GanttProject can work with WebDAV servers. If your WebDAV server supports locking then you will see the lock if any and even will see the user name who keeps the lock. If you're working in the local network, you can probably install Apache or IIS with WebDAV and locks.