Fixes: NB#269075 - Precached (LibMeegotouch) applications do not set WM_CLASS window atom properly

RevBy: Pertty Kellomäki, Dmitry Rozenshtein
pull/1/head
Alexey Shilov 14 years ago
parent 3e64ed2536
commit a24b68ec71

3
debian/changelog vendored

@ -1,6 +1,7 @@
applauncherd (1.0.10) unstable; urgency=low
applauncherd (1.1.0) unstable; urgency=low
* Changes: Add unit test for Logger - open log twice
* Fixes: NB#269075 - Precached (LibMeegotouch) applications do not set WM_CLASS window atom properly
-- Dmitry Rozenshtein <ext-dmitry.2.rozenshtein@nokia.com> Mon, 5 Sep 2011 13:33:55 +0300

@ -530,6 +530,10 @@ int Booster::launchProcess()
// Load the application and find out the address of main()
void* handle = loadMain();
// make booster specific initializations unless booster is in boot mode
if (!m_bootMode)
preinit();
#ifdef WITH_COVERAGE
__gcov_flush();
#endif

@ -207,6 +207,14 @@ protected:
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.
* Re-implement if needed.
*/
virtual void preinit() {};
//! Set nice value and store the old priority. Return true on success.
bool pushPriority(int nice);
@ -223,6 +231,9 @@ protected:
//! Reset out-of-memory killer adjustment
void resetOomAdj();
//! Data structure representing the application to be invoked
AppData* m_appData;
private:
//! Disable copy-constructor
@ -238,9 +249,6 @@ private:
//! Helper method: load the library and find out address for "main".
void* loadMain();
//! Data structure representing the application to be invoked
AppData* m_appData;
//! Socket connection to invoker
Connection* m_connection;

@ -104,3 +104,17 @@ bool MBooster::receiveDataFromInvoker(int socketFd)
}
}
void MBooster::preinit()
{
QString appName = QFileInfo(m_appData->argv()[0]).fileName();
QString appClass = appName.left(1).toUpper();
if (appName.length() > 1)
appClass += appName.right(appName.length() - 1);
char* app_name = qstrdup(appName.toLatin1().data());
QApplication::setAppName(app_name);
char* app_class = qstrdup(appClass.toLatin1().data());
QApplication::setAppClass(app_class);
}

@ -20,6 +20,9 @@
#ifndef MBOOSTER_H
#define MBOOSTER_H
#include <QApplication>
#include "QFileInfo"
#include "eventhandler.h"
#include "booster.h"
@ -77,6 +80,9 @@ protected:
//! \reimp
virtual bool receiveDataFromInvoker(int socketFd);
//! \reimp
virtual void preinit();
private:
//! Disable copy-constructor

@ -129,16 +129,6 @@ QApplication* MDeclarativeCachePrivate::qApplication(int &argc, char **argv)
if (loadTestabilityEnv || loadTestabilityArg)
testabilityInit();
QString appClass = appName.left(1).toUpper();
if (appName.length() > 1)
appClass += appName.right(appName.length() - 1);
char* app_name = qstrdup(appName.toLatin1().data());
QApplication::setAppName(app_name);
char* app_class = qstrdup(appClass.toLatin1().data());
QApplication::setAppClass(app_class);
#ifdef Q_WS_X11
// reinit WM_COMMAND X11 property
if (qDeclarativeViewInstance)

@ -94,3 +94,19 @@ bool QDeclarativeBooster::receiveDataFromInvoker(int socketFd)
return true;
}
}
void QDeclarativeBooster::preinit()
{
QString appName = QFileInfo(m_appData->argv()[0]).fileName();
QString appClass = appName.left(1).toUpper();
if (appName.length() > 1)
appClass += appName.right(appName.length() - 1);
char* app_name = qstrdup(appName.toLatin1().data());
QApplication::setAppName(app_name);
char* app_class = qstrdup(appClass.toLatin1().data());
QApplication::setAppClass(app_class);
}

@ -20,6 +20,9 @@
#ifndef QDECLARATIVEBOOSTER_H
#define QDECLARATIVEBOOSTER_H
#include <QApplication>
#include "QFileInfo"
#include "eventhandler.h"
#include "booster.h"
@ -70,6 +73,9 @@ protected:
//! \reimp
virtual bool receiveDataFromInvoker(int socketFd);
//! \reimp
virtual void preinit();
private:
//! Disable copy-constructor

@ -30,9 +30,9 @@
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-daemons.py test_app_exits_clean</step>
</case>
<!--<case name="applauncherd__test_launched_app_wm_class_m" type="Functional" description="Test that launched application have correct WM_CLASS Xproperty booster m" timeout="460" level="System" insignificant="true">
<case name="applauncherd__test_launched_app_wm_class_m" type="Functional" description="Test that launched application have correct WM_CLASS Xproperty booster m" timeout="460" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launched_app_wm_class_m</step>
</case>-->
</case>
<case name="applauncherd__test_launched_app_wm_class_d" type="Functional" description="Test that launched application have correct WM_CLASS Xproperty booster d" timeout="460" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launched_app_wm_class_d</step>

@ -842,16 +842,16 @@ class launcher_tests (unittest.TestCase):
Test that launched application have correct WM_CLASS Xproperty booster m
"""
#For booster-m MApplicationWindow from MComponentCache
self._test_launched_app_wm_class_helper("m","fala_wl","-faulty","fala_wl",2)
self._test_launched_app_wm_class_helper("m","fala_wl","-faulty","fala_wl",1)
#For booster-m MApplicationWindow NOT from cache. 3 windows (2 for application + 1 is created by cache but not used)
self._test_launched_app_wm_class_helper("m","fala_ft_hello","-window-not-from-cache","fala_ft_hello",3)
#For booster-m MApplicationWindow NOT from cache. 2 windows (1 for application + 1 is created by cache but not used)
self._test_launched_app_wm_class_helper("m","fala_ft_hello","-window-not-from-cache","fala_ft_hello",2)
#For booster-m multiple MApplicationWindow (3 windows + 1)
self._test_launched_app_wm_class_helper("m","fala_multi-window","","fala_multi-window",4)
#For booster-m multiple MApplicationWindow (2 windows + 1)
self._test_launched_app_wm_class_helper("m","fala_multi-window","","fala_multi-window",3)
#For booster-m multiple MApplicationWindow NOT from cache (3 windows + 1 + 1 created by cache but not used)
self._test_launched_app_wm_class_helper("m","fala_multi-window","-window-not-from-cache","fala_multi-window",5)
#For booster-m multiple MApplicationWindow NOT from cache (2 windows + 1 + 1 created by cache but not used)
self._test_launched_app_wm_class_helper("m","fala_multi-window","-window-not-from-cache","fala_multi-window",4)
def test_launched_app_wm_class_d(self):
"""

Loading…
Cancel
Save