From: David Hedbor
Subject: Qtopia patches (input grabbing and iconify) Ok, here's a patch that adds support for SDL_WM_GrabInput (default state is "ungrabbed") and SDL_WM_IconifyWindow. Also has some other tweaks such as taking additional steps to clean up when exiting (bypassing certain bugs in some versions of Qtopia and/or OPIE) and it also maps Key_F33 to Key_Return (this is the Zaurus 'ok' key). --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40568
This commit is contained in:
parent
879224b6c7
commit
cfca6d1cc7
6 changed files with 283 additions and 120 deletions
|
@ -1,11 +1,32 @@
|
|||
|
||||
/* Include the SDL main definition header */
|
||||
#include "SDL_main.h"
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#ifdef main
|
||||
#undef main
|
||||
#endif
|
||||
#ifdef QWS
|
||||
#include <qpe/qpeapplication.h>
|
||||
#include <qapplication.h>
|
||||
#include <qpe/qpeapplication.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// Workaround for OPIE to remove taskbar icon. Also fixes
|
||||
// some issues in Qtopia where there are left-over qcop files in /tmp/.
|
||||
// I'm guessing this will also clean up the taskbar in the Sharp version
|
||||
// of Qtopia.
|
||||
static inline void cleanupQCop() {
|
||||
QString appname(qApp->argv()[0]);
|
||||
int slash = appname.findRev("/");
|
||||
if(slash != -1) { appname = appname.mid(slash+1); }
|
||||
QString cmd = QPEApplication::qpeDir() + "bin/qcop QPE/System 'closing(QString)' '"+appname+"'";
|
||||
system(cmd.latin1());
|
||||
cmd = "/tmp/qcop-msg-"+appname;
|
||||
unlink(cmd.latin1());
|
||||
}
|
||||
|
||||
static QPEApplication *app;
|
||||
#endif
|
||||
|
||||
extern int SDL_main(int argc, char *argv[]);
|
||||
|
@ -15,9 +36,10 @@ int main(int argc, char *argv[])
|
|||
#ifdef QWS
|
||||
// This initializes the Qtopia application. It needs to be done here
|
||||
// because it parses command line options.
|
||||
QPEApplication app(argc, argv);
|
||||
QWidget dummy;
|
||||
app.showMainWidget(&dummy);
|
||||
app = new QPEApplication(argc, argv);
|
||||
app->showMainWidget(&dummy);
|
||||
atexit(cleanupQCop);
|
||||
#endif
|
||||
// Exit here because if return is used, the application
|
||||
// doesn't seem to quit correctly.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue