[XDGV6] manage every ping sent
ClosedPublic

Authored by mart on Jun 28 2017, 3:01 PM.

Details

Summary

if more ping arrives before a pong, store each of its
serial and manage them one by one

a new signal, pingTimeout emitted until explicitly stopped

Test Plan

tests still pass, kwin modified to use it on window close
and window focus gain works correctly.
What is not tested: apps not answering to pings
as usually the connection thread will still be
running, so something to actually query the gui
thread will be needed

Diff Detail

Repository
R127 KWayland
Branch
mart/xdgv6ping
Lint
No Linters Available
Unit
No Unit Test Coverage
mart created this revision.Jun 28 2017, 3:01 PM
Restricted Application added projects: Plasma on Wayland, Frameworks. · View Herald TranscriptJun 28 2017, 3:01 PM
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript

who deletes the qtimer if it times out?

can this timer stuff be shared by moving it into XdgShellInterface::Private ?

mart added a comment.Jun 28 2017, 4:14 PM

who deletes the qtimer if it times out?

can this timer stuff be shared by moving it into XdgShellInterface::Private ?

for how i did the kwin part, it must be who called it with discardTimer (this to allow kwin to receive 2 timeouts before deciding to kill the window)
most of it is in private, just its creation is mostly identical in the implementation of ping in the subclasses

for how i did the kwin part, it must be who called it with discardTimer (this to allow kwin to receive 2 timeouts before deciding to kill the window)

Ok, I see how it's meant to work but I don't understand why it's done like that.

From what I see Kwayland can call "emit q->pingTimeout ; q->discardTimer() " and your kwin code will still wait for 2 timeouts,

Otherwise it creates different behaviour depending on whether we do or don't receive a pong, and we make it very vulnerable to leak (for example if ShellClient instance is deleted with a ping open)


most of it is in private, just its creation is mostly identical in the implementation of ping in the subclasses

Yes, and I'm saying that bit could be shared as a method and called from the subclasses.

mart added a comment.Jun 29 2017, 9:22 AM

for how i did the kwin part, it must be who called it with discardTimer (this to allow kwin to receive 2 timeouts before deciding to kill the window)

Ok, I see how it's meant to work but I don't understand why it's done like that.

From what I see Kwayland can call "emit q->pingTimeout ; q->discardTimer() " and your kwin code will still wait for 2 timeouts,

in this case only one as the second timeout will never be emitted?
what i could do, is chaning the timeout signature in pingTimeout(serial, attempt) so on kwayland-server part, it would emit timeout two times, then delte the timer by itself

most of it is in private, just its creation is mostly identical in the implementation of ping in the subclasses

Yes, and I'm saying that bit could be shared as a method and called from the subclasses.

+1

mart updated this revision to Diff 15989.Jun 29 2017, 11:05 AM
  • get rid of discardPing
Restricted Application edited projects, added Plasma; removed Plasma on Wayland. · View Herald TranscriptJun 29 2017, 11:05 AM
mart updated this revision to Diff 15997.Jun 29 2017, 11:51 AM
  • quint32 everywhere
Restricted Application edited projects, added Plasma on Wayland; removed Plasma. · View Herald TranscriptJun 29 2017, 11:51 AM
mart updated this revision to Diff 16044.Jun 30 2017, 9:43 AM
  • pingDelayed signal
Restricted Application edited projects, added Plasma; removed Plasma on Wayland. · View Herald TranscriptJun 30 2017, 9:43 AM
davidedmundson accepted this revision.Jun 30 2017, 9:45 AM
This revision is now accepted and ready to land.Jun 30 2017, 9:45 AM
mart closed this revision.Jun 30 2017, 10:25 AM