From 47218e9fbc4646b31bfd413dd8918551c35ba16e Mon Sep 17 00:00:00 2001 From: Silenio Quarti Date: Fri, 9 Apr 2010 16:16:59 +0000 Subject: Bug 305991 - Hang when working remote on 64 bit system --- .../motif/org/eclipse/swt/widgets/ProgressBar.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/ProgressBar.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/ProgressBar.java index 38453867d3..1679891975 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/ProgressBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/ProgressBar.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -120,17 +120,17 @@ void createHandle (int index) { }; handle = OS.XmCreateScrollBar (parentHandle, null, argList, argList.length / 2); if (handle == 0) error (SWT.ERROR_NO_HANDLES); - if ((style & SWT.INDETERMINATE) != 0) createTimer (); + if ((style & SWT.INDETERMINATE) != 0) createTimer (DELAY); } void createWidget (int index) { super.createWidget (index); foreground = defaultForeground (); } -void createTimer () { +void createTimer (int delay) { int xDisplay = display.xDisplay; int windowTimerProc = display.windowTimerProc; int xtContext = OS.XtDisplayToApplicationContext (xDisplay); - timerId = OS.XtAppAddTimeOut (xtContext, DELAY, windowTimerProc, handle); + timerId = OS.XtAppAddTimeOut (xtContext, delay, windowTimerProc, handle); } void destroyTimer () { if (timerId != 0) OS.XtRemoveTimeOut (timerId); @@ -294,7 +294,7 @@ public void setSelection (int value) { if (selection < minimum) selection = minimum; if (selection > maximum) selection = maximum; setThumb(selection - minimum); - update (); + if (isVisible ()) update (); } void setThumb (int sliderSize) { int [] argList1 = new int [] { @@ -324,11 +324,13 @@ void setThumb (int sliderSize) { display.setWarnings (warnings); } int timerProc (int id) { + long time = System.currentTimeMillis(); int minimum = getMinimum (); int range = getMaximum () - minimum + 1; int value = getSelection () - minimum + 1; setSelection (minimum + (value % range)); - createTimer (); + time = System.currentTimeMillis() - time; + createTimer (DELAY + (int)time); return 0; } int XButtonPress (int w, int client_data, int call_data, int continue_to_dispatch) { -- cgit v1.2.3