Properly account for decoration padding when calculating mousePosition in window, needed to

decide cursor shape.
BUG: 231844

svn path=/trunk/KDE/kdebase/workspace/; revision=1108844
This commit is contained in:
Hugo Pereira Da Costa 2010-03-29 21:57:05 +00:00
parent b0b69a6b7c
commit 6fe694c38f

View file

@ -1398,6 +1398,8 @@ bool Client::buttonReleaseEvent( Window w, int /*button*/, int state, int x, int
finishMoveResize( false ); finishMoveResize( false );
// mouse position is still relative to old Client position, adjust it // mouse position is still relative to old Client position, adjust it
QPoint mousepos( x_root - x, y_root - y ); QPoint mousepos( x_root - x, y_root - y );
if( w == frameId() )
mousepos += QPoint( padding_left, padding_top );
mode = mousePosition( mousepos ); mode = mousePosition( mousepos );
} }
else if( workspace()->decorationSupportsClientGrouping() ) else if( workspace()->decorationSupportsClientGrouping() )
@ -1481,7 +1483,10 @@ bool Client::motionNotifyEvent( Window w, int /*state*/, int x, int y, int x_roo
return true; // care only about the whole frame return true; // care only about the whole frame
if ( !buttonDown ) if ( !buttonDown )
{ {
Position newmode = mousePosition( QPoint( x, y )); QPoint mousePos( x, y );
if( w == frameId() )
mousePos += QPoint( padding_left, padding_top );
Position newmode = mousePosition( mousePos );
if( newmode != mode ) if( newmode != mode )
{ {
mode = newmode; mode = newmode;