summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
diff options
context:
space:
mode:
authorSteve Northover <steve>2007-04-11 17:05:22 +0000
committerSteve Northover <steve>2007-04-11 17:05:22 +0000
commitfb04bf3a94310b0d180dd338ff5b7ce96c52635e (patch)
tree2cf63aa17140ea70299b1fe8d46edf35727366b5 /bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
parenta0a8fa048ac41c262e70c8ba9ae24f8009e618db (diff)
downloadeclipse.platform.swt-fb04bf3a94310b0d180dd338ff5b7ce96c52635e.tar.gz
eclipse.platform.swt-fb04bf3a94310b0d180dd338ff5b7ce96c52635e.tar.xz
eclipse.platform.swt-fb04bf3a94310b0d180dd338ff5b7ce96c52635e.zip
153936 - Eclipse freezes when opening an editor
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
index f17cd1c7f8..9482850483 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
@@ -58,6 +58,7 @@ public final class Printer extends Device {
byte [] settingsData;
int start, end;
+ static final String GTK_LPR_BACKEND = "GtkPrintBackendLpr"; //$NON-NLS-1$
/**
* Returns an array of <code>PrinterData</code> objects
@@ -84,6 +85,15 @@ static int /*long*/ GtkPrinterFunc_List (int /*long*/ printer, int /*long*/ user
System.arraycopy (printerList, 0, newList, 0, length);
printerList = newList;
printerList [length] = printerDataFromGtkPrinter(printer);
+ /*
+ * Bug in GTK. While performing a gtk_enumerate_printers(), GTK finds all of the
+ * available printers from each backend and can hang. If a backend requires more
+ * time to gather printer info, GTK will start an event loop waiting for a done
+ * signal before continuing. For the Lpr backend, GTK does not send a done signal
+ * which means the event loop never ends. The fix is to check to see if the driver
+ * is of type Lpr, and stop the enumeration, which exits the event loop.
+ */
+ if (printerList[length].driver.equals (GTK_LPR_BACKEND)) return 1;
return 0;
}