ChanServ changed the topic of #wayland to: https://wayland.freedesktop.org | Discussion about the Wayland protocol and its implementations, plus libinput
glennk has quit [Ping timeout: 480 seconds]
Brainium has quit []
Moprius has quit [Remote host closed the connection]
iomari892 has joined #wayland
iomari891 has quit [Read error: Connection reset by peer]
MrCooper has joined #wayland
AJC_Z0 has joined #wayland
iomari892 has quit [Ping timeout: 480 seconds]
AJ_Z0 has quit [Read error: Connection reset by peer]
AJC_Z0 is now known as AJ_Z0
MrCooper has quit [Ping timeout: 480 seconds]
nerdopolis has quit [Ping timeout: 480 seconds]
MrCooper has joined #wayland
<tokyo4j>
whot: why does libinput "accumulate" hi-res mouse scrolls? M705 mouse reports 15,15,15,15,15,30,15 (120 in total) scroll events at evdev layer, but libinput reports them as 60,15,30 (105 in total). So we have difficulty in reliably executing a mouse binding for exact one scroll click.
<whot>
tokyo4j: current code still has some accumulation but it's now two clicks, i.e. in your case it's 30 (not 60) to start and for mice with low res multipliers there is no accumulation (because it's unlikely to have inadvertant scrolls anyway)
<whot>
tokyo4j: still trying to figure out if *any* devices are actually affected by flaky scroll wheels or just the MX Master 3 series (or at least some of those...) but once the wheel is hi-res enough it's hard to be sure what is flakyness and what is just finger movement
feaneron has quit [Ping timeout: 480 seconds]
glennk has joined #wayland
bodiccea has quit [Ping timeout: 480 seconds]
karolherbst has quit [Read error: Connection reset by peer]
<tokyo4j>
whot: OK, thanks for your explanation. I installed libinput-git from AUR and now the reported scroll events are 15,15,15,15,15,30 (105 in total). I personally expect the scroll events from evdev (including the last 15-degree scroll) to be just passed through to the compositor immediately, at least with M705 mouse, but I'm not following the context of debouncing issue and don't know what's the best solution.
kts has joined #wayland
kts has quit [Quit: Konversation terminated!]
d42 has quit [Ping timeout: 480 seconds]
d42 has joined #wayland
bindu_ has quit [Ping timeout: 480 seconds]
kts has joined #wayland
garnacho has joined #wayland
kts has quit []
<whot>
tokyo4j: it's one of the many cases where there is no single correct answer because it depends on the mouse, the user and the interactions themselves. but it's basically the same as the de-jittering of the touchpad movement that we already have, the key is finding out what the magic line is where the least number of users is unhappy
bindu has joined #wayland
kts has joined #wayland
rasterman has joined #wayland
bindu_ has joined #wayland
bindu has quit [Ping timeout: 480 seconds]
ramblurr has quit [Remote host closed the connection]
<riteo>
Hi people. I'm looking at the docs and it says "For efficiency purposes, the IDs are densely packed in the sense that the ID N will not be used until N-1 has been used.". I mostly understand this but one thing is not clear: do the newly "reused" IDs have to be sequential, that is, do I need to necessarily pick e.g. from a freelist the lowest ID possible or is any free ID fair game?
bindu has quit [Ping timeout: 480 seconds]
<riteo>
rn I have an implementation that picks whatever free ID it can find, without ordeering them, and libwayland doesn't seem to complain but I wonder if that's actually spec compliant
<kennylevinsen>
riteo: "ID N will not be used until N-1 has been used" - if you pick, say, object ID 5 while object ID 4 is available, then you have violated that rule
<riteo>
aight
<riteo>
so I need a sorted free list
<riteo>
I initially scanned the buffer as a PoC but that's obviously pretty bad
garnacho has quit [Quit: garnacho]
<riteo>
ty for the clarification!
garnacho has joined #wayland
<kennylevinsen>
you could do some tricks like storing the first known gap index and only scan if that fails or something
<riteo>
mhhh
<riteo>
I guess that a sorted freelist would be more elegant though, wouldn't it?
<riteo>
I'm really not that experienced when it comes to data structures
r00tobo has quit [Quit: Quit]
<kennylevinsen>
a freelist with ranges would be fine, so you start with just 1 entry covering all IDs, and only add new entries to deal with gaps
<riteo>
aight
<riteo>
I'll see what I can do
<kennylevinsen>
if one had to be pedantic, a freelist could be provoked to create N/2 entries by an evil client allocating all IDs and destroying every second one, but oh well
<riteo>
i mean isn't this like, inevitable by design
<riteo>
that's technically correct, if you do this checkerboard thing you get a big object buffer
<riteo>
oh you mean like, the free list also consumes a lot of memory
<kennylevinsen>
"a lot" being somewhat limited by you only needing to store roughly two uint16's
narodnik has quit [Ping timeout: 480 seconds]
<ifreund>
riteo: fwiw, libwayland stores its freelist without using extra space with some pointer bit hacking
<ifreund>
see the map_entry union and is_free()/get_data() functions
<ifreund>
the free list is essentially a linked list of slots where each free slot stores the index of the next free slot
<ifreund>
in the same memory used to store the data pointers for slots that are not free
<riteo>
oh that's interesting
<riteo>
I'm currently very tired so I'm having some trouble figuring it all out (and I'm also a super newb in data structures) so I'll try to whip up something in the future
<riteo>
I'm pretty sure that it's going to be hard to do worse than straight up scanning the buffer lol
user21_ has quit [Remote host closed the connection]
kts has joined #wayland
feaneron has quit [Ping timeout: 480 seconds]
tzimmermann has quit [Quit: Leaving]
kts has quit [Ping timeout: 480 seconds]
sima has quit [Ping timeout: 480 seconds]
azerov has joined #wayland
carbonfiber has joined #wayland
rasterman has quit [Quit: Gettin' stinky!]
dcz has quit [Remote host closed the connection]
dcz has joined #wayland
<pq>
kennylevinsen, I don't think libwayland itself works like that. I guess "has been used" means has *ever* been used. It's only to stop clients from causing a massive allocation the compositor by choosing a huge new ID.
<pq>
kennylevinsen, IIRC, libwayland's wl_map only uses a simple unordered free list.
<pq>
riteo, ^
zvarde1988303206779191685873 has quit [Quit: Ping timeout (120 seconds)]
zvarde1988303206779191685873 has joined #wayland
<riteo>
yea it's somewhat ambiguous
<riteo>
(btw watch out I'm chaning my nick)
<riteo>
libwayland definitely doesn't complain
<riteo>
but since I'm working on the embedding compositor thing I'd really rather not get some very careful compositor to complain and redo the whole allocation approach
<riteo>
although tbf if libwayland uses an unordered free list... I guess I'm safe?
<riteo>
that'd definitely let me avoid a huge headache
<kennylevinsen>
pq: Yeah there's some issues in the phrasing - I don't think "has *ever* been used" is a meaningful restriction, or even true to the description of dense packing
riteo is now known as dery
<kennylevinsen>
I mean, requiring an ID to never be larger than the historically largest + 1 is a thing, but that's not dense packing
<pq>
kennylevinsen, it's not really dense packing. It only cares that the array is enlarged only if it is all in use.
<kennylevinsen>
("For efficiency purposes, the IDs are densely packed in the sense that the ID N will not be used until N-1 has been used. This ordering is not merely a guideline, but a strict requirement")
dcz has quit [Quit: Konversation terminated!]
<dery>
(just changed my nick as I said)
<kennylevinsen>
Hmm if we only want to mean that a new object ID must not be more than 1 larger than the previous largest ID, then we should rephrase that :/
<dery>
that would make things a lot simpler and more efficient imo
<pq>
yeah, you can confirm it in the wl_map code
<dery>
rn the Godot PooledList actually uses two arrays, like, whole contiguous blocks things
<dery>
and otherwise I'd have to switch to a linked list and sort stuff
<kennylevinsen>
I was looking around for our checks and was failing to find anything other than the wl_map_insert_at check
<pq>
kennylevinsen, that sounds like it.
<pq>
so, I was wrong too
<pq>
I guess?
<kennylevinsen>
wl_map_insert_at fails only if the length of the array is shorter than the index, so indeed it enforces only allowing a single call to wl_array_add (historical maximum length + 1)
<pq>
no need for the array to be full to enlarge, as long as the need is just +1