[mapplauncherd] Remove splash support.

This feature only encourages poor application interactivity: anything which is
sufficiently slow to require a splash screen should be made faster instead.

In addition to that, the feature is poorly implemented (X11-specific), and thus
useless. Rip it out, and remove the last dependency on X11 from applauncherd.
pull/1/head
Robin Burchell 12 years ago
parent 71fd46dd80
commit 6ad8d7ac16

@ -5,8 +5,7 @@ Applauncherd is a daemon that helps to launch applications faster by
preloading dynamically linked libraries and caching stuff (MComponentCache). It also saves memory, because all launched
applications share certain resources.
Applauncherd also provides support for a splash screen and fast single
instance launches.
Applauncherd also provides support for fast single instance launches.
Some technical details are explained below.
@ -42,8 +41,8 @@ binary via a socket connection.
The application to be launched via applauncherd should be compiled as a
shared library or a position independent executable (-pie) and it should
always export main(). There's also a "booster" for all applications to
be used with the splash screen. In that case exec() is used.
always export main(). There's also a "booster" for all applications.
In that case exec() is used.
Technical details
==============================

@ -575,7 +575,6 @@ INPUT = mainpage.dox \
limitations.dox \
invokerparameters.dox \
singleinstance.dox \
splash.dox \
dbus.dox \
advancedapplauncherd.dox \
debianpackaging.dox \

@ -8,12 +8,7 @@ even if the application is not a library.
\section eboosterpurpose Purpose of exec booster
Applauncherd allows applications to show a splash screen. For instructions
on showing the splash screen in applications boosted using the other
boosters, see \ref splash "here". If you want to have a splash screen in an
application that cannot be boosted, use the exec booster. Thus, you can use
exec booster for launching a splash screen for any application. You can
also launch non-boosted applications as \ref singleinstance "single-instance"
You can launch non-boosted applications as \ref singleinstance "single-instance"
applications with the exec booster.
\section runebooster Running an application with exec booster

@ -105,10 +105,6 @@ destructors of MeeGo Touch classes executed after application's
main(). This can cause crashes if the application has installed a
custom debug message handler and does not uninstall it before exit.
\section splashlimitations Splash screen
Splash screen functionality needs support from the \c mcompositor window manager.
\section wm_class_value WM_CLASS value
If an application is started with m-booster but it creates its own

