]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Fixed TrendView.setFocus to not deadlock 53/1453/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 13 Feb 2018 14:59:55 +0000 (16:59 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 13 Feb 2018 14:59:55 +0000 (16:59 +0200)
Calling JPanel.requestFocus from SWT thread is a surefire way to lock
the UI up.

refs #7763

Change-Id: I5f68bba426fe47ca9c1b529986628ecd3c9ec1fb

bundles/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/TrendView.java

index ef13a4264384c305aee51ae2020b8b11f2074af8..32e2b695324ace3b807ba9a67a26977e3e1ba388 100644 (file)
@@ -289,8 +289,8 @@ public class TrendView extends ViewPart {
 \r
     @Override\r
     public void setFocus() {\r
-        if(panel != null)\r
-            panel.requestFocus();\r
+        if(composite != null)\r
+            composite.setFocus();\r
     }\r
 \r
 \r