A package's status is only changed by clicking on the "New" column, with one exception: If the status is "Keep", it is changed to "Uninstall" after a click (even accidental) on any other column.
"Keep" means desired == installed, picked = false. Only run the code which is supposed to detect both "src?" and "bin?" unchecked when clicking on those columns. Addresses: https://cygwin.com/ml/cygwin/2017-05/msg00525.html --- PickPackageLine.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/PickPackageLine.cc b/PickPackageLine.cc index 60ece7f..a158966 100644 --- a/PickPackageLine.cc +++ b/PickPackageLine.cc @@ -142,12 +142,20 @@ PickPackageLine::click (int const myrow, int const ClickedRow, int const x) pkg.desired.sourcePackage ().pick ( !pkg.desired.sourcePackage ().picked (), NULL); } + /* Unchecking binary while source is unchecked or vice versa is equivalent to uninstalling. It's essential to set desired correctly, otherwise the package gets uninstalled without visual feedback to the user. The package will not even show up in the "Pending" view! */ - if (!pkg.desired.picked () && !pkg.desired.sourcePackage ().picked ()) - pkg.desired = packageversion (); + if ((x >= theView.headers[theView.bintick_col].x - HMARGIN / 2 + && x <= theView.headers[theView.bintick_col + 1].x - HMARGIN / 2) || + (x >= theView.headers[theView.srctick_col].x - HMARGIN / 2 + && x <= theView.headers[theView.srctick_col + 1].x - HMARGIN / 2)) + { + if (!pkg.desired.picked () && !pkg.desired.sourcePackage ().picked ()) + pkg.desired = packageversion (); + } + return 0; } -- 2.12.3
