mirror of
https://github.com/DeeJanuz/frametop.git
synced 2026-10-06 05:00:08 +02:00
Pointer: ft-screens announces new panels to the helper
The helper now reads SteamVR's list of panels every 20 s instead of every second, so a panel made in between (a floating window's menu, frametop.float.N.sub.K, or the Frametop keyboard the first time it opens) couldn't be clicked with the mouse until the next read. ft-screens now sends "overlay <key>" to @ft_pointer_helper right after it makes one, and the helper adds it to its list at once (only frametop.* keys). An older helper ignores it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e6a931f7ee
commit
99aec84f62
2 files changed
+33
-2
No files matched your search
@@ -582,6 +582,17 @@ public:
|
||||
for (const auto &e : entries_) keys.push_back(e.key);
|
||||
return keys;
|
||||
}
|
||||
// A panel just made by another Frametop program (ft-screens: a floating window's menu, the
|
||||
// keyboard): known at once, without waiting for the next read ("overlay <key>").
|
||||
void Add(const std::string &key) {
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(lock_);
|
||||
for (const auto &e : entries_)
|
||||
if (e.key == key) return;
|
||||
entries_.push_back({key, key, true});
|
||||
}
|
||||
++generation_;
|
||||
}
|
||||
// Goes up by one each time the list is read, so the main loop knows to look the keys up again.
|
||||
unsigned Generation() const { return generation_; }
|
||||
// Answer `to` with {"t":"overlays","list":[{"key","name","visible"}...]} after the next refresh.
|
||||
@@ -1522,6 +1533,10 @@ int main() {
|
||||
reply(controllerButtons.Status());
|
||||
continue;
|
||||
}
|
||||
if (std::strncmp(buf, "overlay ", 8) == 0 && std::strncmp(buf + 8, "frametop.", 9) == 0) {
|
||||
overlays.Add(buf + 8);
|
||||
continue;
|
||||
}
|
||||
if (std::strncmp(buf, "overlays", 8) == 0) {
|
||||
overlays.Request(sender, senderLen); // answered from the list's thread
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user