|
|
|
|
@ -308,59 +308,61 @@ void Booster::requestSplash(const int pid, const std::string &wmclass,
|
|
|
|
|
const std::string &pixmapId)
|
|
|
|
|
{
|
|
|
|
|
std::stringstream st;
|
|
|
|
|
st << getpid();
|
|
|
|
|
st << pid;
|
|
|
|
|
std::string pidStr = st.str();
|
|
|
|
|
|
|
|
|
|
Display * dpy = XOpenDisplay(NULL);
|
|
|
|
|
if (dpy) {
|
|
|
|
|
const char *compositorWindowIdProperty = "_NET_SUPPORTING_WM_CHECK";
|
|
|
|
|
Atom compositorWindowIdAtom = XInternAtom(dpy, compositorWindowIdProperty, False);
|
|
|
|
|
Atom type;
|
|
|
|
|
int format;
|
|
|
|
|
unsigned long nItems;
|
|
|
|
|
unsigned long bytesAfter;
|
|
|
|
|
unsigned char *prop = 0;
|
|
|
|
|
|
|
|
|
|
// Get the compositor window id
|
|
|
|
|
Window rootWin = XDefaultRootWindow(dpy);
|
|
|
|
|
int retval = XGetWindowProperty(dpy, rootWin, compositorWindowIdAtom,
|
|
|
|
|
0, 0x7fffffff, False, XA_WINDOW,
|
|
|
|
|
&type, &format, &nItems, &bytesAfter, &prop);
|
|
|
|
|
if(retval == Success) {
|
|
|
|
|
|
|
|
|
|
// Package up the data and set the property
|
|
|
|
|
int len = pidStr.length() + 1
|
|
|
|
|
+ wmclass.length() + 1
|
|
|
|
|
+ portraitSplash.length() + 1
|
|
|
|
|
+ landscapeSplash.length() + 1
|
|
|
|
|
+ pixmapId.length() + 1;
|
|
|
|
|
char *data = new char[len];
|
|
|
|
|
char *d = data;
|
|
|
|
|
|
|
|
|
|
strcpy(d, pidStr.c_str());
|
|
|
|
|
d = d + pidStr.length() + 1;
|
|
|
|
|
strcpy(d, wmclass.c_str());
|
|
|
|
|
d = d + wmclass.length() + 1;
|
|
|
|
|
strcpy(d, portraitSplash.c_str());
|
|
|
|
|
d = d + portraitSplash.length() + 1;
|
|
|
|
|
strcpy(d, landscapeSplash.c_str());
|
|
|
|
|
d = d + landscapeSplash.length() + 1;
|
|
|
|
|
strcpy(d, pixmapId.c_str());
|
|
|
|
|
|
|
|
|
|
Window compositorWindow = *reinterpret_cast<Window *>(prop);
|
|
|
|
|
const char* splashProperty = "_MEEGO_SPLASH_SCREEN";
|
|
|
|
|
Atom splashPropertyAtom = XInternAtom(dpy, splashProperty, False);
|
|
|
|
|
Atom stringAtom = XInternAtom(dpy, "STRING", False);
|
|
|
|
|
|
|
|
|
|
XChangeProperty(dpy, compositorWindow, splashPropertyAtom, stringAtom,
|
|
|
|
|
8, PropModeReplace, (unsigned char *)data,
|
|
|
|
|
len);
|
|
|
|
|
|
|
|
|
|
// Without flushing, the change seems to loiter in X's queue
|
|
|
|
|
XFlush(dpy);
|
|
|
|
|
delete[] data;
|
|
|
|
|
XFree(prop);
|
|
|
|
|
}
|
|
|
|
|
if (dpy)
|
|
|
|
|
{
|
|
|
|
|
const char *compositorWindowIdProperty = "_NET_SUPPORTING_WM_CHECK";
|
|
|
|
|
Atom compositorWindowIdAtom = XInternAtom(dpy, compositorWindowIdProperty, False);
|
|
|
|
|
Atom type;
|
|
|
|
|
int format;
|
|
|
|
|
unsigned long nItems;
|
|
|
|
|
unsigned long bytesAfter;
|
|
|
|
|
unsigned char *prop = 0;
|
|
|
|
|
|
|
|
|
|
// Get the compositor window id
|
|
|
|
|
Window rootWin = XDefaultRootWindow(dpy);
|
|
|
|
|
int retval = XGetWindowProperty(dpy, rootWin, compositorWindowIdAtom,
|
|
|
|
|
0, 0x7fffffff, False, XA_WINDOW,
|
|
|
|
|
&type, &format, &nItems, &bytesAfter, &prop);
|
|
|
|
|
if (retval == Success)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// Package up the data and set the property
|
|
|
|
|
int len = pidStr.length() + 1
|
|
|
|
|
+ wmclass.length() + 1
|
|
|
|
|
+ portraitSplash.length() + 1
|
|
|
|
|
+ landscapeSplash.length() + 1
|
|
|
|
|
+ pixmapId.length() + 1;
|
|
|
|
|
char *data = new char[len];
|
|
|
|
|
char *d = data;
|
|
|
|
|
|
|
|
|
|
strcpy(d, pidStr.c_str());
|
|
|
|
|
d = d + pidStr.length() + 1;
|
|
|
|
|
strcpy(d, wmclass.c_str());
|
|
|
|
|
d = d + wmclass.length() + 1;
|
|
|
|
|
strcpy(d, portraitSplash.c_str());
|
|
|
|
|
d = d + portraitSplash.length() + 1;
|
|
|
|
|
strcpy(d, landscapeSplash.c_str());
|
|
|
|
|
d = d + landscapeSplash.length() + 1;
|
|
|
|
|
strcpy(d, pixmapId.c_str());
|
|
|
|
|
|
|
|
|
|
Window compositorWindow = *reinterpret_cast<Window *>(prop);
|
|
|
|
|
const char* splashProperty = "_MEEGO_SPLASH_SCREEN";
|
|
|
|
|
Atom splashPropertyAtom = XInternAtom(dpy, splashProperty, False);
|
|
|
|
|
Atom stringAtom = XInternAtom(dpy, "STRING", False);
|
|
|
|
|
|
|
|
|
|
XChangeProperty(dpy, compositorWindow, splashPropertyAtom, stringAtom,
|
|
|
|
|
8, PropModeReplace, (unsigned char *)data,
|
|
|
|
|
len);
|
|
|
|
|
|
|
|
|
|
// Without flushing, the change seems to loiter in X's queue
|
|
|
|
|
XFlush(dpy);
|
|
|
|
|
delete[] data;
|
|
|
|
|
XFree(prop);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -431,7 +433,7 @@ void Booster::setEnvironmentBeforeLaunch()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Load the application and find out the address of main()
|
|
|
|
|
void* handle = loadMain();
|
|
|
|
|
loadMain();
|
|
|
|
|
|
|
|
|
|
// Make sure that boosted application can dump core. This must be
|
|
|
|
|
// done after set[ug]id().
|
|
|
|
|
|