summaryrefslogtreecommitdiff
path: root/pdf-over-gui
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2014-01-31 13:39:53 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2014-01-31 13:39:53 +0000
commit7db63a9590e376ff8ed6460343dee379cefd7173 (patch)
treeb83ed4e443bad58323f51edf3fb83cf4580b4adb /pdf-over-gui
parent3019f4ec73395a7eb3e4f409afe2602ad126b568 (diff)
downloadpdf-over-7db63a9590e376ff8ed6460343dee379cefd7173.tar.gz
pdf-over-7db63a9590e376ff8ed6460343dee379cefd7173.tar.bz2
pdf-over-7db63a9590e376ff8ed6460343dee379cefd7173.zip
Work around requestFocus deadlock
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@499 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
index d9d7769c..a3a22070 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
@@ -60,9 +60,9 @@ public class PositioningComposite extends StateComposite {
private SignaturePanel viewer = null;
- private Frame frame = null;
+ Frame frame = null;
- private Composite mainArea = null;
+ Composite mainArea = null;
Composite bottomBar = null;
@@ -179,10 +179,15 @@ public class PositioningComposite extends StateComposite {
* Request focus (to enable keyboard input)
*/
public void requestFocus() {
- this.mainArea.setFocus();
- if(!this.frame.hasFocus()) {
- this.frame.requestFocusInWindow();
- }
+ this.getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ PositioningComposite.this.mainArea.setFocus();
+ if(!PositioningComposite.this.frame.hasFocus()) {
+ PositioningComposite.this.frame.requestFocus();
+ }
+ }
+ });
}
/**