X-Git-Url: https://git.sur5r.net/?p=minitube;a=blobdiff_plain;f=src%2Fmain.cpp;h=9b2e1762eeb4d8f99494e84848a69ca2e1529c6b;hp=b2df305140a7de4aa178a08c48cfb2b953497109;hb=3c8c537559e6bef5f019196b0989e95863ddd3ee;hpb=57c25e20a8f10a98a18dbc2b64ce55cf87d4fd7c diff --git a/src/main.cpp b/src/main.cpp index b2df305..9b2e176 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,9 +7,6 @@ #include "mac_startup.h" #include "macfullscreen.h" #endif -#ifdef APP_WIN -#include "local/win/qtwin.h" -#endif #include "iconloader/qticonloader.h" int main(int argc, char **argv) { @@ -19,7 +16,8 @@ int main(int argc, char **argv) { #endif QtSingleApplication app(argc, argv); - if (app.sendMessage("Wake up!")) + QString message = app.arguments().size() > 1 ? app.arguments().at(1) : ""; + if (app.sendMessage(message)) return 0; app.setApplicationName(Constants::NAME); @@ -69,6 +67,7 @@ int main(int argc, char **argv) { mainWin.setWindowTitle(Constants::NAME); #ifdef Q_WS_MAC + app.setQuitOnLastWindowClosed(false); mac::SetupFullScreenWindow(mainWin.winId()); #endif @@ -93,15 +92,12 @@ int main(int argc, char **argv) { #endif #ifdef APP_WIN - if (QtWin::isCompositionEnabled()) { - QtWin::extendFrameIntoClientArea(&mainWin); - mainWin.setContentsMargins(0, 0, 0, 0); - } app.setFont(QFont("Segoe UI", 9)); #endif mainWin.show(); + mainWin.connect(&app, SIGNAL(messageReceived(const QString &)), &mainWin, SLOT(messageReceived(const QString &))); app.setActivationWindow(&mainWin, true); // all string literals are UTF-8