diff --git a/src/WindowSystem/WindowSystem.vala b/src/WindowSystem/WindowSystem.vala
index c9942531..272e9a82 100644
--- a/src/WindowSystem/WindowSystem.vala
+++ b/src/WindowSystem/WindowSystem.vala
@@ -43,8 +43,9 @@
 
     public Window? find_window (uint64 uid) {
         uint index;
-        if (windows.find_custom (uid, (win, uid) => {
-            return win.uid == (uint64) uid;
+        Window w = new Window(uid);
+        if (windows.find_with_equal_func (w, (win, needle) => {
+            return win.uid == needle.uid;
         }, out index)) {
             return windows[index];
         }
