From b2dcd84bbf5654b6a7265d88cacfc95604fb3c2a Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Fri, 26 May 2017 12:15:58 +0200 Subject: [PATCH] Use UIUtil.setCursor to prevent setting the cursor that is already set. Cursor is updated by native code even if component has the same cursor, causing performance problems (IDEA-167733) --- .../openapi/wm/impl/welcomeScreen/RecentProjectPanel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectPanel.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectPanel.java index 6b66bcb40980..bec8d35f7835 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectPanel.java @@ -263,7 +263,7 @@ public class RecentProjectPanel extends JPanel { final Rectangle cellBounds = myList.getCellBounds(index, index); if (cellBounds != null && cellBounds.contains(point)) { - myList.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + UIUtil.setCursor(myList, Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); if (rectInListCoordinatesContains(cellBounds, point)) { currentIcon = AllIcons.Welcome.Project.Remove_hover; } else { @@ -273,7 +273,7 @@ public class RecentProjectPanel extends JPanel { myList.repaint(cellBounds); } else { - myList.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + UIUtil.setCursor(myList, Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); myHoverIndex = -1; myList.repaint(); }