Esempio n. 1
0
void QWidget::updateFrameStrut() const
{
    QWidget *that = (QWidget *) this;

    if( !isVisible() || isDesktop() ) {
	that->fstrut_dirty = isVisible();
	return;
    }

    //FIXME: need to fill in frame strut info
}
Esempio n. 2
0
/*!
  Sets the client's active state to \a act.

  This function does only change the visual appearance of the client,
  it does not change the focus setting. Use
  Workspace::activateClient() or Workspace::requestFocus() instead.

  If a client receives or looses the focus, it calls setActive() on
  its own.

 */
void Client::setActive( bool act, bool updateOpacity_)
    {
    if ( active == act )
        return;
    active = act;
    workspace()->setActiveClient( act ? this : NULL, Allowed );

    if (updateOpacity_) updateOpacity();
    if (isModal() && transientFor())
    {
        if (!act) transientFor()->updateOpacity();
        else if (!transientFor()->custom_opacity) transientFor()->setOpacity(options->translucentActiveWindows, options->activeWindowOpacity);
    }
    updateShadowSize();

    if ( active )
    {
        Notify::raise( Notify::Activate );
        if (options->shadowEnabled(true))
            {
            if (options->shadowEnabled(false))
                {
                // Wait for inactive shadow to expose occluded windows and give
                // them a chance to redraw before painting the active shadow
                removeShadow();
                drawDelayedShadow();
                if (!isDesktop() &&
                       this != workspace()->topClientOnDesktop(desktop()))
                    // If the newly activated window's isn't the desktop, wait
                    // for its shadow to draw, then redraw any shadows
                    // overlapping it.
                    drawOverlappingShadows(true);
                }
            else
                drawShadow();
            }
        }
    else
        {
        removeShadow();

        if (options->shadowEnabled(false))
            {
            if (this == workspace()->topClientOnDesktop(desktop()))
                {
                /* If the newly deactivated window is the top client on the
                 * desktop, then the newly activated window is below it; ensure
                 * that the deactivated window's shadow draws after the
                 * activated window's shadow.
                 */
                if ((shadowAfterClient = workspace()->activeClient()))
                    {
                    drawShadowAfter(shadowAfterClient);
                    }
                }
            else
                {
                drawDelayedShadow();
                }
            }
        }

    if( !active )
        cancelAutoRaise();

    if( !active && shade_mode == ShadeActivated )
        setShade( ShadeNormal );
        
    StackingUpdatesBlocker blocker( workspace());
    workspace()->updateClientLayer( this ); // active windows may get different layer
    // TODO optimize? mainClients() may be a bit expensive
    ClientList mainclients = mainClients();
    for( ClientList::ConstIterator it = mainclients.begin();
         it != mainclients.end();
         ++it )
        if( (*it)->isFullScreen()) // fullscreens go high even if their transient is active
            workspace()->updateClientLayer( *it );
    if( decoration != NULL )
        decoration->activeChange();
    updateMouseGrab();
    updateUrgency(); // demand attention again if it's still urgent
    }
Esempio n. 3
0
bool AbstractClient::isSpecialWindow() const
{
    // TODO
    return isDesktop() || isDock() || isSplash() || isToolbar() || isNotification() || isOnScreenDisplay();
}