faster abort when another window manager is running
svn path=/trunk/kdebase/kwin/; revision=44291
This commit is contained in:
parent
0df9f29ccd
commit
7375cc7a17
3 changed files with 14 additions and 46 deletions
34
main.cpp
34
main.cpp
|
@ -22,12 +22,6 @@
|
||||||
#include <klocale.h>
|
#include <klocale.h>
|
||||||
|
|
||||||
|
|
||||||
static KCmdLineOptions cmdOptions[] =
|
|
||||||
{
|
|
||||||
{ "+[workspace]", I18N_NOOP("A cryptic command line option"), 0 },
|
|
||||||
{ 0, 0, 0 }
|
|
||||||
};
|
|
||||||
|
|
||||||
Options* options;
|
Options* options;
|
||||||
Atoms* atoms;
|
Atoms* atoms;
|
||||||
|
|
||||||
|
@ -67,27 +61,24 @@ int x11ErrorHandler(Display *d, XErrorEvent *e){
|
||||||
Application::Application( )
|
Application::Application( )
|
||||||
: KApplication( )
|
: KApplication( )
|
||||||
{
|
{
|
||||||
initting = TRUE;
|
initting = TRUE; // startup....
|
||||||
options = new Options;
|
|
||||||
atoms = new Atoms;
|
|
||||||
|
|
||||||
// install X11 error handler
|
// install X11 error handler
|
||||||
XSetErrorHandler( x11ErrorHandler );
|
XSetErrorHandler( x11ErrorHandler );
|
||||||
|
|
||||||
|
// check whether another windowmanager is running
|
||||||
|
XSelectInput(qt_xdisplay(), qt_xrootwin(), SubstructureRedirectMask );
|
||||||
|
syncX(); // trigger error now
|
||||||
|
|
||||||
|
options = new Options;
|
||||||
|
atoms = new Atoms;
|
||||||
|
|
||||||
// create a workspace.
|
// create a workspace.
|
||||||
workspaces += new Workspace();
|
workspaces += new Workspace();
|
||||||
initting = FALSE;
|
|
||||||
|
syncX(); // trigger possible errors, there's still a chance to abort
|
||||||
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
|
|
||||||
if ( args->count() ) {
|
initting = FALSE; // startup done, we are up and running now.
|
||||||
QString s = args->arg(0);
|
|
||||||
int i = s.toInt();
|
|
||||||
workspaces += new Workspace( (WId ) i );
|
|
||||||
}
|
|
||||||
args->clear();
|
|
||||||
|
|
||||||
syncX();
|
|
||||||
initting = FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -172,7 +163,6 @@ int main( int argc, char * argv[] )
|
||||||
aboutData.addAuthor("Daniel M. Duley",0, "mosfet@kde.org");
|
aboutData.addAuthor("Daniel M. Duley",0, "mosfet@kde.org");
|
||||||
|
|
||||||
KCmdLineArgs::init(argc, argv, &aboutData);
|
KCmdLineArgs::init(argc, argv, &aboutData);
|
||||||
KCmdLineArgs::addCmdLineOptions( cmdOptions );
|
|
||||||
|
|
||||||
if (signal(SIGTERM, sighandler) == SIG_IGN)
|
if (signal(SIGTERM, sighandler) == SIG_IGN)
|
||||||
signal(SIGTERM, SIG_IGN);
|
signal(SIGTERM, SIG_IGN);
|
||||||
|
|
|
@ -93,7 +93,7 @@ Client* Workspace::clientFactory( Workspace *ws, WId w )
|
||||||
|
|
||||||
Workspace::Workspace()
|
Workspace::Workspace()
|
||||||
{
|
{
|
||||||
root = qt_xrootwin(); // no MDI for now
|
root = qt_xrootwin();
|
||||||
|
|
||||||
(void) QApplication::desktop(); // trigger creation of desktop widget
|
(void) QApplication::desktop(); // trigger creation of desktop widget
|
||||||
desktop_widget = new QWidget(0, "desktop_widget", Qt::WType_Desktop | Qt::WPaintUnclipped );
|
desktop_widget = new QWidget(0, "desktop_widget", Qt::WType_Desktop | Qt::WPaintUnclipped );
|
||||||
|
@ -130,27 +130,6 @@ Workspace::Workspace()
|
||||||
tab_box = new TabBox( this );
|
tab_box = new TabBox( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
Workspace::Workspace( WId rootwin )
|
|
||||||
{
|
|
||||||
qDebug("create MDI workspace for %d", rootwin );
|
|
||||||
root = rootwin;
|
|
||||||
|
|
||||||
// select windowmanager privileges
|
|
||||||
XSelectInput(qt_xdisplay(), root,
|
|
||||||
KeyPressMask |
|
|
||||||
PropertyChangeMask |
|
|
||||||
ColormapChangeMask |
|
|
||||||
SubstructureRedirectMask |
|
|
||||||
SubstructureNotifyMask
|
|
||||||
);
|
|
||||||
|
|
||||||
control_grab = FALSE;
|
|
||||||
tab_grab = FALSE;
|
|
||||||
tab_box = 0;
|
|
||||||
keys = 0;
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Workspace::init()
|
void Workspace::init()
|
||||||
{
|
{
|
||||||
tab_box = 0;
|
tab_box = 0;
|
||||||
|
|
|
@ -48,7 +48,6 @@ class Workspace : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Workspace();
|
Workspace();
|
||||||
Workspace( WId rootwin );
|
|
||||||
virtual ~Workspace();
|
virtual ~Workspace();
|
||||||
|
|
||||||
virtual bool workspaceEvent( XEvent * );
|
virtual bool workspaceEvent( XEvent * );
|
||||||
|
@ -144,7 +143,7 @@ protected:
|
||||||
bool keyRelease( XKeyEvent key );
|
bool keyRelease( XKeyEvent key );
|
||||||
bool keyPressMouseEmulation( XKeyEvent key );
|
bool keyPressMouseEmulation( XKeyEvent key );
|
||||||
bool clientMessage( XClientMessageEvent msg );
|
bool clientMessage( XClientMessageEvent msg );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init();
|
void init();
|
||||||
KGlobalAccel *keys;
|
KGlobalAccel *keys;
|
||||||
|
|
Loading…
Reference in a new issue