Skip to content

Commit

Permalink
Move initial capture to constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Apr 23, 2020
1 parent dd3e4b4 commit 8e9646f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions ScreenCast.Linux/Services/ScreenCapturerLinux.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public ScreenCapturerLinux()
{
Display = LibX11.XOpenDisplay(null);
Init();
GetNextFrame();
}

public event EventHandler<Rectangle> ScreenChanged;
Expand Down Expand Up @@ -84,8 +85,6 @@ public void Init()
SetSelectedScreen(x11Screens.Keys.First());
CurrentFrame = new Bitmap(CurrentScreenBounds.Width, CurrentScreenBounds.Height, PixelFormat.Format32bppArgb);
PreviousFrame = new Bitmap(CurrentScreenBounds.Width, CurrentScreenBounds.Height, PixelFormat.Format32bppArgb);

GetNextFrame();
}
catch (Exception ex)
{
Expand Down
3 changes: 1 addition & 2 deletions ScreenCast.Win/Services/ScreenCapturerWin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class ScreenCapturerWin : IScreenCapturer
public ScreenCapturerWin()
{
Init();
GetBitBltFrame();
SystemEvents.DisplaySettingsChanged += SystemEvents_DisplaySettingsChanged;
}

Expand Down Expand Up @@ -119,8 +120,6 @@ public void Init()
InitDirectX();

ScreenChanged?.Invoke(this, CurrentScreenBounds);

GetBitBltFrame();
}

public void SetSelectedScreen(string displayName)
Expand Down

0 comments on commit 8e9646f

Please sign in to comment.