Beispiel #1
0
    void widgetEventFilter(QEvent *event)
    {
        switch (event->type()) {
        case QEvent::Resize:
            updatePosition();
            updateOpacity();
            break;

        case QEvent::Move:
        case QEvent::Show:
        case QEvent::Hide:
            updatePosition();
            updateOpacity();
            updateArrow();
            break;

        default:
            break;
        }
    }
void QPicturePaintEngine::updateState(const QPaintEngineState &state)
{
    QPaintEngine::DirtyFlags flags = state.state();
    if (flags & DirtyPen) updatePen(state.pen());
    if (flags & DirtyBrush) updateBrush(state.brush());
    if (flags & DirtyBrushOrigin) updateBrushOrigin(state.brushOrigin());
    if (flags & DirtyFont) updateFont(state.font());
    if (flags & DirtyBackground) updateBackground(state.backgroundMode(), state.backgroundBrush());
    if (flags & DirtyTransform) updateMatrix(state.transform());
    if (flags & DirtyClipEnabled) updateClipEnabled(state.isClipEnabled());
    if (flags & DirtyClipRegion) updateClipRegion(state.clipRegion(), state.clipOperation());
    if (flags & DirtyClipPath) updateClipPath(state.clipPath(), state.clipOperation());
    if (flags & DirtyHints) updateRenderHints(state.renderHints());
    if (flags & DirtyCompositionMode) updateCompositionMode(state.compositionMode());
    if (flags & DirtyOpacity) updateOpacity(state.opacity());
}
Beispiel #3
0
    void Image::updateDrawables()
    {
        if(m_upd_recreate)
        {
            destroyDrawables();
            createDrawables();
        }
        if(m_upd_geometry)
        {
            updateGeometry();
        }
        if(m_upd_xf)
        {
            updateTransform();
        }
        if(m_upd_texture)
        {
            updateTexture();
        }
        if(m_upd_tile_ratio)
        {
            updateTileRatio();
        }
        if(m_upd_smooth)
        {
            updateSmooth();
        }
        if(m_upd_opacity)
        {
            updateOpacity();
        }

        m_upd_recreate = false;
        m_upd_geometry = false;
        m_upd_xf = false;
        m_upd_texture = false;
        m_upd_tile_ratio = false;
        m_upd_smooth = false;
        m_upd_opacity = false;
    }
Beispiel #4
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
    }