refact: Wayland, not support multiple displays (#8280)

* refact: Wayland, not support multiple displays

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* refact: Wayland disable multiple for RemoteDesktop

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <shuanglongchen@yeah.net>
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou 2024-06-07 12:59:42 +08:00 committed by GitHub
parent 64d0fb17f7
commit 8fa611daed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 19 deletions

View File

@ -583,8 +583,7 @@ Future<List<TToggleMenu>> toolbarDisplayToggle(
child: Text(translate('Lock after session end'))));
}
if (!pi.isWayland &&
pi.isSupportMultiDisplay &&
if (pi.isSupportMultiDisplay &&
PrivacyModeState.find(id).isEmpty &&
pi.displaysCount.value > 1 &&
bind.mainGetUseTextureRender() &&

View File

@ -467,8 +467,7 @@ class _RemoteToolbarState extends State<RemoteToolbar> {
toolbarItems.add(Obx(() {
if (PrivacyModeState.find(widget.id).isEmpty &&
pi.displaysCount.value > 1 &&
!pi.isWayland) {
pi.displaysCount.value > 1) {
return _MonitorMenu(
id: widget.id,
ffi: widget.ffi,
@ -2466,19 +2465,20 @@ class _DraggableShowHideState extends State<_DraggableShowHide> {
),
),
)),
if (!isMacOS) Obx(() => Offstage(
offstage: isFullscreen.isFalse,
child: TextButton(
onPressed: () => widget.setMinimize(),
child: Tooltip(
message: translate('Minimize'),
child: Icon(
Icons.remove,
size: iconSize,
if (!isMacOS)
Obx(() => Offstage(
offstage: isFullscreen.isFalse,
child: TextButton(
onPressed: () => widget.setMinimize(),
child: Tooltip(
message: translate('Minimize'),
child: Icon(
Icons.remove,
size: iconSize,
),
),
),
),
)),
)),
TextButton(
onPressed: () => setState(() {
widget.show.value = !widget.show.value;

View File

@ -645,8 +645,8 @@ fn on_create_session_response(
"handle_token".to_string(),
Variant(Box::new("u3".to_string())),
);
// https://flatpak.github.io/xdg-desktop-portal/portal-docs.html#gdbus-method-org-freedesktop-portal-ScreenCast.SelectSources
args.insert("multiple".into(), Variant(Box::new(true)));
// https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.ScreenCast.html
// args.insert("multiple".into(), Variant(Box::new(true)));
args.insert("types".into(), Variant(Box::new(1u32))); //| 2u32)));
let path = portal.select_sources(ses.clone(), args)?;
@ -663,6 +663,9 @@ fn on_create_session_response(
failure.clone(),
)?;
} else {
// TODO: support persist_mode for remote_desktop_portal
// https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html
args.insert(
"handle_token".to_string(),
Variant(Box::new("u2".to_string())),
@ -706,8 +709,8 @@ fn on_select_devices_response(
"handle_token".to_string(),
Variant(Box::new("u3".to_string())),
);
// https://flatpak.github.io/xdg-desktop-portal/portal-docs.html#gdbus-method-org-freedesktop-portal-ScreenCast.SelectSources
args.insert("multiple".into(), Variant(Box::new(true)));
// https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.ScreenCast.html
// args.insert("multiple".into(), Variant(Box::new(true)));
args.insert("types".into(), Variant(Box::new(1u32))); //| 2u32)));
let session = session.clone();