Shading fixes. This should also take care of #91615.
BUG: 91615 svn path=/trunk/kdebase/kwin/; revision=367240
This commit is contained in:
parent
10b49ee543
commit
bb9b3a94c6
4 changed files with 26 additions and 26 deletions
|
@ -177,6 +177,7 @@ void Client::releaseWindow( bool on_shutdown )
|
||||||
if (moveResizeMode)
|
if (moveResizeMode)
|
||||||
leaveMoveResize();
|
leaveMoveResize();
|
||||||
finishWindowRules();
|
finishWindowRules();
|
||||||
|
++block_geometry;
|
||||||
setModal( false ); // otherwise its mainwindow wouldn't get focus
|
setModal( false ); // otherwise its mainwindow wouldn't get focus
|
||||||
hidden = true; // so that it's not considered visible anymore (can't use hideClient(), it would set flags)
|
hidden = true; // so that it's not considered visible anymore (can't use hideClient(), it would set flags)
|
||||||
if( !on_shutdown )
|
if( !on_shutdown )
|
||||||
|
@ -215,6 +216,7 @@ void Client::releaseWindow( bool on_shutdown )
|
||||||
wrapper = None;
|
wrapper = None;
|
||||||
XDestroyWindow( qt_xdisplay(), frame );
|
XDestroyWindow( qt_xdisplay(), frame );
|
||||||
frame = None;
|
frame = None;
|
||||||
|
--block_geometry;
|
||||||
deleteClient( this, Allowed );
|
deleteClient( this, Allowed );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
client.h
1
client.h
|
@ -356,6 +356,7 @@ class Client : public QObject, public KDecorationDefines
|
||||||
void resizeWithChecks( const QSize& s, ForceGeometry_t force = NormalGeometrySet );
|
void resizeWithChecks( const QSize& s, ForceGeometry_t force = NormalGeometrySet );
|
||||||
NETExtendedStrut strut() const;
|
NETExtendedStrut strut() const;
|
||||||
bool hasStrut() const;
|
bool hasStrut() const;
|
||||||
|
int checkShadeGeometry( int w, int h );
|
||||||
|
|
||||||
bool startMoveResize();
|
bool startMoveResize();
|
||||||
void finishMoveResize( bool cancel );
|
void finishMoveResize( bool cancel );
|
||||||
|
|
47
geometry.cpp
47
geometry.cpp
|
@ -1230,7 +1230,7 @@ void Client::getWmNormalHints()
|
||||||
if( isManaged())
|
if( isManaged())
|
||||||
{ // update to match restrictions
|
{ // update to match restrictions
|
||||||
QSize new_size = adjustedSize( size());
|
QSize new_size = adjustedSize( size());
|
||||||
if( new_size != size() && !isShade() && !isFullScreen()) // SHADE
|
if( new_size != size() && !isFullScreen())
|
||||||
resizeWithChecks( new_size );
|
resizeWithChecks( new_size );
|
||||||
}
|
}
|
||||||
updateAllowedActions(); // affects isResizeable()
|
updateAllowedActions(); // affects isResizeable()
|
||||||
|
@ -1395,9 +1395,6 @@ void Client::configureRequest( int value_mask, int rx, int ry, int rw, int rh, i
|
||||||
if ( value_mask & (CWWidth | CWHeight )
|
if ( value_mask & (CWWidth | CWHeight )
|
||||||
&& ! ( value_mask & ( CWX | CWY )) ) // pure resize
|
&& ! ( value_mask & ( CWX | CWY )) ) // pure resize
|
||||||
{
|
{
|
||||||
if ( isShade()) // SELI SHADE
|
|
||||||
setShade( ShadeNone );
|
|
||||||
|
|
||||||
int nw = clientSize().width();
|
int nw = clientSize().width();
|
||||||
int nh = clientSize().height();
|
int nh = clientSize().height();
|
||||||
if ( value_mask & CWWidth )
|
if ( value_mask & CWWidth )
|
||||||
|
@ -1586,19 +1583,12 @@ void Client::setGeometry( int x, int y, int w, int h, ForceGeometry_t force )
|
||||||
{
|
{
|
||||||
if( force == NormalGeometrySet && frame_geometry == QRect( x, y, w, h ))
|
if( force == NormalGeometrySet && frame_geometry == QRect( x, y, w, h ))
|
||||||
return;
|
return;
|
||||||
|
h = checkShadeGeometry( w, h );
|
||||||
frame_geometry = QRect( x, y, w, h );
|
frame_geometry = QRect( x, y, w, h );
|
||||||
if( !isShade())
|
if( !isShade())
|
||||||
client_size = QSize( w - border_left - border_right, h - border_top - border_bottom );
|
client_size = QSize( w - border_left - border_right, h - border_top - border_bottom );
|
||||||
else
|
else
|
||||||
{
|
|
||||||
// check that the frame is not resized to full size when it should be shaded
|
|
||||||
if( !shade_geometry_change && h != border_top + border_bottom )
|
|
||||||
{
|
|
||||||
kdDebug() << "h:" << h << ":t:" << border_top << ":b:" << border_bottom << endl;
|
|
||||||
assert( false );
|
|
||||||
}
|
|
||||||
client_size = QSize( w - border_left - border_right, client_size.height());
|
client_size = QSize( w - border_left - border_right, client_size.height());
|
||||||
}
|
|
||||||
updateWorkareaDiffs();
|
updateWorkareaDiffs();
|
||||||
if( block_geometry == 0 )
|
if( block_geometry == 0 )
|
||||||
{
|
{
|
||||||
|
@ -1631,23 +1621,15 @@ void Client::plainResize( int w, int h, ForceGeometry_t force )
|
||||||
}
|
}
|
||||||
if( force == NormalGeometrySet && frame_geometry.size() == QSize( w, h ))
|
if( force == NormalGeometrySet && frame_geometry.size() == QSize( w, h ))
|
||||||
return;
|
return;
|
||||||
|
h = checkShadeGeometry( w, h );
|
||||||
frame_geometry.setSize( QSize( w, h ));
|
frame_geometry.setSize( QSize( w, h ));
|
||||||
if( !isShade())
|
if( !isShade())
|
||||||
client_size = QSize( w - border_left - border_right, h - border_top - border_bottom );
|
client_size = QSize( w - border_left - border_right, h - border_top - border_bottom );
|
||||||
else
|
else
|
||||||
{
|
|
||||||
// check that the frame is not resized to full size when it should be shaded
|
|
||||||
if( !shade_geometry_change && h != border_top + border_bottom )
|
|
||||||
{
|
|
||||||
kdDebug() << "h:" << h << ":t:" << border_top << ":b:" << border_bottom << endl;
|
|
||||||
assert( false );
|
|
||||||
}
|
|
||||||
client_size = QSize( w - border_left - border_right, client_size.height());
|
client_size = QSize( w - border_left - border_right, client_size.height());
|
||||||
}
|
|
||||||
updateWorkareaDiffs();
|
updateWorkareaDiffs();
|
||||||
if( block_geometry == 0 )
|
if( block_geometry == 0 )
|
||||||
{
|
{
|
||||||
// FRAME tady poradi tak, at neni flicker
|
|
||||||
XResizeWindow( qt_xdisplay(), frameId(), w, h );
|
XResizeWindow( qt_xdisplay(), frameId(), w, h );
|
||||||
resizeDecoration( QSize( w, h ));
|
resizeDecoration( QSize( w, h ));
|
||||||
if( !isShade())
|
if( !isShade())
|
||||||
|
@ -1666,6 +1648,24 @@ void Client::plainResize( int w, int h, ForceGeometry_t force )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// There may be cases when an application requests resizing while shaded,
|
||||||
|
// and even KWin itself may do so somewhere (too many places to check :-/ ).
|
||||||
|
// If the requested geometry doesn't fit shaded geometry, adjust the height
|
||||||
|
// of the requested geometry and return it.
|
||||||
|
int Client::checkShadeGeometry( int w, int h )
|
||||||
|
{
|
||||||
|
// check that the frame is not resized to full size when it should be shaded
|
||||||
|
if( isShade() && !shade_geometry_change && h != border_top + border_bottom )
|
||||||
|
{
|
||||||
|
kdDebug() << "Fixing shaded geometry:" << this << endl;
|
||||||
|
// adjust the client size to match the newly requested geometry
|
||||||
|
client_size = adjustedSize( QSize( w, h ));
|
||||||
|
// checkMaximizeGeometry(); // doesn't work, actual setting of geometry changes this again
|
||||||
|
h = border_top + border_bottom;
|
||||||
|
}
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Reimplemented to inform the client about the new window position.
|
Reimplemented to inform the client about the new window position.
|
||||||
*/
|
*/
|
||||||
|
@ -1720,9 +1720,6 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust )
|
||||||
if( !adjust && max_mode == old_mode )
|
if( !adjust && max_mode == old_mode )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( isShade()) // SELI SHADE
|
|
||||||
setShade( ShadeNone );
|
|
||||||
|
|
||||||
++block_geometry; // TODO GeometryBlocker class?
|
++block_geometry; // TODO GeometryBlocker class?
|
||||||
|
|
||||||
// maximing one way and unmaximizing the other way shouldn't happen
|
// maximing one way and unmaximizing the other way shouldn't happen
|
||||||
|
@ -2225,7 +2222,7 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root )
|
||||||
}
|
}
|
||||||
|
|
||||||
// ShadeHover or ShadeActive, ShadeNormal was already avoided above
|
// ShadeHover or ShadeActive, ShadeNormal was already avoided above
|
||||||
if ( mode != PositionCenter && shade_mode != ShadeNone ) // SHADE
|
if ( mode != PositionCenter && shade_mode != ShadeNone )
|
||||||
setShade( ShadeNone );
|
setShade( ShadeNone );
|
||||||
|
|
||||||
QPoint globalPos( x_root, y_root );
|
QPoint globalPos( x_root, y_root );
|
||||||
|
|
|
@ -372,7 +372,7 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo
|
||||||
case Options::MouseResize:
|
case Options::MouseResize:
|
||||||
case Options::MouseUnrestrictedResize:
|
case Options::MouseUnrestrictedResize:
|
||||||
{
|
{
|
||||||
if (!isResizable() || isShade()) // SHADE
|
if (!isResizable() || isShade())
|
||||||
break;
|
break;
|
||||||
if( moveResizeMode )
|
if( moveResizeMode )
|
||||||
finishMoveResize( false );
|
finishMoveResize( false );
|
||||||
|
|
Loading…
Reference in a new issue