_exit()
instead of exit()
with QML, Qt, and MeeGo Touch boosters. However, do not use it with exec booster.
The basic difference between exit()
and _exit()
is that the former performs cleanup related to user-mode constructs in the library and calls user-supplied cleanup-functions, whereas the latter performs only the kernel cleanup for the process.
The function _exit()
terminates the calling process immediately. Any open file descriptors belonging to the process are closed; any children of the process are inherited by process.
The exit()
function causes normal process termination and the value of status is returned to the parent. A child process must strictly use _exit()
instead of a simple exit()
.
The user-level initialisations of the libraries are done once when the launcher daemon loads the libraries. The launched applications are child processes of the launcher, and every time exit()
is called, the corresponding cleanup actions are executed. The root problem is that the cleanup actions are carried out multiple times, and libraries may not be designed to tolerate this. By calling _exit()
in the applications, the problem is avoided.
-style
-stylesheet
-session
-widgetcount
-reverse
-graphicssystem
-display
-geometry
-fn
-font
-bg
-background
-fg
-foreground
-btn
-button
-name
-title
-visual
-ncols
-cmap
-im
-inputstyle
-genimglist
-remote-theme
-fullscreen
-disable-m-input-context
argc
and argv
. They can be converted into QStringList similar to returned by QCoreApplication::arguments() as follows:
M_EXPORT int main(int argc, char **argv) { QStringList arguments; for (int a = 0; a < argc; ++a) { arguments << QString::fromLocal8Bit(argv[a]); } ...
--delay 10
The invoker waits for 10 seconds before terminating --wait-term
The invoker does not terminate until the launched application terminates. The invoker returns the same return value as the application did, or it is terminated by the same signal as the launched application. Signals received by the invoker process are forwarded to the launched application.mcompositor
window manager.Set the WM_CLASS property for the application as follows:
M_EXPORT int main(int argc, char **argv) { MApplication *app = MComponentCache::mApplication(argc, argv); //don't use window from cache, create our own MApplicationWindow *window = new myDerivedMApplicationWindow(); #ifdef Q_WS_X11 // reinit WM_COMMAND X11 property if (window) { Display *display = QX11Info::display(); if (display) { XSetCommand(display, window->effectiveWinId(), argv, argc); // set correct WM_CLASS properties QString appName = QFileInfo(argv[0]).fileName(); QString appClass = appName.left(1).toUpper(); if (appName.length() > 1) appClass += appName.right(appName.length() - 1); // reserve memory for C strings QByteArray arrName(appName.toLatin1()); QByteArray arrClass(appClass.toLatin1()); XClassHint class_hint; class_hint.res_name = arrName.data(); class_hint.res_class = arrClass.data(); XSetClassHint(display, window->effectiveWinId(), &class_hint); } } #endif // do application specific stuff ... window->show(); return app->exec(); }