Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/StopWatch/Helpers/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class NativeMethods
{
public const int HWND_BROADCAST = 0xffff;

public static readonly int WM_SHOWME = RegisterWindowMessage("WM_SHOWME");
public static readonly int WM_SHOWME = Environment.OSVersion.Platform != PlatformID.Unix ? RegisterWindowMessage("WM_SHOWME") : 0;

[DllImport("user32")]
public static extern bool PostMessage(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam);
Expand Down
2 changes: 1 addition & 1 deletion source/StopWatch/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static void Main()

mutex.ReleaseMutex();
}
else {
else if (Environment.OSVersion.Platform != PlatformID.Unix) {
// Send Win32 message to make the currently running instance jump on top of all the other windows
NativeMethods.PostMessage(
(IntPtr)NativeMethods.HWND_BROADCAST,
Expand Down
134 changes: 41 additions & 93 deletions source/StopWatch/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions source/StopWatch/Settings/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void ReadSettings()
this.MinimizeToTray = Properties.Settings.Default.MinimizeToTray;
this.IssueCount = Properties.Settings.Default.IssueCount;
this.Username = Properties.Settings.Default.Username;
if (Properties.Settings.Default.Password != "")
if (Properties.Settings.Default.Password != "" && Environment.OSVersion.Platform != PlatformID.Unix)
this.Password = DPAPI.Decrypt(Properties.Settings.Default.Password);
else
this.Password = "";
Expand Down Expand Up @@ -154,7 +154,7 @@ public void Save()
Properties.Settings.Default.IncludeProjectName = this.IncludeProjectName;

Properties.Settings.Default.Username = this.Username;
if (this.Password != "")
if (this.Password != "" && Environment.OSVersion.Platform != PlatformID.Unix)
Properties.Settings.Default.Password = DPAPI.Encrypt(this.Password);
else
Properties.Settings.Default.Password = "";
Expand Down
7 changes: 5 additions & 2 deletions source/StopWatch/UI/ComboTextBoxEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ public ComboTextBoxEvents(ComboBox comboBox)
if (comboBox == null) throw new ArgumentNullException("comboBox");

_comboBox = comboBox;
IntPtr lhWnd = FindWindowEx(_comboBox.Handle, IntPtr.Zero, "EDIT", null);
AssignHandle(lhWnd);
if (Environment.OSVersion.Platform != PlatformID.Unix)
{
IntPtr lhWnd = FindWindowEx(_comboBox.Handle, IntPtr.Zero, "EDIT", null);
AssignHandle(lhWnd);
}
}

protected override void WndProc(ref Message m)
Expand Down
2 changes: 1 addition & 1 deletion source/StopWatch/UI/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ private void LoadFilters()

protected override void WndProc(ref Message m)
{
if (m.Msg == NativeMethods.WM_SHOWME)
if (m.Msg == NativeMethods.WM_SHOWME && Environment.OSVersion.Platform != PlatformID.Unix)
ShowOnTop();

base.WndProc(ref m);
Expand Down
Loading