Skip to content

Commit 1153a20

Browse files
committed
fix: get scroll bars in full screen mode #754
1 parent bd44df9 commit 1153a20

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Ui/View/Host/ProtocolHosts/AxMsRdpClient09Host.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,20 +220,24 @@ private void OnGoToFullScreenRequested()
220220

221221
var screenSize = this.GetScreenSizeIfRdpIsFullScreen();
222222

223+
double width = screenSize.Width / (_primaryScaleFactor / 100.0);
224+
double height = screenSize.Height / (_primaryScaleFactor / 100.0);
225+
int ceilingWidth = (int)Math.Ceiling(width);
226+
int ceilingHeight = (int)Math.Ceiling(height);
223227
ParentWindow.Dispatcher.Invoke(() =>
224228
{
225229
// ! do not remove
226230
ParentWindow.WindowState = WindowState.Normal;
227231
ParentWindow.WindowStyle = WindowStyle.None;
228232
ParentWindow.ResizeMode = ResizeMode.NoResize;
229233

230-
ParentWindow.Width = screenSize.Width / (_primaryScaleFactor / 100.0);
231-
ParentWindow.Height = screenSize.Height / (_primaryScaleFactor / 100.0);
234+
ParentWindow.Width = ceilingWidth;
235+
ParentWindow.Height = ceilingHeight;
232236
ParentWindow.Left = screenSize.Left / (_primaryScaleFactor / 100.0);
233237
ParentWindow.Top = screenSize.Top / (_primaryScaleFactor / 100.0);
234238
});
235239

236-
SimpleLogHelper.Debug($"RDP to FullScreen resize ParentWindow to : W = {ParentWindow.Width}, H = {ParentWindow.Height}, while screen size is {screenSize.Width} × {screenSize.Height}, ScaleFactor = {_primaryScaleFactor}");
240+
SimpleLogHelper.Debug($"RDP to FullScreen resize ParentWindow to : W = {ceilingWidth}({width}), H = {ceilingHeight}({height}), while screen size is {screenSize.Width} × {screenSize.Height}, ScaleFactor = {_primaryScaleFactor}");
237241

238242
// WARNING!: EnableFullAllScreens do not need a SetRdpResolution
239243
if (_rdpSettings.RdpFullScreenFlag == ERdpFullScreenFlag.EnableFullScreen)

0 commit comments

Comments
 (0)