Stop Eclipse From Stealing Focus when debug starts
Asked Answered
M

2

17

I will start by saying that this kind of thing never happens in Linux. Maybe that was due to my particular window manager, but out of convenience, I am back to OS X.

When Eclipse PDT debugging begins, it grabs focus. Often this is slightly convenient, not especially so, but it is often very inconvenient. I am using JIT, which for some reason triggers on PHP fatal errors, but quits immediately. The effect is that focus steals to Eclipse, and repeatedly so given that JavaScript retries the failed call on a timer.

I can't describe the feeling of trying to fix a bug while the focus steals back every 1 second or so.

So how can I either stop eclipse JIT from triggering on a fatal error or stop OS X Eclipse from stealing focus.

I did the steps listed here (http://www.martijndashorst.com/blog/2014/07/02/prevent-eclipse-stealing-focus/), but it did not work.

Marilumarilyn answered 8/7, 2015 at 19:24 Comment(1)
The link doesn't work anymore.Amity
B
3

When debugging, there is also a case where the eclipse window steals focus when hitting a breakpoint. Because usually an initial breakpoint is set at main() function, it steals focus right after starting debugging and because view refreshes slower it looks as-if the debugging itself is stealing the focus.

Go to Window -> Preferences -> Run/Debug and uncheck option "Activate the workbench when a breakpoint is hit".

enter image description here]1

Buonaparte answered 8/9, 2020 at 13:52 Comment(1)
I have STM32CubeIDE and this works, thanks a lot. It must be noted that even if you don't have any breakpoints set (not even the one that is in main() in the default debug configuration), STM32CubeIDE decides to show you the line that was being executed by the microcontrnoller when you launch a new debug session, which seems to be what causes this focus stealing. I'd still love to be able to avoid being shown the line where the program was because that means that a new file is being opened virtually every time I start the program which is annoying. I guess that warrants another question.Underpart
W
1

Go to Window -> Preferences -> Run/Debug -> Console. Uncheck options:

  1. Show when program writes to standard out
  2. Show when program writes to standard error

enter image description here

Waisted answered 1/6, 2017 at 12:16 Comment(1)
It appears this doesn't keep Eclipse from stealing focus-- just stops Eclipse from showing its console (within Eclipse)Philanthropist

© 2022 - 2024 — McMap. All rights reserved.