Is there any way this can get fixed for the next release? I have several users that had this issue sporadically on 2.5.8, but now it is constant. I’m not sure exactly what causes it, but it hasn’t been looked at for a while, it seems.
I have included a patch that fixes the problem for me. It seems that the issue has to do with being iconified. If you set the frame to visible before setting the window to being iconified, it does not steal the focus. I also set it to “Frame.NORMAL” before setting visible, but I assume that would be the default anyway.
Now, I have only tested this on windows 7, but it has solved my issue.
UPDATE: I changed this patch to use setFocusable() instead of setFocusableWindowState(). For some reason, on certain machines, the latter was causing the window to not ever appear in the taskbar (although it did appear if you alt-tabbed).
UPDATE2: Well, this seems to have the flashing issue again. Removing patch.
I see what you mean. The window briefly flashes on the screen using that method. Here is a slightly modified method which seems to avoid that artifact.
Ok, I have working code that does not cause the flash, and does not steal focus.
However, it only works on JDK 1.7. But at least it works…
Edit: Never mind, this only works on my win7 machine, but not others. May have something to do with a windows focus setting that makes it work for me, but a “Normal” win7 install doesn’t work with this fix.
This (setAutoRequestFocus) is working for me now on win7 and jre7. I also compiled with jdk17. The compiled version acts very strange on jre6. The chat windows cannot be closed, except by closing individual tabs.
I hate to resurrect this old thread but it appears this is a problem in Java 8 now that the switch has been made. It looks like the previous fix was looking for Java 7 by name. We need to check for Java 8 by as well or just cut ties with Java 6 altogether and remove the if statement.
I hate to resurrect this old thread but it appears this is a problem in Java 8 now that the switch has been made. It looks like the previous fix was looking for Java 7 by name. We need to check for Java 8 by as well or just cut ties with Java 6 altogether and remove the if statement.
actually since java 6 and below have been dropped the code can be replaced completely, as documented in said code by myself
code should look like this then:
[Java] … if (SparkManager.getMainWindow().isActive() || pref.getWindowTakes - Pastebin.com
fyi, there are no active spark devs. If you guys are java devs (or know anyone that is), and would be interested in helping out, that would be great. the project is on github Ignite Realtime · GitHub . wroot helps maintain Spark.
Well, i couldn’t reproduce this yesterday with 712 build. But i have applied Wolf’s changes and now it steals the focus on a new message (when bring window to front is on), though it also steals it on the older 712 build I have tried George’s variant too. Same result. I will leave Wolf’s change in there, as it doesn’t make difference, but the code looks cleaner. But maybe it needs more investigation.
I agree, but wasn’t sure if there is still anyone using Java 6 out there for some reason. I would go with the patch as wolf suggested vs mine since we don’t need that much backward compatibility.