Skip to content

Commit d7c32ef

Browse files
committed
fix: update visibility API documentation for clarity and correct type usage
1 parent 42678a4 commit d7c32ef

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

docs/api/system.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,19 @@ double get_date_now();
7979
Page visibility lets your app detect whether it is currently visible to the user.
8080

8181
```cpp
82-
webcc::string get_visibility_state(); // "visible", "hidden", etc.
83-
uint8 is_hidden(); // 1 when hidden, 0 otherwise
82+
webcc::string get_visibility_state(); // Usually "visible" or "hidden"
83+
uint8_t is_hidden(); // 1 when hidden, 0 otherwise
8484
void init_visibility_change();
8585
```
8686

87+
Use `is_hidden()` when you only need a fast boolean-style check.
88+
Use `get_visibility_state()` when you want the exact browser-reported state string.
89+
8790
After calling `init_visibility_change()`, visibility updates are emitted through the event system.
8891

8992
```cpp
9093
struct VisibilityChangeEvent {
91-
uint8 hidden;
94+
uint8_t hidden;
9295
webcc::string_view state;
9396
};
9497
```

0 commit comments

Comments
 (0)