better configure handling

svn path=/trunk/kdebase/kwin/; revision=33076
This commit is contained in:
Matthias Ettrich 1999-11-07 04:43:59 +00:00
parent d21739331f
commit b8858a8636

View file

@ -81,6 +81,7 @@ static void sendClientMessage(Window w, Atom a, long x){
WindowWrapper::WindowWrapper( WId w, Client *parent, const char* name) WindowWrapper::WindowWrapper( WId w, Client *parent, const char* name)
: QWidget( parent, name ) : QWidget( parent, name )
{ {
setBackgroundColor( red );
win = w; win = w;
setMouseTracking( TRUE ); setMouseTracking( TRUE );
@ -142,10 +143,11 @@ QSizePolicy WindowWrapper::sizePolicy() const
void WindowWrapper::resizeEvent( QResizeEvent * ) void WindowWrapper::resizeEvent( QResizeEvent * )
{ {
if ( win ) if ( win ) {
XMoveResizeWindow( qt_xdisplay(), win, XMoveResizeWindow( qt_xdisplay(), win,
0, 0, width(), height() ); 0, 0, width(), height() );
} }
}
void WindowWrapper::showEvent( QShowEvent* ) void WindowWrapper::showEvent( QShowEvent* )
{ {
@ -335,7 +337,6 @@ void Client::manage( bool isMapped )
if ( options->focusPolicyIsReasonable() ) if ( options->focusPolicyIsReasonable() )
workspace()->requestFocus( this ); workspace()->requestFocus( this );
} }
@ -515,13 +516,13 @@ bool Client::configureRequest( XConfigureRequestEvent& e )
} }
if ( e.value_mask & (CWX | CWY ) ) { if ( e.value_mask & (CWX | CWY ) ) {
int nx = x(); int nx = x() + windowWrapper()->x();
int ny = y(); int ny = y() + windowWrapper()->y();
if ( e.value_mask & CWX ) if ( e.value_mask & CWX )
nx = e.x; nx = e.x;
if ( e.value_mask & CWY ) if ( e.value_mask & CWY )
ny = e.y; ny = e.y;
move( nx, ny ); move( nx - windowWrapper()->x(), ny - windowWrapper()->y() );
} }
if ( e.value_mask & (CWWidth | CWHeight ) ) { 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 ) NoBorderClient::NoBorderClient( Workspace *ws, WId w, QWidget *parent=0, const char *name=0 )
: Client( ws, w, parent, name ) : Client( ws, w, parent, name )
{ {
QGridLayout* g = new QGridLayout( this, 0, 0, 0 ); setBackgroundColor( yellow );
g->addWidget( windowWrapper(), 0, 0 ); QHBoxLayout* h = new QHBoxLayout( this );
h->addWidget( windowWrapper() );
} }
NoBorderClient::~NoBorderClient() NoBorderClient::~NoBorderClient()