From 9be613beb9e82892d6b438f1bd3949e069f7ea3b Mon Sep 17 00:00:00 2001 From: Nidhoegger Date: Mon, 6 Jul 2015 10:51:06 +0200 Subject: [PATCH] Fixed Issue #1054. Buttons in Feedback panel will only get focused, if the MageFrame has the focus thus preventing focus theft from other programs. --- .../src/main/java/mage/client/game/FeedbackPanel.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java b/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java index 778c6ae58c..0190ec139b 100644 --- a/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java @@ -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; }