This is a merge request to solve a problem that became visible by this merge request from Ivan Lyugaev:
https://gitlab.winehq.org/wine/wine/-/merge_requests/9184#note_121010
When used with a HP Officejet Pro 8600 N911a, it is no longer possible to choose a scan resolution other than 75 DPI.
The reason is that the code always set the "source" option after the "resolution" option, and setting the "source" option resets the resolution on that scanner to 75 DPI, even if it is not changed. Sane services are implemented in hplip. On Debian:
``` apt source hplip sed -n '560,563p' hplip-3.22.10+dfsg0/scan/sane/ledm.c i = session->adf_resolutionList[0] + 1; while(i--) session->resolutionList[i] = session->adf_resolutionList[i]; } ps->currentResolution = session->resolutionList[1]; ```
This new commit changes two things:
1. The order in which parameters are set in sane is changed. A parameter called "source" is set earlier than all other parameters. 2. If a parameter derived from a combobox of named options is not changed, it is not set in sane to the same value again.
This seems to solve the problem on the HP Officejet Pro 8600 N911a, but other sane backends might have more dependencies that might still need to be addressed.
-- v5: dlls/sane.ds: Fix setting resolution in user interface