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>
|
||||
|
||||
|
||||
static KCmdLineOptions cmdOptions[] =
|
||||
{
|
||||
{ "+[workspace]", I18N_NOOP("A cryptic command line option"), 0 },
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
|
||||
Options* options;
|
||||
Atoms* atoms;
|
||||
|
||||
|
@ -67,27 +61,24 @@ int x11ErrorHandler(Display *d, XErrorEvent *e){
|
|||
Application::Application( )
|
||||
: KApplication( )
|
||||
{
|
||||
initting = TRUE;
|
||||
options = new Options;
|
||||
atoms = new Atoms;
|
||||
initting = TRUE; // startup....
|
||||
|
||||
// install X11 error handler
|
||||
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.
|
||||
workspaces += new Workspace();
|
||||
initting = FALSE;
|
||||
|
||||
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
|
||||
if ( args->count() ) {
|
||||
QString s = args->arg(0);
|
||||
int i = s.toInt();
|
||||
workspaces += new Workspace( (WId ) i );
|
||||
}
|
||||
args->clear();
|
||||
|
||||
syncX();
|
||||
initting = FALSE;
|
||||
|
||||
syncX(); // trigger possible errors, there's still a chance to abort
|
||||
|
||||
initting = FALSE; // startup done, we are up and running now.
|
||||
}
|
||||
|
||||
|
||||
|
@ -172,7 +163,6 @@ int main( int argc, char * argv[] )
|
|||
aboutData.addAuthor("Daniel M. Duley",0, "mosfet@kde.org");
|
||||
|
||||
KCmdLineArgs::init(argc, argv, &aboutData);
|
||||
KCmdLineArgs::addCmdLineOptions( cmdOptions );
|
||||
|
||||
if (signal(SIGTERM, sighandler) == SIG_IGN)
|
||||
signal(SIGTERM, SIG_IGN);
|
||||
|
|
|
@ -93,7 +93,7 @@ Client* Workspace::clientFactory( Workspace *ws, WId w )
|
|||
|
||||
Workspace::Workspace()
|
||||
{
|
||||
root = qt_xrootwin(); // no MDI for now
|
||||
root = qt_xrootwin();
|
||||
|
||||
(void) QApplication::desktop(); // trigger creation of desktop widget
|
||||
desktop_widget = new QWidget(0, "desktop_widget", Qt::WType_Desktop | Qt::WPaintUnclipped );
|
||||
|
@ -130,27 +130,6 @@ Workspace::Workspace()
|
|||
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()
|
||||
{
|
||||
tab_box = 0;
|
||||
|
|
|
@ -48,7 +48,6 @@ class Workspace : public QObject
|
|||
Q_OBJECT
|
||||
public:
|
||||
Workspace();
|
||||
Workspace( WId rootwin );
|
||||
virtual ~Workspace();
|
||||
|
||||
virtual bool workspaceEvent( XEvent * );
|
||||
|
@ -144,7 +143,7 @@ protected:
|
|||
bool keyRelease( XKeyEvent key );
|
||||
bool keyPressMouseEmulation( XKeyEvent key );
|
||||
bool clientMessage( XClientMessageEvent msg );
|
||||
|
||||
|
||||
private:
|
||||
void init();
|
||||
KGlobalAccel *keys;
|
||||
|
|
Loading…
Reference in a new issue