Changes: removed compilation warnings

RevBy: Pertti Kellomaki
pull/1/head
Alexey Shilov 15 years ago
parent 7615862662
commit 4ebc2dcfb0

1
debian/changelog vendored

@ -2,6 +2,7 @@ applauncherd (0.23.0) unstable; urgency=low
* Changes: Removed extra prctl(PR_SET_DUMPABLE, ...) * Changes: Removed extra prctl(PR_SET_DUMPABLE, ...)
* Changes: e-booster refactoring * Changes: e-booster refactoring
* Changes: removed compilation warnings
-- Alexey Shilov <alexey.shilov@nokia.com> Thu, 10 Mar 2011 14:52:40 +0200 -- Alexey Shilov <alexey.shilov@nokia.com> Thu, 10 Mar 2011 14:52:40 +0200

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

Loading…
Cancel
Save