Skip to content

Commit

Permalink
notifier: add flash taskbar option
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperNerdEric authored Jan 3, 2024
1 parent 5fdc5e6 commit 5c90795
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ public void notify(String message, TrayIcon.MessageType type)
case REQUEST:
clientUI.requestFocus();
break;
case TASKBAR:
clientUI.flashTaskbar();
break;
case FORCE:
clientUI.forceFocus();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ public enum RequestFocusType
{
OFF,
REQUEST,
TASKBAR,
FORCE;
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import java.awt.GraphicsEnvironment;
import java.awt.LayoutManager;
import java.awt.Rectangle;
import java.awt.Taskbar;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.desktop.QuitStrategy;
Expand Down Expand Up @@ -790,6 +791,14 @@ public void forceFocus()
giveClientFocus();
}

/**
* Request user attention to the window (flash the taskbar)
*/
public void flashTaskbar()
{
Taskbar.getTaskbar().requestWindowUserAttention(frame);
}

/**
* Returns current cursor set on game container
* @return awt cursor
Expand Down

0 comments on commit 5c90795

Please sign in to comment.