Independent applications together (magnet).
-
It is possible to make an application like Skype or TeamViewer, there where two indepenentes windows that are connected like magnet?
The difference is that two applications are independent.
application1.exe
application2.exeBoth are made in the same Qt.
When a detecting they join each other. -
Both of your examples use a central server to find each other though generally they talk directly to each other after that (using UDP and various methods to get through firewalls).
Magnet links use a distributed hash table (DHT) and peer exchange (PEX) to identify sources for data matching the hash in the link. Both require at least one known peer in order to function.
On a LAN having the applications find each other is reasonably easy: just use a network directed broadcast to a known port.
-
Chris I think your talking about "magnet protocol":http://en.wikipedia.org/wiki/Magnet_URI_scheme but l3e0wulf was using the word "magnet":http://en.wikipedia.org/wiki/Magnet to describe the "snap" effect of the windows management.
!http://images.binaryfortress.com/DisplayFusion/Website/Features/DemoWindowSnapping.gif! -
Then the described effect is not like TeamViewer or Skype in which multiple windows created by the same application are stacked. What they are doing is simple window positioning.
The problem the OP has is the two applications finding each other on the same machine, arbitrating which one is the "master", and communicating to the slave to have it move to stay adjacent to the master. Any change to the master's geometry and the slave would need to be told so it can move itself.
The two applications could find each other using a QLocalServer/QLocalClient pair and then send whatever information is needed between peers. The "QtSingleApplication":http://qt.gitorious.org/qt-solutions/qt-solutions/trees/master/qtsingleapplication solution implements something like the desired commuincation for a different purpose.
-
Thanks for the replies guys.
I realized that Qt has some examples as the Local Fortune Server and Client that uses QLocalServer / QLocalClient.
I'll do some testing.
What do I need to send the the application that will follow? Only the size of the window?