Send setActive signal when taking focus in Client::takeFocus

This relates to Bug 2189
Clean up minor formatting issues
pull/2/head
Timothy Pearson 10 years ago
parent 2f7d50c20c
commit 17b142dd64

@ -314,7 +314,7 @@ void Workspace::requestFocus( Client* c, bool force )
void Workspace::takeActivity( Client* c, int flags, bool handled ) void Workspace::takeActivity( Client* c, int flags, bool handled )
{ {
// the 'if( c == active_client ) return;' optimization mustn't be done here // the 'if( c == active_client ) return;' optimization must not be done here
if (!focusChangeEnabled() && ( c != active_client) ) if (!focusChangeEnabled() && ( c != active_client) )
flags &= ~ActivityFocus; flags &= ~ActivityFocus;
@ -353,7 +353,7 @@ void Workspace::takeActivity( Client* c, int flags, bool handled )
{ {
if( c->wantsInput() && ( flags & ActivityFocus )) if( c->wantsInput() && ( flags & ActivityFocus ))
{ {
// client cannot accept focus, but at least the window should be active (window menu, et. al. ) // client cannot accept focus, but at least the window should be active (window menu, et. al. )
c->setActive( true ); c->setActive( true );
focusToNull(); focusToNull();
} }

@ -2200,9 +2200,13 @@ void Client::takeFocus( allowed_t )
if ( rules()->checkAcceptFocus( input )) if ( rules()->checkAcceptFocus( input ))
{ {
XSetInputFocus( tqt_xdisplay(), window(), RevertToPointerRoot, GET_QT_X_TIME() ); XSetInputFocus( tqt_xdisplay(), window(), RevertToPointerRoot, GET_QT_X_TIME() );
// Signal that we took focus!
setActive( true, true );
} }
if ( Ptakefocus ) if ( Ptakefocus )
{
sendClientMessage(window(), atoms->wm_protocols, atoms->wm_take_focus); sendClientMessage(window(), atoms->wm_protocols, atoms->wm_take_focus);
}
workspace()->setShouldGetFocus( this ); workspace()->setShouldGetFocus( this );
} }

@ -1156,7 +1156,6 @@ void KeramikClient::updateMask()
TQRegion r; TQRegion r;
register int w, y = 0; register int w, y = 0;
int nrects;
if ( TQApplication::reverseLayout() ) { if ( TQApplication::reverseLayout() ) {
@ -1168,8 +1167,6 @@ void KeramikClient::updateMask()
r += TQRegion( x + 9, y++, w - 15, 1 ); r += TQRegion( x + 9, y++, w - 15, 1 );
r += TQRegion( x + 7, y++, w - 12, 1 ); r += TQRegion( x + 7, y++, w - 12, 1 );
} else { } else {
nrects = 8;
// Do we have a large titlebar with a retracted caption bubble? // Do we have a large titlebar with a retracted caption bubble?
// (i.e. the style is set to use large caption bubbles, we're // (i.e. the style is set to use large caption bubbles, we're
// not maximized and not active) // not maximized and not active)
@ -1191,15 +1188,12 @@ void KeramikClient::updateMask()
// If the caption bubble is visible and extends above the titlebar // If the caption bubble is visible and extends above the titlebar
if ( largeCaption && captionRect.width() >= 25 ) { if ( largeCaption && captionRect.width() >= 25 ) {
nrects = 11;
register int x = captionRect.left(); register int x = captionRect.left();
w = captionRect.width(); w = captionRect.width();
r += TQRegion( x + 8, y++, w - 19, 1 ); r += TQRegion( x + 8, y++, w - 19, 1 );
r += TQRegion( x + 6, y++, w - 15, 1 ); r += TQRegion( x + 6, y++, w - 15, 1 );
r += TQRegion( x + 5, y++, w - 12, 1 ); r += TQRegion( x + 5, y++, w - 12, 1 );
} else { } else {
nrects = 8;
// Do we have a large titlebar with a retracted caption bubble? // Do we have a large titlebar with a retracted caption bubble?
// (i.e. the style is set to use large caption bubbles, we're // (i.e. the style is set to use large caption bubbles, we're
// not maximized and not active) // not maximized and not active)

@ -518,7 +518,7 @@ bool Client::sameAppWindowRoleMatch( const Client* c1, const Client* c2, bool ac
|| ||
// hacks here // hacks here
// Mozilla has resourceName() and resourceClass() swapped // Mozilla has resourceName() and resourceClass() swapped
c1->resourceName() == "mozilla" && c2->resourceName() == "mozilla" ) ((c1->resourceName() == "mozilla") && (c2->resourceName() == "mozilla")) )
{ {
if( !active_hack ) // without the active hack for focus stealing prevention, if( !active_hack ) // without the active hack for focus stealing prevention,
return c1 == c2; // different mainwindows are always different apps return c1 == c2; // different mainwindows are always different apps

@ -362,12 +362,17 @@ void Placement::placeCascaded (Client* c, TQRect& area, Policy nextPlacement)
if ((yp + ch) > H) yp = Y; if ((yp + ch) > H) yp = Y;
if ((xp + cw) > W) if ((xp + cw) > W)
{
if (!yp) if (!yp)
{ {
place(c,area,nextPlacement); place(c,area,nextPlacement);
return; return;
} }
else xp = X; }
else
{
xp = X;
}
//if this isn't the first window //if this isn't the first window
if (cci[dn].pos.x() != X && cci[dn].pos.y() != Y) if (cci[dn].pos.x() != X && cci[dn].pos.y() != Y)

Loading…
Cancel
Save