29jm / SnowflakeOS

"It is very special"
https://jmnl.xyz
MIT License
316 stars 18 forks source link

partial fix of #15 #25

Closed xadaemon closed 3 years ago

xadaemon commented 3 years ago

@29jm there goes the pr, in my tests chaging the ringbuffer size at wm.c:70 seems to not make much of a difference and the events are happening there is just this odd delay it seems

xadaemon commented 3 years ago

after adding some debug printf's the window seems to be requesting the events all right but not acting upon them (I will continue the tests on my end here)

xadaemon commented 3 years ago

it seems that there is something up with the buffer read or the write because upon dumping the bytes read from the ringbuff also the buffer is not being advanced on write, very strange

xadaemon commented 3 years ago

it seems I figured out typing events however something is up with clicks they seems to register only when the mouse is moved and register duplicate

29jm commented 3 years ago

Great catch on that for loop! I was just looking at this, it was a puzzling bug for sure. r_pos will still have to be updated in case of overflow, is that calculation causing issues too (the one commented out) ?

I don't know if that fixes click issues specifically, but you should replace |= assignments with plain =, otherwise you're oring a flag with some random value from the stack.

Edit: couldn't tell you how, but I managed to type a smiley character by moving the mouse around (or-related probably) ^^ Also, the repeat events lead to really cool visuals in paint!

xadaemon commented 3 years ago

I removed all instances of |=, ok so I figured a few things I will change ringbuffer around a bit and see if that helps

xadaemon commented 3 years ago

@29jm I managed to sort out the bug and make the ringbuffer simpler, last problem is that for some reason the moment you focus back on the terminal(say if you were using calc) it prints out a garbage character

xadaemon commented 3 years ago

I'm not losing keystrokes with as low as a 5 items ring buffer can you do some tests too?

xadaemon commented 3 years ago

@29jm I managed to fix every issue now should be all good for merging