X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fmain.cpp;fp=src%2Fmain.cpp;h=ed809fe6d03315d15e9fe14cd9e4ec34ff090f32;hb=21772bfc2d482248e2df5438039a70d5231bc993;hp=727bd27d8f0fd8d64852954e1d6541ef65d2abcb;hpb=ad0d2072c885d5ef6065ea5039536fe0d01a6871;p=src%2Fwindow-management-client-grpc.git diff --git a/src/main.cpp b/src/main.cpp index 727bd27..ed809fe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -46,6 +46,7 @@ enum mode { FULLSCREEN = 2, FULLSCREEN_QT = 3, // rather than use rpc, use Qt API ON_OTHER_OUTPUTS = 4, + SET_FLOAT_POS = 5, }; static QWindow * @@ -81,10 +82,12 @@ int main(int argc, char *argv[]) mmode = ON_OTHER_OUTPUTS; else if (strcmp(argv[1], "full_qt") == 0) mmode = FULLSCREEN_QT; + else if (strcmp(argv[1], "position") == 0) + mmode = SET_FLOAT_POS; else assert(!"Invalid mode"); - if (mmode != FLOAT && mmode != FULLSCREEN && mmode != ON_OTHER_OUTPUTS) { + if (mmode != FLOAT && mmode != FULLSCREEN && mmode != ON_OTHER_OUTPUTS && mmode != SET_FLOAT_POS) { fprintf(stderr, "Will not use rpc\n"); goto skip; } @@ -118,6 +121,13 @@ int main(int argc, char *argv[]) client->SetAppOnOutput(myname.toStdString(), std::string(output_name)); break; + case SET_FLOAT_POS: + // this assumes the window is already running and + // floating; uses the same application so this needs + // to be first started as float. + client->SetAppPosition(myname.toStdString(), 550, 550); + exit(EXIT_SUCCESS); + break; default: break; }