@ -7,19 +7,18 @@ applications launch faster and save memory through shared resources and
application type specific initialisations. The \c invoker uses a
socket connection to request application launch, and applications are
forked from the daemon process so that they can share memory with the
daemon (and each other) using copy-on-write. The invoker also
provides application specific splash screen support, and provides a
single instance facility that allows only one instance of an
daemon (and each other) using copy-on-write. The invoker also provides
a single instance facility that allows only one instance of an
application to be running at a time.
The following table shows what services are available for different kinds
of applications.
<table>
<tr><th></th> <th>boosting</th> <th>splash</th> <th>single instance</th></tr>
<tr><td>QML</td> <td>x</td> <td>x</td> <td>x</td></tr>
<tr><td>Qt</td> <td>x(1)</td> <td>x</td> <td>x</td></tr>
<tr><td>other</td> <td>-</td> <td>x</td> <td>x</td></tr>
<tr><th></th> <th>boosting</th> <th>single instance</th></tr>
<tr><td>QML</td> <td>x</td> <td>x</td></tr>
<tr><td>Qt</td> <td>x(1)</td> <td>x</td></tr>
<tr><td>other</td> <td>-</td> <td>x</td></tr>
</table>
(1) Only library preloading.
@ -112,28 +111,17 @@ It is also a good idea to hide any unnecessary symbols in the
application binary to speed up opening it in the booster. For instructions,
see \ref qmlboost "Using the QML booster"
\subsection gettingstartedebooster Splash screen and single instance
\subsection gettingstartedebooster Single instance
The \c invoker can be used to get a splash screen for the application
and to implement single instance behaviour. If the \a exec \a booster
is used, no modifications to the application source code are needed.
For more details, see \ref eboost "Using the exec booster" and
\ref splash "Enabling a splash screen for an application".
Note that the \a exec booster facilitates the use of the splash
screen and single instance. If you need to reduce application startup
time significantly, use other boosters instead.
Simply specify the name of the splash image on the invoker command line as
follows.
The \c invoker can be used to implement single instance behaviour.
If the \a exec \a booster is used, no modifications to the application
are needed. For more details, see \ref eboost "Using the exec booster".
Note that the \a exec booster facilitates single instance launching.
If you need to reduce application startup time significantly, use
other boosters instead.
\code
invoker --type=e --splash=/usr/share/images/myAppSplash.jpg /usr/bin/myApp
\endcode
To request single instance behaviour, use the following command line option:
\code
invoker --type=e --single-instance /usr/bin/myApp
invoker --type=e /usr/bin/myApp
\endcode
This causes \c invoker to look for a running instance of the application using a
@ -142,13 +130,6 @@ it is brought to the foreground instead of launching a new instance of the
application. See \ref singleinstance
"Enabling single instance support for an application" for more information.
The options can also be combined, in which case the splash screen is
only shown when a new instance of the application is started:
\code
invoker --type=e --single-instance --splash=/usr/share/images/myAppSplash.jpg /usr/bin/myApp
\endcode
\section reference Further information
- How to enable boosted startup for different types of applications:
@ -156,8 +137,6 @@ invoker --type=e --single-instance --splash=/usr/share/images/myAppSplash.jpg /u
- \subpage qtboost "Using the Qt booster"
- \subpage eboost "Using the exec booster"
- \subpage splash "Enabling a splash screen for an application"
- \subpage singleinstance "Enabling single instance support for an application"
\section tipsntricks Tips and tricks

@ -146,13 +146,12 @@ application to use the invoker command.
\section qmlboostfinishingtouch 5. Finishing touches
The invoker can also provide single instance behaviour and a splash
screen for your application as follows. For more details, see
\ref singleinstance "Enabling single instance support for an application"
and \ref splash "Enabling a splash screen for an application".
The invoker can also provide single instance behaviour for your application as
follows. For more details, see
\ref singleinstance "Enabling single instance support for an application".
\code
/usr/bin/invoker --single-instance --splash=/usr/share/myApp/splash.jpg --type=d /usr/bin/myApp
/usr/bin/invoker --single-instance --type=d /usr/bin/myApp
\endcode
*/

@ -77,13 +77,12 @@ invoker --type=q /usr/bin/myApp
\section qtboostfinishingtouch 4. Finishing touches
The invoker can also provide single instance behaviour and a splash
screen for your application as follows. For more details, see
\ref singleinstance "Enabling single instance support for an application"
and \ref splash "Enabling a splash screen for an application."
The invoker can also provide single instance behaviour for your application
as follows. For more details, see
\ref singleinstance "Enabling single instance support for an application".
\code
/usr/bin/invoker --single-instance --splash=/usr/share/myApp/splash.jpg --type=q /usr/bin/myApp
/usr/bin/invoker --single-instance --type=q /usr/bin/myApp
\endcode
*/

