Don't miss synhetic UnmapNotify from XWithdrawWindow() sent

to the root window.

svn path=/trunk/kdebase/kwin/; revision=254877
This commit is contained in:
Luboš Luňák 2003-09-29 14:39:02 +00:00
parent 423d9c1066
commit 0050bd7155

View file

@ -239,6 +239,13 @@ bool Workspace::workspaceEvent( XEvent * e )
case UnmapNotify: case UnmapNotify:
{ {
// get also synthetic UnmapNotify from XWithdrawWindow(),
// xunmap.window is different from xany.window
if( Client* c = findClient( WindowMatchPredicate( e->xunmap.window )))
{
c->windowEvent( e );
return true;
}
// check for system tray windows // check for system tray windows
if ( removeSystemTrayWin( e->xunmap.window ) ) if ( removeSystemTrayWin( e->xunmap.window ) )
{ {
@ -285,6 +292,7 @@ bool Workspace::workspaceEvent( XEvent * e )
{ {
updateXTime(); updateXTime();
// e->xmaprequest.window is different from e->xany.window
Client* c = findClient( WindowMatchPredicate( e->xmaprequest.window )); Client* c = findClient( WindowMatchPredicate( e->xmaprequest.window ));
if ( !c ) if ( !c )
{ {
@ -323,20 +331,21 @@ bool Workspace::workspaceEvent( XEvent * e )
QWhatsThis::leaveWhatsThisMode(); QWhatsThis::leaveWhatsThisMode();
} }
if (electric_have_borders && if (electric_have_borders &&
(e->xcrossing.window == electric_top_border || (e->xcrossing.window == electric_top_border ||
e->xcrossing.window == electric_left_border || e->xcrossing.window == electric_left_border ||
e->xcrossing.window == electric_bottom_border || e->xcrossing.window == electric_bottom_border ||
e->xcrossing.window == electric_right_border)) e->xcrossing.window == electric_right_border))
{ {
// the user entered an electric border // the user entered an electric border
electricBorder(e); electricBorder(e);
} }
break; break;
case LeaveNotify: case LeaveNotify:
{ {
if ( !QWhatsThis::inWhatsThisMode() ) if ( !QWhatsThis::inWhatsThisMode() )
break; break;
// TODO is this cliente ever found, given that client events are searched above?
Client* c = findClient( FrameIdMatchPredicate( e->xcrossing.window )); Client* c = findClient( FrameIdMatchPredicate( e->xcrossing.window ));
if ( c && e->xcrossing.detail != NotifyInferior ) if ( c && e->xcrossing.detail != NotifyInferior )
QWhatsThis::leaveWhatsThisMode(); QWhatsThis::leaveWhatsThisMode();
@ -375,12 +384,12 @@ bool Workspace::workspaceEvent( XEvent * e )
return true; // always eat these, they would tell Qt that KWin is the active app return true; // always eat these, they would tell Qt that KWin is the active app
default: default:
if ( e->type == Shape::shapeEvent() ) if ( e->type == Shape::shapeEvent() )
{ {
Client* c = findClient( WindowMatchPredicate( ((XShapeEvent *)e)->window )); Client* c = findClient( WindowMatchPredicate( ((XShapeEvent *)e)->window ));
if ( c ) if ( c )
c->updateShape(); c->updateShape();
} }
break; break;
} }
return FALSE; return FALSE;
} }