Skip to content

Commit

Permalink
Don't start monitoring until Form Load is called. This could likely f…
Browse files Browse the repository at this point in the history
…ix crashes related to invoking prior to window handle being created. Can't duplicate to test however. Also further emphasize messages while idle.
  • Loading branch information
Ognjen Ivkovic committed Jun 10, 2017
1 parent 4f1f4b3 commit ed705a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions PoEWhisperNotifier/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public Main() {
else
LogMessage("Unable to figure out client.txt location. You will have to manually set the path.", null, LogMessageType.Status);
}
StartMonitoring(true);
this.ResizeEnd += OnResizeEnd;
}

Expand Down Expand Up @@ -244,7 +243,7 @@ private void LogMessage(string Prefix, string Message, LogMessageType MessageTyp
Color StandardColor = Color.FromArgb(239, 239, 239);
Font MessageFont = null;
if ((IdleManager.IsUserIdle || !IsPoeActive()) && new[] { LogMessageType.Whisper, LogMessageType.Party, LogMessageType.Disconnect }.Contains(MessageType))
MessageFont = new Font(rtbHistory.Font, FontStyle.Bold);
MessageFont = new Font(rtbHistory.Font.FontFamily, rtbHistory.Font.Size + 2, FontStyle.Bold);

if (!String.IsNullOrWhiteSpace(Prefix))
LogMessagePart(Prefix, Config.ForegroundColor, MessageFont);
Expand Down Expand Up @@ -309,6 +308,8 @@ private void Main_Load(object sender, EventArgs e) {
} else {
this.WindowState = FormWindowState.Normal;
}

StartMonitoring(true);
}

private void notifyOnlyWhenMinimizedToolStripMenuItem_Click(object sender, EventArgs e) {
Expand Down

0 comments on commit ed705a6

Please sign in to comment.