I start debugging by clicking on “Quick debug with GDB”. When the debugging starts, files of other projects are opened in Visual Studio. How can I prevent this?
Most likely, you have enabled the Tools->Options->VisualGDB->General->Debug->Remember Quick Debug Sources setting, so VisualGDB keeps reopening the previously open files.
If this is not intended, please consider disabling the setting.