Skip to content

Commit

Permalink
csd-media-keys-manager.c: Fix volume level 5% snap (#362)
Browse files Browse the repository at this point in the history
Co-authored-by: zbrzezinski <[email protected]>
  • Loading branch information
splitowo and splitowo authored Jun 8, 2022
1 parent 1c8d754 commit 65b4e97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/media-keys/csd-media-keys-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ do_sound_action (CsdMediaKeysManager *manager,
/* When coming out of mute only increase the volume if it was 0 */
if (!old_muted || old_vol_pa == 0) {
if (old_vol_pa % vol_step_pa > 0 && !CROSSING_PA_NORM (old_vol_pa, vol_step_pa)) {
new_vol_pa = MIN (old_vol_pa / vol_step_pa * vol_step_pa, max_vol_pa);
new_vol_pa = MIN (old_vol_pa / vol_step_pa * vol_step_pa + vol_step_pa, max_vol_pa);
} else {
new_vol_pa = MIN (old_vol_pa / vol_step_pa * vol_step_pa + vol_step_pa, max_vol_pa);
}
Expand Down

0 comments on commit 65b4e97

Please sign in to comment.