@ -1,133 +0,0 @@
/*! \page splash Enabling a splash screen for an application
\section splashsec Enabling a splash screen
Applauncherd allows an application to show a splash screen if the
mcompositor (the MeeGo 1.2 Harmattan window manager) is running.
The splash screen is not shown by default. If an application wants it
to be shown, it must pass --splash, and optionally --splash-landscape
arguments to the invoker.
System default splash images can be obtained by giving \c default or
\c default-landscape in place of image file names.
For instance, the following shows the splash screen with splash.jpg
as its content when the device is in the portrait orientation:
\verbatim
/usr/bin/invoker --splash=/usr/share/application_name/splash.jpg --splash-landscape=/usr/share/application_name/splash-l.jpg --type=d /usr/bin/application_name
\endverbatim
Otherwise splash-l.jpg is shown. If only --splash is given, that
image is shown in both orientations.
The dimensions of both portrait and landscape images should be the same
&lt;screen width&gt; X &lt;screen height&gt;; it means that mcompositor
does not rotate the splash image, it should be drawn rotated.
Invoker passes the splash request to the booster. The booster sends
the splash request to the window manager by setting a window property
to window manager's window.
If the filenames do not include absolute paths, the window manager
looks for the files from a default location.
The file should be in a format recognised by QPixmap, preferably JPEG
as it is fast to load. Splash screen is always scaled to fit the full
screen, hiding the status bar. Thus, the recommended size for the screen
is 854 x 480 pixels. However, the figure is displayed even if the size is
different.
Create a splash screen that resembles as much as possible the window that is
shown when your application is launched. For instance, the splash screen
can have the same background colour and toolbar as the application window.
If the application window displays the status area, we recommend adding a
black box with the same size to the splash screen of your application.
\subsection splashndbus Splash and D-Bus interaction
If you want to invoke the application through D-Bus as well as from
the application grid, follow the instructions in this section. This
also applies to single instance behaviour provided by \c MApplication,
so you may be using D-Bus even if there is no D-Bus related code
in your application.
If splash is not used, the \c Exec line in the application's \c
.desktop file may contain the invoker command line for starting the
application. One of the first things that D-Bus enabled applications
do is to register a service with the session D-Bus, which fails if
another instance of the application is already running. In this case,
an \c MApplication based application by default first calls the \c
launch() D-Bus method of the existing application instance and then
exits. The end result is that the existing instance is brought to the
foreground and there is just one instance of the application running.
This changes when the \c --splash option is used in an invoker command
in the \c Exec line of the \c .desktop file. When the application is
started from the grid and there is already an instance of the
application running, the following sequence of events takes place:
\li The path to the splash image and the pid of the new application
instance are passed to the compositor.
\li The application's \c main() is called and the application starts to execute
\li The compositor shows the splash image and starts to wait for the
application with the specified pid to map a window.
\li The freshly started application attempts to register the D-Bus service,
fails, calls the \c launch() D-Bus method of the existing instance, and exits.
\li The window of the already running application instance is mapped.
\li The compositor ignores this window, because it has a different pid
from the one specified in the splash request.
\li The compositor finally gives up waiting for the specified pid to
map a window, and fades out the splash screen, revealing the
application window.
\subsection splashndbusdeploy Deployment with splash and D-Bus on Harmattan
There are two ways to solve the D-Bus related problem described in the
previous section. Firstly, you can use the single instance support of
the invoker, and, secondly, you can use a D-Bus service in the
\c .desktop file. The following examples demonstrate how to do this with
the \c helloworld application.
In the first approach, there is an \c Exec line with \c invoker
command in both the \c .desktop file and the \c .service file. Both
lines use both the \c --single-instance flag and the \c --splash
flag:
\code
[Desktop Entry]
Type=Application
Name=Helloworld
Icon=icon-l-helloworld
Exec=/usr/bin/invoker --single-instance --splash /usr/share/helloworld/helloworld-splash.jpg --type=d /usr/bin/helloworld
\endcode
\code
[D-BUS Service]
Name=com.nokia.helloworld
Exec=/usr/bin/invoker --single-instance --splash /usr/share/helloworld/helloworld-splash.jpg --type=d /usr/bin/helloworld
\endcode
In the second approach, the \c .desktop file specifies the D-Bus
service, and the invoker command is in the \c Exec line of the \c
.service file. In this case there is no need for the \c
--single-instance flag. A minor problem is that the \c Exec line is
required even if it is not used.
\code
[Desktop Entry]
Type=Application
Name=Helloworld
Icon=icon-l-helloworld
Exec=/path/not/used
X-Maemo-Service=com.nokia.helloworld
\endcode
\code
[D-BUS Service]
Name=com.nokia.helloworld
Exec=/usr/bin/invoker --splash /usr/share/helloworld/helloworld-splash.jpg --type=d /usr/bin/helloworld
\endcode
*/

