Skip to content

Commit

Permalink
Get output bins by ipp on Linux and cups on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderScherbatiy committed May 20, 2024
1 parent 3922ed9 commit cf29b09
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/java.desktop/unix/classes/sun/print/IPPPrintService.java
Original file line number Diff line number Diff line change
Expand Up @@ -473,13 +473,6 @@ private void initAttributes() {
// get all supported attributes through IPP
opGetAttributes();

// check IPP values first for OutputBins
outputBins = getSupportedOutputBins();

if (JAVA_PRINT_DEBUG) {
printOutputBins("IPP", outputBins);
}

if (isCupsPrinter) {
// note, it is possible to query media in CUPS using IPP
// right now we always get it from PPD.
Expand All @@ -492,11 +485,11 @@ private void initAttributes() {
cps = new CUPSPrinter(printer);
mediaSizeNames = cps.getMediaSizeNames();
mediaTrays = cps.getMediaTrays();
if (outputBins == null) {
outputBins = cps.getOutputBins();
if (JAVA_PRINT_DEBUG) {
printOutputBins("CUPS", outputBins);
}
outputBins = PrintServiceLookupProvider.isMac()
? cps.getOutputBins()
: getSupportedOutputBins();
if (JAVA_PRINT_DEBUG) {
printOutputBins("CUPS or IPP", outputBins);
}
customMediaSizeNames = cps.getCustomMediaSizeNames();
defaultMediaIndex = cps.getDefaultMediaIndex();
Expand Down Expand Up @@ -531,6 +524,15 @@ private void initAttributes() {
mediaTrays = new MediaTray[trayList.size()];
mediaTrays = trayList.toArray(mediaTrays);
}

if (outputBins == null) {
outputBins = getSupportedOutputBins();
}

if (JAVA_PRINT_DEBUG) {
printOutputBins("IPP", outputBins);
}

urlConnection.disconnect();

init = true;
Expand Down

0 comments on commit cf29b09

Please sign in to comment.