mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-24 20:59:37 +08:00
Merge pull request #5887 from sahilyeole/fix/wayland_screen_share_prompt
Fix wayland screen prompt on display menu
This commit is contained in:
commit
94830cffca
@ -1053,10 +1053,12 @@ class _ResolutionsMenuState extends State<_ResolutionsMenu> {
|
|||||||
FfiModel get ffiModel => widget.ffi.ffiModel;
|
FfiModel get ffiModel => widget.ffi.ffiModel;
|
||||||
Display get display => ffiModel.display;
|
Display get display => ffiModel.display;
|
||||||
List<Resolution> get resolutions => pi.resolutions;
|
List<Resolution> get resolutions => pi.resolutions;
|
||||||
|
bool get isWayland => bind.mainCurrentIsWayland();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
_getLocalResolutionWayland();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -1065,7 +1067,6 @@ class _ResolutionsMenuState extends State<_ResolutionsMenu> {
|
|||||||
final visible =
|
final visible =
|
||||||
ffiModel.keyboard && (isVirtualDisplay || resolutions.length > 1);
|
ffiModel.keyboard && (isVirtualDisplay || resolutions.length > 1);
|
||||||
if (!visible) return Offstage();
|
if (!visible) return Offstage();
|
||||||
_getLocalResolution();
|
|
||||||
final showOriginalBtn =
|
final showOriginalBtn =
|
||||||
display.isOriginalResolutionSet && !display.isOriginalResolution;
|
display.isOriginalResolutionSet && !display.isOriginalResolution;
|
||||||
final showFitLocalBtn = !_isRemoteResolutionFitLocal();
|
final showFitLocalBtn = !_isRemoteResolutionFitLocal();
|
||||||
@ -1101,6 +1102,20 @@ class _ResolutionsMenuState extends State<_ResolutionsMenu> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _getLocalResolutionWayland() async {
|
||||||
|
if (!isWayland) return _getLocalResolution();
|
||||||
|
final window = await window_size.getWindowInfo();
|
||||||
|
final screen = window.screen;
|
||||||
|
if (screen != null) {
|
||||||
|
setState(() {
|
||||||
|
_localResolution = Resolution(
|
||||||
|
screen.frame.width.toInt(),
|
||||||
|
screen.frame.height.toInt(),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_getLocalResolution() {
|
_getLocalResolution() {
|
||||||
_localResolution = null;
|
_localResolution = null;
|
||||||
final String currentDisplay = bind.mainGetCurrentDisplay();
|
final String currentDisplay = bind.mainGetCurrentDisplay();
|
||||||
|
Loading…
Reference in New Issue
Block a user