@ -19,14 +19,7 @@ Source100: mapplauncherd.yaml
Requires: systemd-user-session-targets
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xtst)
BuildRequires: pkgconfig(xextproto)
BuildRequires: pkgconfig(xi)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(QtCore)
BuildRequires: pkgconfig(QtTest)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: cmake
BuildRequires: python

@ -12,15 +12,7 @@ Description: |
application startup time and share memory. Provides also
functionality to launch applications as single instances.
PkgConfigBR:
- x11
- xtst
- xextproto
- xi
- xext
- systemd
# For tests only
- QtCore
- QtTest
- dbus-1
PkgBR:
- cmake

@ -30,9 +30,9 @@ const uint32_t INVOKER_MSG_MAGIC_OPTION_WAIT = 0x00000001;
const uint32_t INVOKER_MSG_MAGIC_OPTION_DLOPEN_GLOBAL = 0x00000002;
const uint32_t INVOKER_MSG_MAGIC_OPTION_DLOPEN_DEEP = 0x00000004;
const uint32_t INVOKER_MSG_MAGIC_OPTION_SINGLE_INSTANCE = 0x00000008;
const uint32_t INVOKER_MSG_MAGIC_OPTION_SPLASH_SCREEN = 0x00000010;
/* 0x00000010 was INVOKER_MSG_MAGIC_OPTION_SPLASH_SCREEN */
const uint32_t INVOKER_MSG_MAGIC_OPTION_OOM_ADJ_DISABLE = 0x00000020;
const uint32_t INVOKER_MSG_MAGIC_OPTION_LANDSCAPE_SPLASH_SCREEN = 0x00000040;
/* 0x00000040 was INVOKER_MSG_MAGIC_OPTION_LANDSCAPE_SPLASH_SCREEN */
const uint32_t INVOKER_MSG_MASK = 0xffff0000;

