Mercurial > minori
comparison dep/animia/src/animia.cc @ 158:80d6b28eb29f
dep/animia: fix most X11 stuff
it looks like _NET_WM_PID isn't supported by MOST clients, or my code is wrong...
core/filesystem: fix Linux config path handling on *nix
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Fri, 17 Nov 2023 02:07:33 -0500 |
| parents | cdf79282d647 |
| children | 61b76c7b656a |
comparison
equal
deleted
inserted
replaced
| 157:18c8eb5d1edc | 158:80d6b28eb29f |
|---|---|
| 6 #include "animia/win.h" | 6 #include "animia/win.h" |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | |
| 12 #include <iostream> | |
| 11 | 13 |
| 12 namespace animia { | 14 namespace animia { |
| 13 | 15 |
| 14 namespace internal { | 16 namespace internal { |
| 15 | 17 |
| 68 Note: X11 is stupid and there's no reliable way to get a PID from a given window. | 70 Note: X11 is stupid and there's no reliable way to get a PID from a given window. |
| 69 This is because some windows might not even have a process attached to them. | 71 This is because some windows might not even have a process attached to them. |
| 70 We should set the PID of the process if we can get it, but that'll be for when | 72 We should set the PID of the process if we can get it, but that'll be for when |
| 71 I can actually be arsed to implement the X11 backend. */ | 73 I can actually be arsed to implement the X11 backend. */ |
| 72 auto window_proc = [&](const Process& process, const Window& window) -> bool { | 74 auto window_proc = [&](const Process& process, const Window& window) -> bool { |
| 75 std::cout << "Window ID: " << window.id << "\n" | |
| 76 << "\tClass name: " << window.class_name << "\n" | |
| 77 << "\tTitle text: " << window.text << "\n" | |
| 78 << "\tProcess info: " << "\n" | |
| 79 << "\t\tPID: " << process.pid << "\n"; | |
| 73 for (const auto& player : players) { | 80 for (const auto& player : players) { |
| 74 if (!internal::PlayerHasStrategy(player, Strategy::WindowTitle)) | 81 if (!internal::PlayerHasStrategy(player, Strategy::WindowTitle)) |
| 75 continue; | 82 continue; |
| 76 | 83 |
| 77 if (!internal::IsWindowInList(player, window.class_name)) | 84 if (!internal::IsWindowInList(player, window.class_name)) |
