Repository navigation
Releases
OMT Mini 0.9.0
See every OMT Mini on the network, and update one on purpose.
The fleet list
The control panel now lists every other OMT Mini it can find, the version each is running, and which are behind.
This costs nothing. Each copy already stamps its version into the sender information OMT carries, and identification already read that struct: it was simply throwing the version away. No extra traffic and no protocol of its own.
Where a copy has its control panel turned on, it also says so through an <OMTMiniControl> element in connection metadata, following the convention the OMT metadata specification sets out rather than inventing a side channel. That is how one machine knows where to reach another.
Updating another machine
One press, behind a confirmation that names the machine, both versions, and what it is about to interrupt, and tells you not to do it to something on air.
It is deliberately not a cascade. Nothing updates because a neighbour did. Closing every viewer and stopping capture and the multiview output on a box nobody is sitting at is not something to trigger automatically, and a room full of machines that update each other is a room that can go dark for a reason no one chose.
A copy with its control panel off cannot be updated remotely at all. That falls out of the panel being off by default, and is worth keeping rather than working around.
Under it
The outbound call runs on its own worker with a bounded queue, joined on stop, so the event loop never blocks on a machine that does not answer.
OMT Mini 0.8.6
Three fixes to the control panel, and one to the updater.
Windows closed on the machine stayed on the page
The page recorded a state as drawn before drawing it, so a single render that failed was remembered as done. Every later poll matched that record and skipped, and the page stopped updating until something forced it.
That is why closing one stale window made the others catch up at once: the command cleared the record.
A state is recorded only once it really has been drawn, and a failed render leaves nothing recorded, so the next poll just tries again.
Minimise looked exactly like close
A minimised window's rectangle is parked far off screen, around minus thirty two thousand, so the panel drew it outside the canvas and it disappeared.
Its restored position is reported now, and it is drawn dimmed and dashed where it belongs, captioned minimised, with the button offering to restore it.
Install and restart looked like it did nothing
The confirmation could open behind everything. Every dialog now has an owning window and asks for the foreground.
Unchanged and working
Double click, dragging and resizing are as they were in 0.8.5.
OMT Mini 0.8.5
Fixes maximise, minimise and double click doing nothing, and resizing from the control panel crashing.
Maximise and minimise did nothing
The panel posts {"kind":"state", ... ,"state":"maximize"}, and the field reader looked for the quoted name anywhere in the body. Searching for "state" matched the value of kind first, so the field came back empty and every maximise and minimise fell through to restore. On an already restored window that does nothing at all, which is exactly what you saw.
A name only counts as a name when a colon follows it now. Tested against that exact body, against a value that reads like another key, and against a key name buried inside a string.
Resizing from the panel could crash it
Resizing a swap chain unbinds render targets and reallocates buffers on the shared graphics device, and it was doing that with no lock held while the multiview output thread could be part way through composing a frame on the same device.
Resizing with the mouse rarely collided with it. A resize arriving from a socket at an arbitrary moment does, which is why the desktop was fine and the browser was not.
Creating, resizing and destroying a swap chain now hold the device lock for the whole sequence.
The panel could make a window too small
Windows enforces a minimum size during a mouse resize, but not when a size is set programmatically, so the panel could take a window below anything the rest of the code expects. The same floor is now applied wherever a size is set, with an upper bound well below a swap chain the machine could not allocate.
The control panel is now labelled beta
It is the newest part of this and the one most likely to still have rough edges, so it says so on the page, in its settings tab and in the README.
OMT Mini 0.8.4
Four fixes to the control panel.
The page could stop updating altogether
A single exception anywhere in a poll ended polling for the life of the page, because the next tick was only booked after the previous one returned.
That is the real reason a closed window stayed on the page: the panel had simply stopped looking. The next tick is now booked whatever happened.
Double click did nothing
A redraw was landing between the two halves of the click and replacing the element the second one was aimed at, so it hit nothing.
Interaction now holds redraws off for a moment, and a click that moved nothing no longer triggers a poll at all, which was the redraw eating it.
Closing leaves the page immediately
The window disappears from the panel as soon as you press the cross, rather than waiting for the machine to get round to it.
No more jump when you drop a window
Dropping in a new position flicked back and forth, because the page redrew from the last state it had before the machine had moved anything.
Where you put a window is now held until the machine reports the same thing, so the drop just lands.
Also
Added a minimise button on each window. Maximise was reachable by double click, but minimise was not reachable at all.
OMT Mini 0.8.3
Fixes the update button opening the Web tab instead of About.
Adding the Web tab between Multiview and About shifted About from position seven to eight, and I updated two of the three places that knew that number. The source list's update button kept sending you to seven, which is now Web.
Settings tabs are referred to by name now rather than by number, so inserting a tab moves everything that points at it. The labels are sized from their own list and checked against that set of names at compile time, so a tab added to one and not the other will not build at all. I confirmed the check bites by removing a label and watching the build fail.
OMT Mini 0.8.2
Rebuilds the control panel's server around not being able to wedge. Required if you are on 0.8.0 or 0.8.1.
Why it still froze
The 0.8.1 fix stopped the socket thread walking the window list, but left the rest of the design in place, and the rest of the design was the problem.
- A thread per connection, detached. Nothing waited for them, so one could outlive the server and touch its lock afterwards. A browser opens several connections at once, plus speculative ones that send nothing at all.
- Thread creation throws. Nothing caught it, so failing to create one would have taken the process down outright.
- Accept blocked, and was interrupted by closing the socket underneath it.
- Nothing capped connections.
- The whole state document was rebuilt per request, per client.
What it is now
A single non-blocking loop. One thread total, no detached threads, so stopping is a flag and a join.
Everything is bounded: 24 connections, 64 KB per request, 128 queued commands, and a deadline on every connection, so nothing a client does can make it grow.
The state document is built once on the interface thread, however many browsers are watching, and the loop only copies a string. Neither the loop nor the responder can reach a window at all, which is checked rather than assumed.
Geometry arriving from a browser is clamped before anything is asked of a window. It must never be trusted to be sensible.
The page is steadier too
- It never redraws while you are dragging, so the layout cannot be rebuilt under your hand
- It skips the redraw entirely when nothing has changed, instead of rebuilding every frame
- Every request has a timeout, so a stalled one cannot wedge the page
- It backs off when the other end stops answering, rather than hammering it
- It does not send a move at all when nothing actually moved
OMT Mini 0.8.1
Fixes the control panel freezing OMT Mini. Required if you are on 0.8.0.
What was happening
One command worked, then nothing did, then the application would not respond at all.
The panel's state was being built on the socket thread, and building it called the routine that tidies up closed viewers. That erases viewer objects, which joins their receive threads and calls DestroyWindow on windows the interface thread owns, and it updates the tray icon through Shell_NotifyIcon.
None of those may be done from another thread. It ran on every poll, roughly once a second, so the first poll that raced the interface wedged the whole application.
The fix
The socket thread now only ever reads a snapshot. The snapshot is taken under a lock and built on the interface thread, on a timer and immediately after any command so the panel sees the result of what it just did. Nothing reachable from a web request touches a window any more.
I also audited everything else a request can reach. Discovery, the announcer and the multiview engine all carry their own locks, and the monitor and desktop queries are safe from any thread. That audit is what was missing when this went in.
Also
The refresh runs twice a second now, so a window you drag on the desktop itself shows up in the panel promptly rather than a second later.
OMT Mini 0.8.0
A web control panel, so OMT Mini can be driven from a browser on another machine.
What it does
It serves one page, from memory, with no dependencies at either end. Nothing to install on the machine you drive it from.
- Every open viewer and the multiview drawn where they actually are, to scale, across your real monitor layout
- Drag a window to move it, the corner to resize, double click to maximise, and the window on the machine follows
- Drag a source from the list onto a window to retarget it, or onto empty desktop to open a new viewer
- Drag sources onto the multiview cells, and change its layout from the same page
- Add a source by address remotely, including the port walk that finds every sender on a machine
- Sources carry the same tags as in the app:
direct,mDNS,this machine,OMT Mini, and offline
Retargeting a viewer opens a new one and puts it exactly where the old one was, because a viewer is bound to its source for its lifetime. It reads as a change rather than a replacement.
Turning it on
Settings > Web. It is off by default, and deliberately so: it can close a window on a machine that is on air, and it has no password. Anyone who can reach the port can move, retarget and close windows on that machine.
Turn it on where you trust the network. The tab shows the address to open, and there is a button to open it locally.
Default port 7400, configurable.
Under it
Commands arrive on a socket thread and are applied on the interface thread, for the same reason every other deferred path in here exists: they move and destroy windows. Window positions are read straight off Win32, which is safe from any thread.
One bug worth mentioning, caught by testing the JSON before trusting it. A string literal passed to the field helper was binding to the bool overload rather than the string one, because pointer to bool is a standard conversion and beats the user defined conversion to std::string. Every literal was serialising as true. Fixed, and the generator is now checked against a real parser.
OMT Mini 0.7.4
Fixes an added source still not appearing when it fell back to being named after its address.
Why an address is the worst possible name
A dot ends a label in DNS-SD, and libomt does not escape them. Its own sanitiser has exactly that replacement sitting commented out:
return name; // return name.Replace(".", " ");Somebody had met this before and turned the workaround off. An address is almost entirely dots, so naming a source after one meant it was never announced.
Two changes
Dots are stripped from any name before it goes out, alongside the brackets and colons already handled. A name you type with a dot in it, like Cam 1.2 or studio-pc.local, now announces properly instead of silently failing.
A source added without a name is called Direct source, numbered when there is more than one, rather than being named after the address it points at. The name is chosen once when the source is stored, so it stays put as the list changes, and you can rename it whenever you like.
Checked that nothing reachable from a typed name, an address or a hostname can put a dot on the network.
If you already have one
A source added on an earlier version may still carry an address as its name. Edit it once and save, and it will pick up a usable name.
OMT Mini 0.7.3
Interface tidy.
The tag on an announced source now reads mDNS rather than "on mDNS". It sits beside direct and this machine, which are labels rather than phrases, so this one should be too.
No behaviour change.