@ -278,18 +278,6 @@ static void invoker_send_name(int fd, char *name)
invoke_send_str(fd, name);
}
static void invoker_send_splash_file(int fd, char *filename)
{
invoke_send_msg(fd, INVOKER_MSG_SPLASH);
invoke_send_str(fd, filename);
}
static void invoker_send_landscape_splash_file(int fd, char *filename)
{
invoke_send_msg(fd, INVOKER_MSG_LANDSCAPE_SPLASH);
invoke_send_str(fd, filename);
}
static void invoker_send_exec(int fd, char *exec)
{
invoke_send_msg(fd, INVOKER_MSG_EXEC);
@ -405,8 +393,7 @@ static void usage(int status)
"launch anything. Possible values for TYPE:\n"
" q (or qt) Launch a Qt application.\n"
" d Launch a Qt Declarative (QML) application.\n"
" e Launch any application, even if it's not a library.\n"
" Can be used if only splash screen is wanted.\n\n"
" e Launch any application, even if it's not a library.\n\n"
"Options:\n"
" -d, --delay SECS After invoking sleep for SECS seconds\n"
" (default %d).\n"
@ -420,10 +407,6 @@ static void usage(int status)
" -s, --single-instance Launch the application as a single instance.\n"
" The existing application window will be activated\n"
" if already launched.\n"
" -S, --splash FILE Show splash screen from the FILE.\n"
" -L, --splash-landscape LANDSCAPE-FILE\n"
" Show splash screen from the LANDSCAPE-FILE\n"
" in case the device is in landscape orientation.\n"
" -o, --daemon-mode Notify invoker that the launched process is a daemon.\n"
" This resets the oom_adj of the process.\n"
" -T, --test-mode Invoker test mode. Also control file in root home should be in place.\n"
@ -551,8 +534,7 @@ static int wait_for_launched_process_to_exit(int socket_fd, bool wait_term)
// "normal" invoke through a socket connection
static int invoke_remote(int socket_fd, int prog_argc, char **prog_argv, char *prog_name,
uint32_t magic_options, bool wait_term, unsigned int respawn_delay,
char *splash_file, char *landscape_splash_file)
uint32_t magic_options, bool wait_term, unsigned int respawn_delay)
{
// Get process priority
errno = 0;
@ -571,10 +553,6 @@ static int invoke_remote(int socket_fd, int prog_argc, char **prog_argv, char *p
invoker_send_prio(socket_fd, prog_prio);
invoker_send_delay(socket_fd, respawn_delay);
invoker_send_ids(socket_fd, getuid(), getgid());
if (( magic_options & INVOKER_MSG_MAGIC_OPTION_SPLASH_SCREEN ) != 0)
invoker_send_splash_file(socket_fd, splash_file);
if (( magic_options & INVOKER_MSG_MAGIC_OPTION_LANDSCAPE_SPLASH_SCREEN ) != 0)
invoker_send_landscape_splash_file(socket_fd, landscape_splash_file);
invoker_send_io(socket_fd);
invoker_send_env(socket_fd);
invoker_send_end(socket_fd);
@ -621,7 +599,7 @@ static void invoke_fallback(char **prog_argv, char *prog_name, bool wait_term)
// Invokes the given application
static int invoke(int prog_argc, char **prog_argv, char *prog_name,
const char *app_type, uint32_t magic_options, bool wait_term, unsigned int respawn_delay,
char *splash_file, char *landscape_splash_file, bool test_mode)
bool test_mode)
{
int status = 0;
if (prog_name && prog_argv)
@ -644,8 +622,7 @@ static int invoke(int prog_argc, char **prog_argv, char *prog_name,
else
{
status = invoke_remote(fd, prog_argc, prog_argv, prog_name,
magic_options, wait_term, respawn_delay,
splash_file, landscape_splash_file);
magic_options, wait_term, respawn_delay);
close(fd);
}
}
@ -663,8 +640,6 @@ int main(int argc, char *argv[])
unsigned int respawn_delay = RESPAWN_DELAY;
char **prog_argv = NULL;
char *prog_name = NULL;
char *splash_file = NULL;
char *landscape_splash_file = NULL;
struct stat file_stat;
bool test_mode = false;
@ -754,13 +729,8 @@ int main(int argc, char *argv[])
break;
case 'S':
magic_options |= INVOKER_MSG_MAGIC_OPTION_SPLASH_SCREEN;
splash_file = optarg;
break;
case 'L':
magic_options |= INVOKER_MSG_MAGIC_OPTION_LANDSCAPE_SPLASH_SCREEN;
landscape_splash_file = optarg;
// Removed splash support. Ignore.
break;
case '?':
@ -821,7 +791,7 @@ int main(int argc, char *argv[])
// Send commands to the launcher daemon
info("Invoking execution: '%s'\n", prog_name);
int ret_val = invoke(prog_argc, prog_argv, prog_name, app_type, magic_options, wait_term, respawn_delay, splash_file, landscape_splash_file, test_mode);
int ret_val = invoke(prog_argc, prog_argv, prog_name, app_type, magic_options, wait_term, respawn_delay, test_mode);
// Sleep for delay before exiting
if (delay)

@ -2,11 +2,6 @@ set(COMMON ${CMAKE_HOME_DIRECTORY}/src/common)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${COMMON})
# Find X11
include(FindPkgConfig)
pkg_check_modules(X11 x11 REQUIRED)
add_definitions(-DUSE_X11)
# Hide all symbols except the ones explicitly exported in the code (like main())
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
@ -19,7 +14,7 @@ set(HEADERS appdata.h booster.h connection.h daemon.h logger.h launcherlib.h
# Set libraries to be linked. Shared libraries to be preloaded are not linked in anymore,
# but dlopen():ed and listed in src/launcher/preload.h instead.
link_libraries(${LIBDL} ${X11_LIBRARIES} "-L/lib -lsystemd-daemon")
link_libraries(${LIBDL} "-L/lib -lsystemd-daemon")
# Set executable
add_library(applauncherd MODULE ${SRC} ${MOC_SRC})

@ -32,9 +32,7 @@ AppData::AppData() :
m_entry(NULL),
m_ioDescriptors(),
m_gid(0),
m_uid(0),
m_splashFileName(""),
m_landscapeSplashFileName("")
m_uid(0)
{}
void AppData::setOptions(uint32_t newOptions)
@ -107,26 +105,6 @@ const string & AppData::fileName() const
return m_fileName;
}
void AppData::setSplashFileName(const string & fileName)
{
m_splashFileName = fileName;
}
const string & AppData::splashFileName() const
{
return m_splashFileName;
}
void AppData::setLandscapeSplashFileName(const string & fileName)
{
m_landscapeSplashFileName = fileName;
}
const string & AppData::landscapeSplashFileName() const
{
return m_landscapeSplashFileName;
}
void AppData::setPriority(int newPriority)
{
m_prio = newPriority;

@ -86,18 +86,6 @@ public:
//! Return file name
const string & fileName() const;
//! Set file name of the image shown as splash screen
void setSplashFileName(const string & fileName);
//! Return file name of the image shown as splash screen
const string & splashFileName() const;
//! Set file name of the image shown as landscape splash screen
void setLandscapeSplashFileName(const string & fileName);
//! Return file name of the image shown as landscape splash screen
const string & landscapeSplashFileName() const;
//! Set priority
void setPriority(int priority);
@ -147,8 +135,6 @@ private:
vector<int> m_ioDescriptors;
gid_t m_gid;
uid_t m_uid;
string m_splashFileName;
string m_landscapeSplashFileName;
};
#endif // APPDATA_H

