Skip to content

Commit 2faa38d

Browse files
authored
Fix thumbnails not appearing for windows created while menu is open (#11759)
With this change, I don't have #11106 happen anymore. For me, the bug happened whenever a window is created while the hover menu is open. Thumbnails objects were being created and added to the list of thumbnails in the AppThumbnailHoverMenu. However, then refreshThumbnail is called, which calls getThumbnail. In getThumbnail, metaWindowActor is still null and metaWindow.get_compositor_private returned null, causing it to remove the thumbnail again before it was ever visible. With the setTimeout(..., 0), getThumbnail is called on the next event loop turn, so that the actor will be returned by get_compositor_private. If the menu isn't open when the window is created, then the window is added to the queuedWindows array and added later on when the actor is available.
1 parent 70297d2 commit 2faa38d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

files/usr/share/cinnamon/applets/[email protected]/menus.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,9 @@ class WindowThumbnail {
821821
}
822822

823823
this.labelContainer.child.text = this.metaWindow.title || '';
824-
this.getThumbnail(thumbnailWidth, thumbnailHeight);
824+
setTimeout(() => {
825+
this.getThumbnail(thumbnailWidth, thumbnailHeight);
826+
}, 0);
825827
}
826828

827829
hoverPeek(opacity) {

0 commit comments

Comments
 (0)