diff dep/animia/src/animia.cc @ 236:4d461ef7d424

HUGE UPDATE: convert build system to autotools why? because cmake sucks :)
author Paper <mrpapersonic@gmail.com>
date Fri, 19 Jan 2024 00:24:02 -0500
parents 031a257ee019
children
line wrap: on
line diff
--- a/dep/animia/src/animia.cc	Tue Jan 16 15:22:29 2024 -0500
+++ b/dep/animia/src/animia.cc	Fri Jan 19 00:24:02 2024 -0500
@@ -27,9 +27,12 @@
 	return false;
 }
 
-static bool IsWindowInList(const Player& player, const std::string& name) {
+static bool IsWindowInList(const Player& player, const Window& window) {
+//	if (util::CheckPattern(player.window_title_format, window.text))
+//		return true;
+
 	for (const auto& pattern : player.windows)
-		if (util::CheckPattern(pattern, name))
+		if (util::CheckPattern(pattern, window.class_name))
 			return true;
 
 	return false;
@@ -65,22 +68,12 @@
 	if (!internal::EnumerateOpenProcesses(process_proc))
 		return false;
 
-	/* Then add our cool windows.
-	   Note: X11 is stupid and there's no reliable way to get a PID from a given window.
-	         This is because some windows might not even have a process attached to them.
-	         We should set the PID of the process if we can get it, but that'll be for when
-	         I can actually be arsed to implement the X11 backend. */
 	auto window_proc = [&](const Process& process, const Window& window) -> bool {
 		for (const auto& player : players) {
-			if (!internal::PlayerHasStrategy(player, Strategy::WindowTitle))
-				continue;
+			if (internal::IsWindowInList(player, window))
+				results.push_back({ResultType::Window, player, process, window, {}});
+		}
 
-			if (!internal::IsWindowInList(player, window.class_name))
-				continue;
-
-			results.push_back({ResultType::Window, player, process, window, {}});
-			break;
-		}
 		return true;
 	};