aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-06-27 09:48:42 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2024-06-28 10:39:35 +0400
commit0757ad08e776665603cba238301295ad27132d06 (patch)
treef63a2cd08bbf365d7b2f8f43df1f877515f9112a /src
parent557702147553c56759139cffa45e293e784dbd91 (diff)
downloadniri-0757ad08e776665603cba238301295ad27132d06.tar.gz
niri-0757ad08e776665603cba238301295ad27132d06.tar.bz2
niri-0757ad08e776665603cba238301295ad27132d06.zip
id: Start from 1
Diffstat (limited to 'src')
-rw-r--r--src/utils/id.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/utils/id.rs b/src/utils/id.rs
index 3f8a2a7d..06f48394 100644
--- a/src/utils/id.rs
+++ b/src/utils/id.rs
@@ -11,7 +11,9 @@ pub struct IdCounter {
impl IdCounter {
pub const fn new() -> Self {
Self {
- value: AtomicU32::new(0),
+ // Start from 1 to reduce the possibility that some other code that uses these IDs will
+ // get confused.
+ value: AtomicU32::new(1),
}
}