From b8858a8636d52badfd4680afb6c42b4f86165dfb Mon Sep 17 00:00:00 2001 From: Matthias Ettrich Date: Sun, 7 Nov 1999 04:43:59 +0000 Subject: [PATCH] better configure handling svn path=/trunk/kdebase/kwin/; revision=33076 --- client.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/client.cpp b/client.cpp index 60f621f064..c26adb9fa8 100644 --- a/client.cpp +++ b/client.cpp @@ -81,6 +81,7 @@ static void sendClientMessage(Window w, Atom a, long x){ WindowWrapper::WindowWrapper( WId w, Client *parent, const char* name) : QWidget( parent, name ) { + setBackgroundColor( red ); win = w; setMouseTracking( TRUE ); @@ -142,10 +143,11 @@ QSizePolicy WindowWrapper::sizePolicy() const void WindowWrapper::resizeEvent( QResizeEvent * ) { - if ( win ) + if ( win ) { XMoveResizeWindow( qt_xdisplay(), win, 0, 0, width(), height() ); } +} void WindowWrapper::showEvent( QShowEvent* ) { @@ -330,12 +332,11 @@ void Client::manage( bool isMapped ) setMappingState( NormalState ); if ( isOnDesktop( workspace()->currentDesktop() ) ) { show(); - } + } if ( options->focusPolicyIsReasonable() ) workspace()->requestFocus( this ); - } @@ -515,13 +516,13 @@ bool Client::configureRequest( XConfigureRequestEvent& e ) } if ( e.value_mask & (CWX | CWY ) ) { - int nx = x(); - int ny = y(); + int nx = x() + windowWrapper()->x(); + int ny = y() + windowWrapper()->y(); if ( e.value_mask & CWX ) nx = e.x; if ( e.value_mask & CWY ) ny = e.y; - move( nx, ny ); + move( nx - windowWrapper()->x(), ny - windowWrapper()->y() ); } if ( e.value_mask & (CWWidth | CWHeight ) ) { @@ -1343,8 +1344,9 @@ void Client::setMask( const QRegion & reg) NoBorderClient::NoBorderClient( Workspace *ws, WId w, QWidget *parent=0, const char *name=0 ) : Client( ws, w, parent, name ) { - QGridLayout* g = new QGridLayout( this, 0, 0, 0 ); - g->addWidget( windowWrapper(), 0, 0 ); + setBackgroundColor( yellow ); + QHBoxLayout* h = new QHBoxLayout( this ); + h->addWidget( windowWrapper() ); } NoBorderClient::~NoBorderClient()