Fixed Issue #1054. Buttons in Feedback panel will only get focused, if the MageFrame has the focus thus preventing focus theft from other programs.

This commit is contained in:
Nidhoegger 2015-07-06 10:51:06 +02:00
parent 0b26aaff6e
commit 9be613beb9

View file

@ -201,9 +201,12 @@ public class FeedbackPanel extends javax.swing.JPanel {
}
// Issue 256: Chat+Feedback panel: request focus prevents players from chatting
private void requestFocusIfPossible() {
// Issue #1054: XMage steals window focus whenever the screen updates
private void requestFocusIfPossible() {
boolean requestFocusAllowed = true;
if (connectedChatPanel != null && connectedChatPanel.getTxtMessageInputComponent() != null) {
if (MageFrame.getInstance().getFocusOwner() == null) {
requestFocusAllowed = false;
} else if (connectedChatPanel != null && connectedChatPanel.getTxtMessageInputComponent() != null) {
if (connectedChatPanel.getTxtMessageInputComponent().hasFocus()) {
requestFocusAllowed = false;
}