Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Commit

Permalink
[Windows] Don't add Focus as a taskbar progress event.
Browse files Browse the repository at this point in the history
  • Loading branch information
Therzok committed Oct 21, 2014
1 parent 2a35e87 commit a609b18
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,14 @@ public override void Initialize ()
}
}

void ResetGlobalProgressState (object sender, EventArgs e)
{
IntPtr handle = GdkWin32.HgdiobjGet (IdeApp.Workbench.RootWindow.GdkWindow);
TaskbarManager.Instance.SetProgressState (TaskbarProgressBarState.NoProgress, handle);
IdeApp.FocusIn -= ResetGlobalProgressState;
}

public override void SetGlobalProgressBar (double progress)
{
if (!TaskbarManager.IsPlatformSupported)
return;

IntPtr handle = GdkWin32.HgdiobjGet (IdeApp.Workbench.RootWindow.GdkWindow);
if (progress == 1.0) {
if (IdeApp.HasInputFocus)
ResetGlobalProgressState (null, null);
else {
TaskbarManager.Instance.SetProgressValue ((int)(progress * 100f), 100, handle);
IdeApp.FocusIn += ResetGlobalProgressState;
}
if (progress >= 1.0) {
TaskbarManager.Instance.SetProgressState (TaskbarProgressBarState.NoProgress, handle);
} else {
TaskbarManager.Instance.SetProgressState (TaskbarProgressBarState.Normal, handle);
TaskbarManager.Instance.SetProgressValue ((int)(progress * 100f), 100, handle);
Expand Down

0 comments on commit a609b18

Please sign in to comment.