From ecba5c3ea289f1833dc3eb3407df7653c12706c5 Mon Sep 17 00:00:00 2001 From: Matthias Ettrich Date: Thu, 10 Aug 2000 12:13:36 +0000 Subject: [PATCH] yet another weird hack for weird windows (Netscape's Javascript Toplevels). Does anybody have any clue why they always want to hide the titlebar by moving the window to x, -24 ? Can't not be me missinterpreting motif hints, as the same thing happens with MWM. svn path=/trunk/kdebase/kwin/; revision=60467 --- client.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/client.cpp b/client.cpp index 4a6d940883..770c274bd0 100644 --- a/client.cpp +++ b/client.cpp @@ -481,7 +481,7 @@ bool Client::manage( bool isMapped, bool doNotShow ) QRect geom( original_geometry ); bool placementDone = FALSE; - + SessionInfo* session = workspace()->takeSessionInfo( this ); if ( session ) geom.setRect( session->x, session->y, session->width, session->height ); @@ -494,14 +494,14 @@ bool Client::manage( bool isMapped, bool doNotShow ) QRect area = workspace()->clientArea(); if ( (xSizeHint.flags & PPosition) || (xSizeHint.flags & USPosition) ) { placementDone = TRUE; - if ( !area.contains( geom.topLeft() ) ) { + if ( windowType() == NET::Normal && !area.contains( geom.topLeft() ) ) { int tx = geom.x(); int ty = geom.y(); if ( tx >= 0 && tx < area.x() ) tx = area.x(); if ( ty >= 0 && ty < area.y() ) ty = area.y(); - if ( tx > area.right() || ty > area.right() ) + if ( tx > area.right() || ty > area.bottom() ) placementDone = FALSE; // weird, do not trust. else geom.moveTopLeft( QPoint( tx, ty ) ); @@ -867,7 +867,18 @@ bool Client::configureRequest( XConfigureRequestEvent& e ) nx = e.x; if ( e.value_mask & CWY ) ny = e.y; - move( nx - ox, ny - oy ); + QPoint np( nx-ox, ny-oy); + if ( windowType() == NET::Normal ) { + // crap for broken netscape + QRect area = workspace()->clientArea(); + if ( !area.contains( np ) ){ + if ( np.x() < area.x() ) + np.rx() = area.x(); + if ( np.y() < area.y() ) + np.ry() = area.y(); + } + } + move( np ); } if ( e.value_mask & (CWWidth | CWHeight ) ) {