Send setActive signal when taking focus in Client::takeFocus

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

@ -311,14 +311,14 @@ void Workspace::requestFocus( Client* c, bool force )
{
takeActivity( c, ActivityFocus | ( force ? ActivityFocusForce : 0 ), false);
}
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) )
flags &= ~ActivityFocus;
if ( !c )
if ( !c )
{
focusToNull();
return;
@ -328,7 +328,7 @@ void Workspace::takeActivity( Client* c, int flags, bool handled )
{
Client* modal = c->findModal();
if( modal != NULL && modal != c )
{
{
next_active_client = modal;
if( !modal->isOnDesktop( c->desktop()))
{
@ -353,7 +353,7 @@ void Workspace::takeActivity( Client* c, int flags, bool handled )
{
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 );
focusToNull();
}

@ -612,7 +612,7 @@ void Client::hideClient( bool hide )
hidden = hide;
updateVisibility();
}
/*!
Returns whether the window is minimizable or not
*/
@ -2200,9 +2200,13 @@ void Client::takeFocus( allowed_t )
if ( rules()->checkAcceptFocus( input ))
{
XSetInputFocus( tqt_xdisplay(), window(), RevertToPointerRoot, GET_QT_X_TIME() );
// Signal that we took focus!
setActive( true, true );
}
if ( Ptakefocus )
{
sendClientMessage(window(), atoms->wm_protocols, atoms->wm_take_focus);
}
workspace()->setShouldGetFocus( this );
}
@ -2745,7 +2749,7 @@ void Client::autoRaise()
workspace()->raiseClient( this );
cancelAutoRaise();
}
void Client::cancelAutoRaise()
{
delete autoRaiseTimer;
@ -2773,7 +2777,7 @@ void Client::setOpacity(bool translucent, uint opacity)
XChangeProperty(tqt_xdisplay(), window(), atoms->net_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L);
}
}
void Client::setShadowSize(uint shadowSize)
{
// ignoring all individual settings - if we control a window, we control it's shadow
@ -2781,7 +2785,7 @@ void Client::setShadowSize(uint shadowSize)
long data = shadowSize;
XChangeProperty(tqt_xdisplay(), frameId(), atoms->net_wm_window_shadow, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L);
}
void Client::updateOpacity()
// extra syncscreen flag allows to avoid double syncs when active state changes (as it will usually change for two windows)
{

@ -122,7 +122,7 @@ class Client : public TQObject, public KDecorationDefines
bool isOnCurrentDesktop() const;
bool isOnAllDesktops() const;
void setOnAllDesktops( bool set );
bool isOnScreen( int screen ) const; // true if it's at least partially there
int screen() const; // the screen where the center is
@ -274,7 +274,7 @@ class Client : public TQObject, public KDecorationDefines
void NETMoveResize( int x_root, int y_root, NET::Direction direction );
void NETMoveResizeWindow( int flags, int x, int y, int width, int height );
void restackWindow( Window above, int detail, NET::RequestSource source, Time timestamp, bool send_event = false );
void gotPing( Time timestamp );
static TQCString staticWindowRole(WId);

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

@ -731,8 +731,8 @@ void Client::destroyNotifyEvent( XDestroyWindowEvent* e )
return;
destroyClient();
}
bool blockAnimation = FALSE;
/*!

@ -518,7 +518,7 @@ bool Client::sameAppWindowRoleMatch( const Client* c1, const Client* c2, bool ac
||
// hacks here
// 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,
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 ((xp + cw) > W)
if (!yp)
{
if (!yp)
{
place(c,area,nextPlacement);
return;
}
else xp = X;
}
else
{
xp = X;
}
//if this isn't the first window
if (cci[dn].pos.x() != X && cci[dn].pos.y() != Y)

Loading…
Cancel
Save