@ -37,12 +37,6 @@
#include <stdexcept>
#include <syslog.h>
#ifdef USE_X11
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#endif //USE_X11
#include <sys/types.h>
#include <sys/socket.h>
#include <grp.h>
@ -338,93 +332,6 @@ void Booster::renameProcess(int parentArgc, char** parentArgv,
}
}
void Booster::requestSplash(const int pid, const std::string &wmclass,
const std::string &portraitSplash, const std::string &landscapeSplash,
const std::string &pixmapId)
{
#ifdef USE_X11
std::stringstream st;
st << pid;
std::string pidStr = st.str();
// set error handler for all Xlib calls
XErrorHandler oldHandler = XSetErrorHandler(Booster::handleXError);
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);
// Check not only return value but also make sure
// that property was found so pointer isn't NULL
if ((retval == Success) && (prop != NULL))
{
// 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);
XChangeProperty(dpy, compositorWindow, splashPropertyAtom, XA_STRING,
8, PropModeReplace, (unsigned char*) data, len);
// Without flushing, the change seems to loiter in X's queue
XFlush(dpy);
delete[] data;
XFree(prop);
}
// close connection to X server
XCloseDisplay(dpy);
XSetErrorHandler(oldHandler);
}
#else //USE_X11
// prevent compilation warnings
(void) pid;
(void) wmclass;
(void) portraitSplash;
(void) landscapeSplash;
(void) pixmapId;
#endif //USE_X11
}
#ifdef USE_X11
int Booster::handleXError(Display *, XErrorEvent *)
{
return 0;
}
#endif //USE_X11
void Booster::setEnvironmentBeforeLaunch()
{
// Possibly restore process priority
@ -453,25 +360,6 @@ void Booster::setEnvironmentBeforeLaunch()
if (!m_appData->disableOutOfMemAdj())
resetOomAdj();
// Request splash screen from mcompositor if needed
if (m_appData->splashFileName().length() > 0 || m_appData->landscapeSplashFileName().length() > 0)
{
// Construct WM_CLASS from the app absolute path
std::string wmclass(m_appData->appName());
size_t pos = wmclass.rfind('/');
wmclass.erase(0, pos + 1);
wmclass[0] = toupper(wmclass[0]);
// Communicate splash data to compositor
requestSplash(getpid(), wmclass,
m_appData->splashFileName(),
m_appData->landscapeSplashFileName(),
// Compositor can also show an X pixmap as splash,
// but this feature is currently not used.
std::string(""));
}
// Make sure that boosted application can dump core. This must be
// done after set[ug]id().
prctl(PR_SET_DUMPABLE, 1);

@ -29,10 +29,6 @@ using std::string;
#include "appdata.h"
#ifdef USE_X11
#include <X11/Xlib.h>
#endif
class Connection;
class SocketManager;
class SingleInstance;
@ -126,12 +122,6 @@ public:
//! Return true, if in boot mode.
bool bootMode() const;
#ifdef USE_X11
//! Error handler for Xlib calls
static int handleXError(Display *display, XErrorEvent *event);
#endif
protected:
/*!
@ -163,26 +153,6 @@ protected:
*/
virtual bool receiveDataFromInvoker(int socketFd);
/*!
* \brief Request splash from mcompositor
* Sets a property in the mcompositor window so that the compositor
* knows to present a splash screen. The paths to the splash image
* can be either absolute or relative. If they are relative, the
* compositor uses a default prefix to turn them into absolute
* paths. The splash screen content can also come from a pixmap in
* the X server.
*
* \param pid The pid of the launched application
* \param wmclass The wmclass of the launched application
* \param portraitSplash Path to the portrait mode splash image
* \param landscapeSplash Path to the landscape mode splash image
* \param pixmapId A pixmap id to be used as the splash screen content
*/
void requestSplash(const int pid, const string &wmclass,
const string &portraitSplash, const string &landscapeSplash,
const string &pixmapId);
/*! This method is called just before call boosted application's
* main function. Empty by default but some booster specific
* initializations can be done here.

@ -35,8 +35,6 @@ Connection::Connection(int socketFd, bool testMode) :
m_fd(-1),
m_curSocket(socketFd),
m_fileName(""),
m_splashFileName(""),
m_landscapeSplashFileName(""),
m_argc(0),
m_argv(NULL),
m_priority(0),
@ -260,28 +258,6 @@ bool Connection::receiveExec()
return true;
}
bool Connection::receiveSplash()
{
const char* filename = recvStr();
if (!filename)
return false;
m_splashFileName = filename;
delete [] filename;
return true;
}
bool Connection::receiveLandscapeSplash()
{
const char* filename = recvStr();
if (!filename)
return false;
m_landscapeSplashFileName = filename;
delete [] filename;
return true;
}
bool Connection::receivePriority()
{
recvMsg(&m_priority);
@ -491,12 +467,12 @@ bool Connection::receiveActions()
break;
case INVOKER_MSG_SPLASH:
receiveSplash();
break;
Logger::logError("Connection: received a now-unsupported MSG_SPLASH\n");
return false;
case INVOKER_MSG_LANDSCAPE_SPLASH:
receiveLandscapeSplash();
break;
Logger::logError("Connection: received a now-unsupported MSG_LANDSCAPE_SPLASH\n");
return false;
case INVOKER_MSG_END:
sendMsg(INVOKER_MSG_ACK);
@ -539,8 +515,6 @@ bool Connection::receiveApplicationData(AppData* appData)
appData->setDelay(m_delay);
appData->setArgc(m_argc);
appData->setArgv(m_argv);
appData->setSplashFileName(m_splashFileName);
appData->setLandscapeSplashFileName(m_landscapeSplashFileName);
appData->setIODescriptors(vector<int>(m_io, m_io + IO_DESCRIPTOR_COUNT));
appData->setIDs(m_uid, m_gid);
}

@ -129,12 +129,6 @@ private:
//! Receive booster respawn delay
bool receiveDelay();
//! Receive filename used as splash screen image
bool receiveSplash();
//! Receive filename used as landscape splash screen image
bool receiveLandscapeSplash();
//! Send process pid
bool sendPid(pid_t pid);
@ -157,8 +151,6 @@ private:
int m_curSocket;
string m_fileName;
string m_splashFileName;
string m_landscapeSplashFileName;
uint32_t m_argc;
const char ** m_argv;
int m_io[IO_DESCRIPTOR_COUNT];

Loading…
Cancel
Save