summaryrefslogtreecommitdiff
path: root/library/qpeapplication.cpp
Side-by-side diff
Diffstat (limited to 'library/qpeapplication.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 852671a..b26933b 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -94,24 +94,25 @@ class QPEApplicationData
public:
QPEApplicationData() : presstimer( 0 ), presswidget( 0 ), kbgrabber( 0 ),
rightpressed( FALSE ), kbregrab( FALSE ), notbusysent( FALSE ), preloaded( FALSE ),
forceshow( FALSE ), nomaximize( FALSE ), keep_running( TRUE ), qpe_main_widget( 0 )
{
qcopq.setAutoDelete( TRUE );
}
int presstimer;
QWidget* presswidget;
int kbgrabber;
+ QString kbgrabber_appname;
QPoint presspos;
bool rightpressed : 1;
bool kbregrab : 1;
bool notbusysent : 1;
bool preloaded : 1;
bool forceshow : 1;
bool nomaximize : 1;
bool keep_running : 1;
QString appName;
struct QCopRec
@@ -1055,24 +1056,26 @@ void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data
if ( type() == GuiServer )
restart();
}
else if ( msg == "grabKeyboard(QString)" ) {
QString who;
stream >> who;
if ( who.isEmpty() )
d->kbgrabber = 0;
else if ( who != d->appName )
d->kbgrabber = 1;
else
d->kbgrabber = 2;
+
+ d-> kbgrabber_appname = who;
}
else if ( msg == "language(QString)" ) {
if ( type() == GuiServer ) {
QString l;
stream >> l;
QString cl = getenv( "LANG" );
if ( cl != l ) {
if ( l.isNull() )
unsetenv( "LANG" );
else
setenv( "LANG", l.latin1(), 1 );
restart();
@@ -1615,24 +1618,32 @@ void QPEApplication::removeSenderFromStylusDict()
if ( d->presswidget == sender() )
d->presswidget = 0;
}
/*!
\internal
*/
bool QPEApplication::keyboardGrabbed() const
{
return d->kbgrabber;
}
+/*!
+ \internal
+*/
+QString QPEApplication::keyboardGrabbedBy() const
+{
+ return d->kbgrabber_appname;
+}
+
/*!
Reverses the effect of grabKeyboard(). This is called automatically
on program exit.
*/
void QPEApplication::ungrabKeyboard()
{
QPEApplicationData * d = ( ( QPEApplication* ) qApp ) ->d;
if ( d->kbgrabber == 2 ) {
#ifndef QT_NO_COP
QCopEnvelope e( "QPE/System", "grabKeyboard(QString)" );
e << QString::null;