From 7e0de10ca9ca698d30cdfe84d97d45fb1f11bba0 Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Fri, 3 Apr 2020 17:50:26 -0700 Subject: [PATCH] Change X11 init. --- ScreenCast.Linux/Services/ScreenCapturerLinux.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ScreenCast.Linux/Services/ScreenCapturerLinux.cs b/ScreenCast.Linux/Services/ScreenCapturerLinux.cs index 9a989da3..db848545 100644 --- a/ScreenCast.Linux/Services/ScreenCapturerLinux.cs +++ b/ScreenCast.Linux/Services/ScreenCapturerLinux.cs @@ -83,8 +83,8 @@ namespace Remotely.ScreenCast.Linux.Services { x11Screens.Add(i.ToString(), i); } - var defaultScreen = LibX11.XDefaultScreen(Display); - SetSelectedScreen(defaultScreen.ToString()); + + SetSelectedScreen(x11Screens.Keys.First()); CurrentFrame = new Bitmap(CurrentScreenBounds.Width, CurrentScreenBounds.Height, PixelFormat.Format32bppArgb); PreviousFrame = new Bitmap(CurrentScreenBounds.Width, CurrentScreenBounds.Height, PixelFormat.Format32bppArgb); } @@ -113,7 +113,6 @@ namespace Remotely.ScreenCast.Linux.Services var height = LibX11.XDisplayHeight(Display, x11Screens[SelectedScreen]); CurrentScreenBounds = new Rectangle(0, 0, width, height); CaptureFullscreen = true; - Init(); ScreenChanged?.Invoke(this, CurrentScreenBounds); }