VNC-155 Add scrolling configuration keys

encoding.scrolling.detect_vertical_scrolling
encoding.scrolling.detect_horizontal_scrolling
encoding.scrolling.scroll_detect_threshold
This commit is contained in:
Dmitry Maksyoma 2025-05-14 21:44:08 +12:00
parent 0924817a76
commit 14ef7178b2
No known key found for this signature in database
2 changed files with 54 additions and 0 deletions

View file

@ -134,6 +134,10 @@ encoding:
compare_framebuffer: auto
zrle_zlib_level: auto
hextile_improved_compression: true
scrolling:
detect_vertical_scrolling: false
detect_horizontal_scrolling: false
scroll_detect_threshold: 25%
server:
http:

View file

@ -2464,6 +2464,56 @@ sub DefineConfigToCLIConversion {
})
]
}),
KasmVNC::CliOption->new({
name => 'DetectScrolling',
configKeys => [
KasmVNC::ConfigKey->new({
name => "encoding.scrolling.detect_vertical_scrolling",
type => KasmVNC::ConfigKey::BOOLEAN
})
],
isActiveSub => sub {
$self = shift;
my $value = $self->configValue();
isPresent($value) && $value eq 'true';
}
}),
KasmVNC::CliOption->new({
name => 'DetectHorizontal',
configKeys => [
KasmVNC::ConfigKey->new({
name => "encoding.scrolling.detect_horizontal_scrolling",
type => KasmVNC::ConfigKey::BOOLEAN,
validator => KasmVNC::CallbackValidator->new({
isValidCallback => sub {
my $value = shift;
return 1 if $value eq "false";
ConfigValue("encoding.scrolling.detect_vertical_scrolling") eq "true";
},
errorMessage => "Detection of horizontal scrolling requires detection of vertical scrolling enabled"
}),
})
],
isActiveSub => sub {
$self = shift;
my $value = $self->configValue();
isPresent($value) && $value eq 'true';
}
}),
KasmVNC::CliOption->new({
name => 'ScrollDetectLimit',
configKeys => [
KasmVNC::ConfigKey->new({
name => "encoding.scrolling.scroll_detect_threshold",
validator => $percentValidator
})
],
deriveValueSub => $deriveValueStripPercentSub
}),
);
%cliArgMap = map { ("-" . $_->{name}) => $_ } @xvncOptions;