mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-08 16:12:18 -07:00
Fix NPE on GUI during Windows Lock Screen (#3023)
This commit is contained in:
@@ -236,7 +236,7 @@ index 000000000..e463a86a6
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/gui/RAMGraph.java b/src/main/java/com/destroystokyo/paper/gui/RAMGraph.java
|
diff --git a/src/main/java/com/destroystokyo/paper/gui/RAMGraph.java b/src/main/java/com/destroystokyo/paper/gui/RAMGraph.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 000000000..5892c4dc1
|
index 000000000..c3e54da4a
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/gui/RAMGraph.java
|
+++ b/src/main/java/com/destroystokyo/paper/gui/RAMGraph.java
|
||||||
@@ -0,0 +0,0 @@
|
@@ -0,0 +0,0 @@
|
||||||
@@ -251,6 +251,7 @@ index 000000000..5892c4dc1
|
|||||||
+import java.awt.Graphics;
|
+import java.awt.Graphics;
|
||||||
+import java.awt.MouseInfo;
|
+import java.awt.MouseInfo;
|
||||||
+import java.awt.Point;
|
+import java.awt.Point;
|
||||||
|
+import java.awt.PointerInfo;
|
||||||
+import java.awt.event.MouseAdapter;
|
+import java.awt.event.MouseAdapter;
|
||||||
+import java.awt.event.MouseEvent;
|
+import java.awt.event.MouseEvent;
|
||||||
+import java.text.SimpleDateFormat;
|
+import java.text.SimpleDateFormat;
|
||||||
@@ -312,13 +313,18 @@ index 000000000..5892c4dc1
|
|||||||
+ Runtime jvm = Runtime.getRuntime();
|
+ Runtime jvm = Runtime.getRuntime();
|
||||||
+ DATA.add(new GraphData(jvm.totalMemory(), jvm.freeMemory(), jvm.maxMemory()));
|
+ DATA.add(new GraphData(jvm.totalMemory(), jvm.freeMemory(), jvm.maxMemory()));
|
||||||
+
|
+
|
||||||
+ Point scr = MouseInfo.getPointerInfo().getLocation();
|
+ PointerInfo pointerInfo = MouseInfo.getPointerInfo();
|
||||||
+ Point loc = new Point(scr);
|
+ if (pointerInfo != null) {
|
||||||
+ SwingUtilities.convertPointFromScreen(loc, this);
|
+ Point point = pointerInfo.getLocation();
|
||||||
+ if (this.contains(loc)) {
|
+ if (point != null) {
|
||||||
+ ToolTipManager.sharedInstance().mouseMoved(
|
+ Point loc = new Point(point);
|
||||||
+ new MouseEvent(this, -1, System.currentTimeMillis(), 0, loc.x, loc.y,
|
+ SwingUtilities.convertPointFromScreen(loc, this);
|
||||||
+ scr.x, scr.y, 0, false, 0));
|
+ if (this.contains(loc)) {
|
||||||
|
+ ToolTipManager.sharedInstance().mouseMoved(
|
||||||
|
+ new MouseEvent(this, -1, System.currentTimeMillis(), 0, loc.x, loc.y,
|
||||||
|
+ point.x, point.y, 0, false, 0));
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ currentTick++;
|
+ currentTick++;
|
||||||
|
Reference in New Issue
Block a user