From 897e67f79a1b44f101b90724fe96f10f08a3111e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 24 Nov 2003 15:05:50 +0000 Subject: [PATCH] Partially revert the recent xinerama commit - !isMapped == useCursorPos was always true, no need for another argument. svn path=/trunk/kdebase/kwin/; revision=269308 --- client.h | 2 +- events.cpp | 2 +- manage.cpp | 8 ++++++-- workspace.cpp | 4 ++-- workspace.h | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/client.h b/client.h index a9b4e648d7..8bfe029eed 100644 --- a/client.h +++ b/client.h @@ -80,7 +80,7 @@ class Client : public QObject, public KDecorationDefines void windowEvent( XEvent* e ); virtual bool eventFilter( QObject* o, QEvent* e ); - bool manage( Window w, bool isMapped, bool useCursorPos ); + bool manage( Window w, bool isMapped ); void releaseWindow( bool on_shutdown = false ); diff --git a/events.cpp b/events.cpp index 91ee8a4147..18a2a8dd1a 100644 --- a/events.cpp +++ b/events.cpp @@ -318,7 +318,7 @@ bool Workspace::workspaceEvent( XEvent * e ) // if ( e->xmaprequest.parent == root ) { //###TODO store previously destroyed client ids if ( addSystemTrayWin( e->xmaprequest.window ) ) return TRUE; - c = createClient( e->xmaprequest.window, false, options->xineramaPlacementEnabled ); + c = createClient( e->xmaprequest.window, false ); if ( c != NULL && root != qt_xrootwin() ) { // TODO what is this? // TODO may use QWidget::create diff --git a/manage.cpp b/manage.cpp index 8758a65005..87e42c1e08 100644 --- a/manage.cpp +++ b/manage.cpp @@ -33,7 +33,7 @@ namespace KWinInternal reparenting, initial geometry, initial state, placement, etc. Returns false if KWin is not going to manage this window. */ -bool Client::manage( Window w, bool isMapped, bool useCursorPos ) +bool Client::manage( Window w, bool isMapped ) { XWindowAttributes attr; if( !XGetWindowAttributes(qt_xdisplay(), w, &attr)) @@ -181,7 +181,11 @@ bool Client::manage( Window w, bool isMapped, bool useCursorPos ) if ( session ) geom = session->geometry; - QRect area = workspace()->clientArea( PlacementArea, useCursorPos ? QCursor::pos() : geom.center(), desktop()); + QRect area; + if( !isMapped && options->xineramaPlacementEnabled ) + area = workspace()->clientArea( PlacementArea, QCursor::pos(), desktop()); + else + area = workspace()->clientArea( PlacementArea, geom.center(), desktop()); // if it's noborder window, and has size of one screen or the whole desktop geometry, it's fullscreen hack if( ( geom.size() == workspace()->clientArea( FullArea, geom.center(), desktop()).size() diff --git a/workspace.cpp b/workspace.cpp index 242e29e1d4..68e93c15bc 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -403,11 +403,11 @@ Workspace::~Workspace() _self = 0; } -Client* Workspace::createClient( Window w, bool is_mapped, bool use_cursor_pos ) +Client* Workspace::createClient( Window w, bool is_mapped ) { StackingUpdatesBlocker blocker( this ); Client* c = new Client( this ); - if( !c->manage( w, is_mapped, use_cursor_pos )) + if( !c->manage( w, is_mapped )) { Client::deleteClient( c, Allowed ); return NULL; diff --git a/workspace.h b/workspace.h index b24c19c124..544860c8f3 100644 --- a/workspace.h +++ b/workspace.h @@ -346,7 +346,7 @@ class Workspace : public QObject, public KWinInterface, public KDecorationDefine void updateToolWindows( bool also_hide ); // this is the right way to create a new client - Client* createClient( Window w, bool is_mapped, bool use_cursor_pos = false ); + Client* createClient( Window w, bool is_mapped ); void addClient( Client* c, allowed_t ); Window findSpecialEventWindow( XEvent* e );