Merge lp://staging/~macslow/qtmir/fix-1475678 into lp://staging/qtmir

Proposed by Mirco Müller
Status: Work in progress
Proposed branch: lp://staging/~macslow/qtmir/fix-1475678
Merge into: lp://staging/qtmir
Diff against target: 172 lines (+66/-0)
4 files modified
src/modules/Unity/Application/mirsurfaceitem.cpp (+29/-0)
src/modules/Unity/Application/mirsurfaceitem.h (+5/-0)
src/modules/Unity/Application/mirsurfacemanager.cpp (+29/-0)
src/modules/Unity/Application/mirsurfacemanager.h (+3/-0)
To merge this branch: bzr merge lp://staging/~macslow/qtmir/fix-1475678
Reviewer Review Type Date Requested Status
Mir development team Pending
Review via email: mp+266418@code.staging.launchpad.net

Commit message

Added hook to allow MirSurfaceManager to mark MirSurfaceItems visible/non-visible.

Description of the change

Added hook to allow MirSurfaceManager to mark MirSurfaceItems visible/non-visible.

To post a comment you must log in.
Revision history for this message
Gerry Boland (gerboland) wrote :

m_surface->visible()
this isn't doing what you'd expect. Looking into the Mir code: src/server/scene/basic_surface.cpp:

bool ms::BasicSurface::visible() const
{
    std::unique_lock<std::mutex> lk(guard);
    return visible(lk);
}

bool ms::BasicSurface::visible(std::unique_lock<std::mutex>&) const
{
    bool visible{false};
    for (auto const& info : layers)
        visible |= info.stream->has_submitted_buffer();
    return !hidden && visible;
}

This is a place where the integration of QtMir and Mir isn't so good. Mir kinda assumes that we're using its Scene, and thus its compositor. But we're not. Our Scene is defined in QML, and our compositor is the Qt scenegraph renderer.

BasicSurface::visible() defines if the surface is visible in Mir's scene. It doesn't notify the client that its surface is exposed or not.

So instead you should ignore this, and read the surface attribute to learn if the client thinks it is exposed or not.

Revision history for this message
Gerry Boland (gerboland) wrote :

I'm unclear why you're introducing "visibility" - do you want to distinguish QML's visible state from the client's exposure state?

I also don't see the point of an enum for it, it's just true/false.

Revision history for this message
Gerry Boland (gerboland) wrote :

void MirSurfaceManager::displayOff()
void MirSurfaceManager::displayOn()

I disapprove of this design. A surface manager should not care about display state. It's the shell's decision if a client surface should be marked invisible when the display is off.

Also this throws away any visibility state that the shell may have set on surfaces.

A remote desktop would be an example where we don't care about the actual display state.

349. By Mirco Müller

Just use visible as a term instead of visibility for MirSurfaceItem and map that to mir::scene::surface's visibility-attribute.

Revision history for this message
Mirco Müller (macslow) wrote :

> ...
> So instead you should ignore this, and read the surface attribute to learn if
> the client thinks it is exposed or not.

This has been addressed.

Revision history for this message
Mirco Müller (macslow) wrote :

> I'm unclear why you're introducing "visibility" - do you want to distinguish
> QML's visible state from the client's exposure state?
>
> I also don't see the point of an enum for it, it's just true/false.

I got rid of visibility.

Revision history for this message
Mirco Müller (macslow) wrote :

> void MirSurfaceManager::displayOff()
> void MirSurfaceManager::displayOn()
>
> I disapprove of this design. A surface manager should not care about display
> state. It's the shell's decision if a client surface should be marked
> invisible when the display is off.
>
> Also this throws away any visibility state that the shell may have set on
> surfaces.
>
> A remote desktop would be an example where we don't care about the actual
> display state.

displayOn()/displayOff() are just temp. methods for quicker testing of the correct working of the visible-flag propagation. They will not stay... it's a WIP-branch after all :)

Unmerged revisions

349. By Mirco Müller

Just use visible as a term instead of visibility for MirSurfaceItem and map that to mir::scene::surface's visibility-attribute.

348. By Mirco Müller

Added hooks to allow MirSurfaceManager to mark MirSurfaceItems visible/non-visible.

347. By Mirco Müller

Merge with trunk.

346. By Mirco Müller

Expose visibility property of MirSurfaceItem.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches