feat: add Flutter USB mirroring and single-instance desktop clients
This commit is contained in:
1 parent
3a7bb071f0
commit
a339465392
30 files changed
+1688
-104
No files matched your search
@@ -4,9 +4,16 @@
|
||||
|
||||
#include "flutter_window.h"
|
||||
#include "utils.h"
|
||||
#include "desktop_instance.h"
|
||||
|
||||
int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
|
||||
_In_ wchar_t *command_line, _In_ int show_command) {
|
||||
DesktopInstance desktop_instance;
|
||||
if (!desktop_instance.valid()) return EXIT_FAILURE;
|
||||
if (!desktop_instance.primary()) {
|
||||
desktop_instance.Activate();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
// Attach to console when present (e.g., 'flutter run') or create a
|
||||
// new console when running with a debugger.
|
||||
if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
|
||||
@@ -30,6 +37,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
|
||||
if (!window.Create(L"ads_manager", origin, size)) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (!desktop_instance.Listen(window.GetHandle())) return EXIT_FAILURE;
|
||||
window.SetQuitOnClose(true);
|
||||
|
||||
::MSG msg;
|
||||
|
||||
Reference in new issue
Block a user