Debugger GUI looses Focus and becomes Inactive when Application opens Render Window

I would like to know if there's a way to detect whether I'm in debugging mode or building for regular run. I'm not talking about the cmake Build Type, rather I would like to basically detect the difference between clicking the run button (meta+r) and clicking the bug icon right next to it (meta+d) from within c++ so I can run different code based on that
This is due to a "bug" (more of a quirk really) with the debugger where when I build my application and it opens a render window the clion debugger window looses focus and I can't interact with anything such as accessing frames, hovering over variables in code, etc. This means before the debugger GUI is accessible again I have to a) switch to my application window, b) tell my OS that it not responding is okay, c) minimize the render window d) switch back to clion. This is really annoying because I have to do it every time I compile and start the debugger. As a workaround I have a line above my main that starts the window in minimized mode from the get-go to skip that process but even then each time I switch between debugging and regular run I have to add or remove the line. I'm asking if there's a flag somewhere so I can automate the process fully, something like

if (CLION_DEBUGGER_ACTIVE) minimize_window();

Alternatively if there's an option to prevent the debugger window loosing focus or if I can somehow tell the debugger to set a certain flag I'd appreciate that just the same. I'm on Ubuntu 18.04.2 and I'm using the bundled GDB version 8.3. I couldn't get LLDB to work without troubleshooting it.

Thank you

PS: I am aware of the macro NDEBUG / _NEDBUG but this gives access to the cmake build type, not the mode of clion itself. For example I can set the cmake build type to RELEASE but still start the application with the clion debugger yet NDEBUG will still show release.

0

Please sign in to leave a comment.