Merge lp:~dandrader/unity8/childWindows into lp:unity8

Proposed by Daniel d'Andrada
Status: Superseded
Proposed branch: lp:~dandrader/unity8/childWindows
Merge into: lp:unity8
Prerequisite: lp:~dandrader/unity8/miral
Diff against target: 1552 lines (+767/-152)
30 files modified
CMakeLists.txt (+1/-1)
plugins/WindowManager/TopLevelWindowModel.cpp (+36/-28)
plugins/WindowManager/TopLevelWindowModel.h (+2/-0)
plugins/WindowManager/Window.h (+0/-1)
qml/Components/WindowControlButtons.qml (+2/-0)
qml/Stage/ChildWindow.qml (+159/-0)
qml/Stage/ChildWindowRepeater.qml (+28/-0)
qml/Stage/ChildWindowTree.qml (+127/-0)
qml/Stage/DecoratedWindow.qml (+40/-48)
qml/Stage/MoveHandler.qml (+23/-18)
qml/Stage/Stage.qml (+49/-8)
qml/Stage/WindowControlsOverlay.qml (+21/-24)
qml/Stage/WindowDecoration.qml (+7/-2)
qml/Stage/WindowResizeArea.qml (+3/-2)
tests/mocks/Unity/Application/ApplicationInfo.cpp (+9/-1)
tests/mocks/Unity/Application/ApplicationInfo.h (+3/-0)
tests/mocks/Unity/Application/ApplicationManager.cpp (+9/-0)
tests/mocks/Unity/Application/MirSurface.cpp (+43/-0)
tests/mocks/Unity/Application/MirSurface.h (+11/-0)
tests/mocks/Unity/Application/MirSurfaceItem.cpp (+19/-4)
tests/mocks/Unity/Application/MirSurfaceListModel.h (+0/-1)
tests/mocks/Unity/Application/SurfaceManager.cpp (+15/-8)
tests/mocks/Unity/Application/SurfaceManager.h (+3/-1)
tests/mocks/Unity/Application/VirtualKeyboard.cpp (+5/-4)
tests/mocks/Unity/Application/resources/Kate.qml (+49/-0)
tests/mocks/Unity/Application/resources/KateDialog.qml (+48/-0)
tests/mocks/Unity/Application/resources/KateMenu.qml (+41/-0)
tests/mocks/Unity/Application/resources/surfaces.qrc (+3/-0)
tests/qmltests/Stage/ApplicationCheckBox.qml (+1/-1)
tests/qmltests/Stage/tst_WindowResizeArea.qml (+10/-0)
To merge this branch: bzr merge lp:~dandrader/unity8/childWindows
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing
Michael Zanetti (community) Needs Information
Gerry Boland (community) Needs Information
Nick Dedekind (community) Abstain
Lukáš Tinkl (community) Needs Information
Review via email: mp+311974@code.launchpad.net

This proposal has been superseded by a proposal from 2017-01-19.

Commit message

Initial support for child windows (menus, dialogs, tooltips)

Description of the change

Prereq-archive: ppa:ci-train-ppa-service/2313

Good Qt apps to test with: kate, qtcreator

And keep in mind this is just the first iteration.

You can also play with it in "make tryDesktopStage" or "make tryShell" by launching the mock kate application and interacting with its UI to launch menus and dialogs.

* Are there any related MPs required for this MP to build/function as expected? Please list.
https://code.launchpad.net/~dandrader/unity-api/parentSurface/+merge/313056
https://code.launchpad.net/~dandrader/qtmir/miral-surfaceLocalPos/+merge/313438

Tooltips work better with these:
https://bileto.ubuntu.com/#/ticket/2382 (miral 1.0.2)
https://code.launchpad.net/~dandrader/qtubuntu/resizeToolTip

* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes, although it's basically new functionality

* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

* If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
lp:~dandrader/unity8/childWindows updated
2705. By Andrea Cimitan

Fix white text (LP: #1644468)

Approved by: Albert Astals Cid, Unity8 CI Bot

2706. By Andrea Cimitan

Make MascotLoader in CardCreator flat

Approved by: Albert Astals Cid, Unity8 CI Bot

2707. By Andrea Cimitan

Make the remaining UbuntuShape flat

Approved by: Albert Astals Cid, Unity8 CI Bot

2708. By Andrea Cimitan

added dropshadow from panel indicators to dash page header extra panel, so there is right shadow when the extra panel is narrow

Approved by: Albert Astals Cid, Unity8 CI Bot

2709. By Andrea Cimitan

Look up for expandable template dash category flag

Approved by: Albert Astals Cid, Unity8 CI Bot

2710. By Albert Astals Cid

Fix PreviewProgress implicitHeight

We actually want this to be the height of the progressbar that we fix so use that and not the implicitHeight (LP: #1641943)

Approved by: Andrea Cimitan, Unity8 CI Bot

2711. By Andrea Azzarone

Set Mir.cursorName to "grabbing" on first mouse press on a window decoration. Don't wait for press+motion. (LP: #1618078)

Approved by: Lukáš Tinkl, Unity8 CI Bot

2712. By Andrea Azzarone

Do not show a divider between each quicklist entry but just between each section, similar to how unity7 does. (LP: #1637478)

Approved by: Albert Astals Cid, Unity8 CI Bot

2713. By Daniel d'Andrada

There's no need for WindowDecoration to access the appDelegate

It damages modularity.

Approved by: Michael Zanetti, Unity8 CI Bot

2714. By Brian Douglass

Added a setting to enable/disable the indicator dropdown menu.

Approved by: Michael Zanetti, Unity8 CI Bot

2715. By Michael Zanetti

disable spread interaction while locked (LP: #1641578)

Approved by: Lukáš Tinkl, Unity8 CI Bot

2716. By Olivier Tilloy

Remove dependency on transitional package. (LP: #1583079)

Approved by: Albert Astals Cid, Unity8 CI Bot

2717. By Lukáš Tinkl

Enable brightness (laptop backlight) handling on desktop/laptop PCs (LP: #1595947)

Approved by: Michael Zanetti, Unity8 CI Bot

2718. By Andrea Azzarone

Implement launcher tooltips.

Approved by: Michał Sawicz

2719. By Albert Astals Cid

Adapt to dummy notification being gone

and warning fix as bonus

Approved by: Lukáš Tinkl, Unity8 CI Bot

2720. By Albert Astals Cid

Fix autopilot test_lock_screen tests

Approved by: Andrea Cimitan, Unity8 CI Bot

2721. By Albert Astals Cid

Autopilot: Add more applications to the list for wider screens

Otherwise the test was failing because available_applications was too short

Approved by: Andrea Cimitan, Unity8 CI Bot

2722. By Albert Astals Cid

Fix autopilot DashHelperTestCase.test_search

Approved by: Andrea Cimitan, Unity8 CI Bot

2723. By Albert Astals Cid

Also install the Screens mock

This way we can run some more autopilot tests in X11

Approved by: Lukáš Tinkl, Unity8 CI Bot

2724. By Albert Astals Cid

Give default value to gu-px size

Fixes some of the autopilot greeter tests when run under X11

Approved by: Andrea Cimitan, Unity8 CI Bot

2725. By CI Train Bot Account

Releasing 8.15+17.04.20161129-0ubuntu1

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
lp:~dandrader/unity8/childWindows updated
2726. By Launchpad Translations on behalf of unity-team

Launchpad automatic translations update.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Text conflict in debian/control
Text conflict in qml/Shell.qml
Text conflict in qml/Stage/Stage.qml
Text conflict in tests/mocks/Unity/Application/plugin.cpp
Text conflict in tests/qmltests/Stage/tst_DesktopStage.qml
Text conflict in tests/qmltests/tst_Shell.qml
6 conflicts encountered.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
dinamic (dinamic6661) wrote :

tested with tiled and kate (qt5 apps), brief test with tiled and kate, the child windows positioning works, if i move the parrent window, the child windows moves according to parrent's x/y. in the app switcher (alt tab) i see both the parrent and the child window. the menus open in a separate window with a wrong size and position and it usually ends up freezing unity8 when i try to close the menu or or parent. tooltips same as with menus. short video here https://vid.me/aCWQ

ubuntu 17.04 / nouveau

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 01/12/2016 13:47, dinamic wrote:
> tested with tiled and kate (qt5 apps), brief test with tiled and kate, the child windows positioning works, if i move the parrent window, the child windows moves according to parrent's x/y. in the app switcher (alt tab) i see both the parrent and the child window. the menus open in a separate window with a wrong size and position and it usually ends up freezing unity8 when i try to close the menu or or parent. tooltips same as with menus. short video here https://vid.me/aCWQ
>
> ubuntu 17.04 / nouveau

Looks like you have an outdated qtubuntu. Menus should work fine and
child windows should not show in the app switcher.

Revision history for this message
dinamic (dinamic6661) wrote :

i have qtubuntu-desktop/zesty,now 0.63+17.04.20161123-0ubuntu1 amd64 [installed]

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
lp:~dandrader/unity8/childWindows updated
2727. By Lukáš Tinkl

Fix the Super key not invoking the dash scope home (LP: #1607427)

Approved by: Daniel d'Andrada, Unity8 CI Bot

2728. By Albert Astals Cid

Add the Wsuggest-override flag to gcc

While at it mark system includes as such so we don't get warnings we can not fix

Approved by: Michael Zanetti, Unity8 CI Bot

2729. By Albert Astals Cid

Add support for compiler sanitizers via ECM

2730. By Albert Astals Cid

Use timeStep as delay time

Passing iterations / speed didn't make much sense since that parameter is a delay in milliseconds and the default parameters would give a value of 5 / units.gu(10) that is smaller than 1 millisecond.

Qt 5.7 calculation for velocity was very unhappy if we moved things so fast in less than 1ms and ignored the movements, so this also makes tests pass on Qt 5.7 (LP: #1642919)

Approved by: Josh Arenson, Unity8 CI Bot

2731. By Michael Zanetti

Add the ApplicationDrawer

Approved by: Lukáš Tinkl, Unity8 CI Bot

2732. By Michael Zanetti

tune right edge push

make it less intrusive when accidentally hitting the edge with the mouse
tweak visuals for the mouse case (LP: #1646094)

Approved by: Unity8 CI Bot

2733. By Michael Zanetti

improve close button visiblity when hovering with the mouse

Approved by: Albert Astals Cid, Unity8 CI Bot

2734. By Albert Astals Cid

Bring back fix for 1517830

Now with autotest \o/ (LP: #1517830)

Approved by: Andrea Cimitan, Unity8 CI Bot

2735. By Daniel d'Andrada

Fix "make tryApplicationWindow"

No surface was showing up on the screen
Also remove outdated button (feature is no longer there)

Approved by: Albert Astals Cid, Unity8 CI Bot

2736. By Albert Astals Cid

Fix compile warnings in mocks

Approved by: Daniel d'Andrada, Unity8 CI Bot

2737. By Josh Arenson

Enable the greeter to remember which session the user last logged into

This also fixes a small issue with how the default session was handled. (LP: #1631365)

Approved by: Albert Astals Cid, Unity8 CI Bot

2738. By Daniel d'Andrada

Take save/restore functions out of WindowResizeArea

They've no relationship with resizing whatsoever.

Approved by: Lukáš Tinkl, Unity8 CI Bot

2739. By Michael Zanetti

Update virtual touchpad visuals and add a tutorial. (LP: #1585220)

Approved by: Lukáš Tinkl, Unity8 CI Bot

2740. By Albert Astals Cid

Do not hide panel when launching an application if the mouse is on the panel

Need Functions.itemUnderMouse because MouseArea.containsMouse returns true when tapping (i.e. no mouse used) on it.

Unfortunately the QML testlib do not set the proper value when issueing a mouseMove so i can't add a test that proofs it works, i'll try to propose something upstream and then add the test at a later MR (LP: #1591311)

Approved by: Lukáš Tinkl, Unity8 CI Bot

2741. By Pete Woods

MenuItemFactory: Add subtitle support to SwitchItem widget

Approved by: Marco Trevisan (Treviño), Michał Sawicz, Unity8 CI Bot

2742. By CI Train Bot Account

Releasing 8.15+17.04.20161207.1-0ubuntu1

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

Getting a conflict merging in latest unity8/miral branch.

Text conflict in plugins/WindowManager/TopLevelWindowModel.h
Text conflict in qml/Stage/WindowResizeArea.qml

review: Needs Fixing
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

> Getting a conflict merging in latest unity8/miral branch.
>
> Text conflict in plugins/WindowManager/TopLevelWindowModel.h
> Text conflict in qml/Stage/WindowResizeArea.qml

Fixed. Rebased on top of latest unity8/miral.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Just 2 minor nitpicks, otherwise the code looks good (haven't tested yet):

+ Window *TopLevelWindowModel::createWindow(unityapi::MirSurfaceInterface *surface)

-> const qualifier, it's a getter

+ readonly property bool decorated

-> this could be rewritten to be a direct binding, instead of a function

review: Needs Fixing
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Console is spammed with this warning:

TypeError: Property 'updateSurfaceRequestedPosition' of object QObject_QML_309(0x7024140) is not a function

review: Needs Fixing
lp:~dandrader/unity8/childWindows updated
2743. By Launchpad Translations on behalf of unity-team

Launchpad automatic translations update.

2744. By Daniel d'Andrada

Let the model deal with some window management decisions

eg: which window to focus, whether to change surface state

unity8 requests and reacts to changes in the model instead of applying them (LP: #1346633)

Approved by: Emanuele Antonio Faraone, Lukáš Tinkl

2745. By CI Train Bot Account

Releasing 8.15+17.04.20161215-0ubuntu1

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 13/12/2016 09:46, Lukáš Tinkl wrote:
> Review: Needs Fixing
>
> Just 2 minor nitpicks, otherwise the code looks good (haven't tested yet):
>
> + Window *TopLevelWindowModel::createWindow(unityapi::MirSurfaceInterface *surface)
>
> -> const qualifier, it's a getter

It's not a getter and it can't be const since the generateId() method it
uses cannot be const.

> + readonly property bool decorated
>
> -> this could be rewritten to be a direct binding, instead of a function

AFAIK both notations work exactly the same. It's syntactic sugar. Made
the change anyway as it's less code.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 13/12/2016 11:59, Lukáš Tinkl wrote:
> Review: Needs Fixing
>
> Console is spammed with this warning:
>
> TypeError: Property 'updateSurfaceRequestedPosition' of object QObject_QML_309(0x7024140) is not a function

Fixed.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

I have a question regarding the (Kate) dialog's placement, caption and focus:

Shouldn't the dialog's titlebar be actually placed under its parent's titlebar, and focused? The font used for the dialog's caption should probably be the same as any other "focused" window; the current way it is suggests the main window in the background is still focused.

review: Needs Information
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 16/12/2016 12:36, Lukáš Tinkl wrote:
> Review: Needs Information
>
> I have a question regarding the (Kate) dialog's placement, caption and focus:
>
> Shouldn't the dialog's titlebar be actually placed under its parent's titlebar, and focused? The font used for the dialog's caption should probably be the same as any other "focused" window; the current way it is suggests the main window in the background is still focused.

Please don't get lost in the details. This is just the first iteration.
There are loads of things to improve.

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

> On 16/12/2016 12:36, Lukáš Tinkl wrote:
> > Review: Needs Information
> >
> > I have a question regarding the (Kate) dialog's placement, caption and
> focus:
> >
> > Shouldn't the dialog's titlebar be actually placed under its parent's
> titlebar, and focused? The font used for the dialog's caption should probably
> be the same as any other "focused" window; the current way it is suggests the
> main window in the background is still focused.
>
> Please don't get lost in the details. This is just the first iteration.
> There are loads of things to improve.

"The devil is in the detail"

I'm aware of the fact this is a first iteration but I'm sure we don't want to land stuff in a (semi) broken state

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 16/12/2016 13:00, Lukáš Tinkl wrote:
>> On 16/12/2016 12:36, Lukáš Tinkl wrote:
>>> Review: Needs Information
>>>
>>> I have a question regarding the (Kate) dialog's placement, caption and
>> focus:
>>> Shouldn't the dialog's titlebar be actually placed under its parent's
>> titlebar, and focused? The font used for the dialog's caption should probably
>> be the same as any other "focused" window; the current way it is suggests the
>> main window in the background is still focused.
>>
>> Please don't get lost in the details. This is just the first iteration.
>> There are loads of things to improve.
> "The devil is in the detail"
>
> I'm aware of the fact this is a first iteration but I'm sure we don't want to land stuff in a (semi) broken state
>
>
As long as it's not causing regressions on existing features, it
shouldn't be a problem.

Proper positioning of child dialogs hasn't been implemented yet. Will
likely involve work on miral.

Eg: Open a child dialog. Move it to the side of its top-level parent.
Now move that top-level parent right to the edge of the display. The
child dialog will be completely offscreen.

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

And, is this supposed to work in anything else than the desktop mode? Because in phone/tablet modes, it doesn't do anything

review: Needs Information
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 16/12/2016 13:32, Lukáš Tinkl wrote:
> Review: Needs Information
>
> And, is this supposed to work in anything else than the desktop mode? Because in phone/tablet modes, it doesn't do anything

phone/tablet is uncharted territory with regards to child windows. Need
input from design etc.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2755
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2756/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3614
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2067
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2067
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3642
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3488
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3488/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3488
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3488/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3488
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3488/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3488
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3488/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3488
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3488/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3488
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3488/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2756/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2756
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2758/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3616
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2069
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2069
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3644
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3490
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3490/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3490
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3490/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3490
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3490/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3490
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3490/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3490
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3490/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3490
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3490/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2758/rebuild

review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

some notes from testing it:

* Menus are opening, but they close themselves again immediately again.

* Dragging around child surfaces (in my case a Toolbar in a QWidget application) will get unity8 to spin on 100% cpu in miral::Window::move_to() and not recover from that.

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

> some notes from testing it:
>
> * Menus are opening, but they close themselves again immediately again.
>
> * Dragging around child surfaces (in my case a Toolbar in a QWidget
> application) will get unity8 to spin on 100% cpu in miral::Window::move_to()
> and not recover from that.

I'm testing QtCreator and Kate, and not hitting either of these so far. The menu thing especially. But it does sound familiar, I think I had it at one stage, it was down to a focus issue.

Just for our info, are you using a USB mouse, or laptop trackpad, or touch?

Revision history for this message
Michael Zanetti (mzanetti) wrote :

laptop touchpad

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

The problem of tooltips not redrawing is bug 1652109

Revision history for this message
Daniel d'Andrada (dandrader) wrote :
lp:~dandrader/unity8/childWindows updated
2746. By CI Train Bot Account

Resync trunk.

2747. By Launchpad Translations on behalf of unity-team

Launchpad automatic translations update.

2748. By Launchpad Translations on behalf of unity-team

Launchpad automatic translations update.

2749. By Timo Jyrinki

No change rebuild

2750. By Michael Terry

Run the qmluitests.sh autopkg test against the installed package.

This is faster and more accurate than rebuilding unity8 and running tests from the build dir.

Approved by: Albert Astals Cid, Unity8 CI Bot

2751. By Nick Dedekind

Added registry for application menus

Approved by: Michael Zanetti, Unity8 CI Bot

2752. By Michał Sawicz

Application menus

2753. By Michael Zanetti

PreviewRatingInput: Use displayText instead of text to enable/disable the Send button (LP: #1595910)

Approved by: Andrea Cimitan, Christian Dywan, Unity8 CI Bot

2754. By Michael Zanetti

Add a D-Bus interface to control some debug facilities on the fly

Approved by: Gerry Boland, Unity8 CI Bot

2755. By Michael Zanetti

some launcher workarounds for the snapping

Approved by: Albert Astals Cid, Unity8 CI Bot

2756. By dobey

Remove the payments widget and dependency on libpay as no longer needed.

Approved by: Andrea Cimitan, Unity8 CI Bot

2757. By Lukáš Tinkl

Fix touch window controls being unreachable when the overlay is being displayed (LP: #1648167)

Approved by: Josh Arenson, Unity8 CI Bot

2758. By Albert Astals Cid

Give focus to one of the buttons of the dialog

This one you can use Tab/Alt+Tab to navigate through them.

Unfortunately there's still the problem that if there's some other elements that take focus (like indicators), focus will also travel through them, but this is an start.

Approved by: Daniel d'Andrada, Unity8 CI Bot

2759. By Albert Astals Cid

tst_WindowResizeArea: Use default values for mouseFlick speed and iterations (LP: #1651580)

Approved by: Daniel d'Andrada, Unity8 CI Bot

2760. By Albert Astals Cid

Require Qt 5.6 & misc fixes

Require Qt 5.6:
    We align with what we're really testing
    We can use Q_ENUM/Q_FLAG instead of Q_ENUMS/Q_FLAGS (Qt 5.5)

CursorImageInfo.cpp
    Join two QString::arg into one

SessionsModel.cpp
UsersModel.cpp
    Remove useless Q_D

dashconnection.cpp
ColorTheme.cpp
UserMetrics.cpp
horizontaljournaltest.cpp
listviewwithpageheadersectionexternalmodeltest.cpp
organicgridtest.cpp
verticaljournaltest.cpp
    QObjects should have the Q_OBJECT macro

indicatorsmodel.h
fakeindicatorsmodel.h
    There's no Roles enum, remove

appdrawerproxymodel.cpp
MirSurfaceItem.cpp
    Add & to the foreach variable

appdrawerproxymodel.cpp
    Make the string comparison faster

easingcurve.h
    Remove QEasingCurve::Type declaration, it's already in Qt

unitysortfilterproxymodelqml.h
fake_scopesoverview.h
    Make some parent functions accessible to remove clang warnings

PageList.cpp
unitymenumodel.cpp
qinputdeviceinfo_mock.cpp
    Better way to iterate the container

Greeter.cpp
    Cheaper env var checking

mediaplayer.cpp
mediaplayer.h
    Rename timerEvent, clang was not happy since QObject has another one

ApplicationInfo.h
    Mark as override

MockAppDrawerModel.cpp
launchermodeltest.cpp
screens.cpp
    Fix warning

fake_previewwidgetmodel.h
    Forward declare struct the same way it is defined later

fake_scopes.cpp
    Safer connect

horizontaljournaltest.cpp
verticaljournaltest.cpp
testutil.cpp
    Use at instead of [] in temporary

launchermodelastest.cpp
    Remove unused member
    Use toModelIndex() instead of value<QModelIndex>()

Approved by: Michael Zanetti, Unity8 CI Bot

2761. By Lukáš Tinkl

Fixup paths for window state storage in snappy environment

Approved by: Albert Astals Cid, Unity8 CI Bot

2762. By Josh Arenson

Allow the scopes list to automatically scroll when a scope is being dragged past the bounds of the screen. (LP: #1575319)

Approved by: Andrea Cimitan, Unity8 CI Bot

2763. By Daniel van Vugt

Deprecate usage of Mir's input resampling, instead opting for:
  Shell: Raw native input events
  Apps: Qt's built-in touch compression input resampling algorithm,
         and other toolkits are expected to provide their own.

This fixes LP: #1497105 nicely, allowing apps to receive the full-speed
input stream (if they ask their toolkit to give it to them).

As an added bonus this also eliminates the 0-16.9ms (average 8.4ms) of
input lag that apps under Unity8 would experience. We do still have the
problem of output lag making everything still look laggy but I am
working to eliminate that soon in Mir 0.26.0. (LP: #1497105, #1591328)

Approved by: Gerry Boland, Unity8 CI Bot

2764. By Lukáš Tinkl

Add Unity.Platform mock for our tests (LP: #1655336)

Approved by: Michał Sawicz

2765. By Michał Sawicz

Nuke leftover Platform in IndicatorsManager

Approved by: Nick Dedekind

2766. By CI Train Bot Account

Releasing 8.15+17.04.20170110.4-0ubuntu1

2767. By CI Train Bot Account

Resync trunk.

2768. By Launchpad Translations on behalf of unity-team

Launchpad automatic translations update.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Text conflict in tests/qmltests/Stage/tst_WindowResizeArea.qml
1 conflicts encountered.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 16/01/2017 06:46, Albert Astals Cid wrote:
> Text conflict in tests/qmltests/Stage/tst_WindowResizeArea.qml
> 1 conflicts encountered.

Fixed

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2769
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2925/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3817
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2213
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2213
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3845
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3688
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3688/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3688
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3688/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3688
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3688/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3688
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3688/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3688
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3688/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3688
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3688/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2925/rebuild

review: Needs Fixing (continuous-integration)
lp:~dandrader/unity8/childWindows updated
2769. By Launchpad Translations on behalf of unity-team

Launchpad automatic translations update.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2769
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2939/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3835
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2228
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2228
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3863
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3706
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3706/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3706
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3706/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3706
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3706/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3706
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3706/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3706
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3706/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3706
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3706/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2939/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Nick Dedekind (nick-dedekind) :
review: Abstain
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2770
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2947/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3844
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2237
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2237
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3872
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3715
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3715/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3715
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3715/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3715
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3715/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3715
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3715/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3715
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3715/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3715
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3715/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2947/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2770
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2950/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3848
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2241
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2241
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3876
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3719
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3719/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3719
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3719/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3719
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3719/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3719
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3719/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3719
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3719/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3719
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3719/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2950/rebuild

review: Needs Fixing (continuous-integration)
lp:~dandrader/unity8/childWindows updated
2770. By Launchpad Translations on behalf of unity-team

Launchpad automatic translations update.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

I still see some issues:

* the right click context menu shows up but closes immediately again

* the code completion popup in kate seems to not be updated properly.
  this you said would be a known bug. also, normal tooltips seem to work fine, this just happens with the code completion windows (which probably aren't tooltip windows)

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

+++ qml/Stage/ChildWindowTree.qml

Just a thought:

+ readonly property bool maximized: false
+ readonly property bool maximizedLeft: false
+ readonly property bool maximizedRight: false
+ readonly property bool maximizedHorizontally: false
+ readonly property bool maximizedVertically: false
+ readonly property bool maximizedTopLeft: false
+ readonly property bool maximizedTopRight: false
+ readonly property bool maximizedBottomLeft: false
+ readonly property bool maximizedBottomRight: false

Only one of these can be set true at any time, am I right? In that case, perhaps an enum would be less wordy, and reduce chances of logic error (multiple trues)

MaximizedState.qml:

pragma Singleton
import QtQuick 2.5
QtObject {
    id: singleton

    property bool maximized: 0
    property bool maximizedLeft: 1
    property bool maximizedRight: 2
...
}

and then use readonly property MaximizedState instead.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 19/01/2017 11:44, Gerry Boland wrote:
> +++ qml/Stage/ChildWindowTree.qml
>
> Just a thought:
>
> + readonly property bool maximized: false
> + readonly property bool maximizedLeft: false
> + readonly property bool maximizedRight: false
> + readonly property bool maximizedHorizontally: false
> + readonly property bool maximizedVertically: false
> + readonly property bool maximizedTopLeft: false
> + readonly property bool maximizedTopRight: false
> + readonly property bool maximizedBottomLeft: false
> + readonly property bool maximizedBottomRight: false
>
> Only one of these can be set true at any time, am I right? In that case, perhaps an enum would be less wordy, and reduce chances of logic error (multiple trues)
>
> MaximizedState.qml:
>
> pragma Singleton
> import QtQuick 2.5
> QtObject {
> id: singleton
>
> property bool maximized: 0
> property bool maximizedLeft: 1
> property bool maximizedRight: 2
> ...
> }
>
> and then use readonly property MaximizedState instead.

I'm just mimicking the existing API in Stage.qml, where those are used
in several places. Having all those booleans separate seem to be
convenient for use in states and expressions over there.

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

+// Meant to be created with a Loader to circunvent
typo, "circumvent"

+++ qml/Stage/ChildWindow.qml
Wanted to double-check this with you:

+ WindowDecoration {
+ onPressed: root.surface.activate();
+ onPressedChanged: if (d.moveHandler) { d.moveHandler.handlePressedChanged(pressed, pressedButtons, mouseX, mouseY); }

You're listening to both of MouseArea's pressed signals. Since the order is emission isn't guaranteed, you're sure both slots are roughly independent (one doesn't impact the other)? Just in case future Qt's reversed the order..

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

+ // Do not hold on to a dead surface so that it can be destroyed.
+ surface: root.surface && root.surface.live ? root.surface : null

Could you add a FIXME here, as I think it should not be QML's job to release the MirSurface if its backing surface goes away. Instead backing MirSurface should go away but the MirSurfaceItem can live on with the last drawn frame and properties.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 19/01/2017 11:58, Gerry Boland wrote:
> Review: Needs Information
>
> +// Meant to be created with a Loader to circunvent
> typo, "circumvent"

Fixed, thanks.

> +++ qml/Stage/ChildWindow.qml
> Wanted to double-check this with you:
>
> + WindowDecoration {
> + onPressed: root.surface.activate();
> + onPressedChanged: if (d.moveHandler) { d.moveHandler.handlePressedChanged(pressed, pressedButtons, mouseX, mouseY); }
>
> You're listening to both of MouseArea's pressed signals. Since the order is emission isn't guaranteed, you're sure both slots are roughly independent (one doesn't impact the other)? Just in case future Qt's reversed the order..

Again, am copy-pasting from elsewhere (DecoratedWindow.qml in this
case). I think those two are rather independent (order not particularly
important).

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

+++ qml/Stage/ChildWindowTree.qml
+ function restore(someBool, someEnum) {}
cruft?

+ var pos = mapToItem(target.parent, mouse.x, mouse.y); // How can that work if we're just a QtObject (not an Item)?
very good question. It is working yeah?

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 19/01/2017 12:01, Gerry Boland wrote:
> + // Do not hold on to a dead surface so that it can be destroyed.
> + surface: root.surface && root.surface.live ? root.surface : null
>
> Could you add a FIXME here, as I think it should not be QML's job to release the MirSurface if its backing surface goes away. Instead backing MirSurface should go away but the MirSurfaceItem can live on with the last drawn frame and properties.

Done.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

There's an issue with alt+tab:

* open an application that has only a toplevel window (e.g. terminal app)
* open an application (e.g. kate) and open a child window (e.g. the file open dialog).
* press alt+tab quickly, it will focus the terminal app
* press alt+tab again, it will focus kate's file open dialog, but not bring it to front.

=========

shouldn't this have ~dandrader/unity8/simplifyWindowDecoration as a prerequisite?

========

some inline comments

review: Needs Fixing
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2770
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2957/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3856
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2248
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2248
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3884
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3727
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3727/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3727
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3727/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3727
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3727/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3727
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3727/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3727
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3727/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3727
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3727/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2957/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

playing with tryShell, opening kate and then opening the menu dialogs, it would seem to me that they should close again when clicking outside of them? Currently allows going into situation where you e.g. open a couple of those menus and then when you click the menu in the title bar, the menu will appear below those in-app menus

review: Needs Information
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 19/01/2017 12:08, Gerry Boland wrote:
> +++ qml/Stage/ChildWindowTree.qml
> + function restore(someBool, someEnum) {}
> cruft?

Removed

>
> + var pos = mapToItem(target.parent, mouse.x, mouse.y); // How can that work if we're just a QtObject (not an Item)?
> very good question. It is working yeah?

It must, otherwise resize wouldn't be working. :D
According to lukaz it gets from the context, to from the closest Item
parent...
/me shrugs
But it does deserve a refactoring at some point. This is quite messy.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 19/01/2017 13:31, Michael Zanetti wrote:
> Review: Needs Information
>
> playing with tryShell, opening kate and then opening the menu dialogs, it would seem to me that they should close again when clicking outside of them? Currently allows going into situation where you e.g. open a couple of those menus and then when you click the menu in the title bar, the menu will appear below those in-app menus

That fake kate has a very crude menu implementation. They are there just
so that you can check positioning and, most-importantly, its decorations
(or lack thereof).

A ChildWindow that has a dialog surface will get shadows, title bar and
be movable with touch (ie, get touch controls when appropriate). But a
ChildWindow that has a menu surface will only get shadows and nothing else.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 19/01/2017 11:23, Michael Zanetti wrote:
> I still see some issues:
>
> * the right click context menu shows up but closes immediately again

Still can't reproduce it. :/

> * the code completion popup in kate seems to not be updated properly.
> this you said would be a known bug. also, normal tooltips seem to work fine, this just happens with the code completion windows (which probably aren't tooltip windows)

Works fine if you install those:

https://bileto.ubuntu.com/#/ticket/2382 (miral 1.0.2)
https://code.launchpad.net/~dandrader/qtubuntu/resizeToolTip (just
updated it, btw)

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2773
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2961/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3860
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2252
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2252
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3888
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3733
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3733/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3733
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3733/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3733
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3733/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3733
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3733/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3733
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3733/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3733
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3733/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2961/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 19/01/2017 12:33, Michael Zanetti wrote:
> Review: Needs Fixing
>
> There's an issue with alt+tab:
>
> * open an application that has only a toplevel window (e.g. terminal app)
> * open an application (e.g. kate) and open a child window (e.g. the file open dialog).
> * press alt+tab quickly, it will focus the terminal app
> * press alt+tab again, it will focus kate's file open dialog, but not bring it to front.

That's miral bug 1658085

> shouldn't this have ~dandrader/unity8/simplifyWindowDecoration as a prerequisite?

Yes. Done.

> Diff comments:
>
>> === added file 'qml/Stage/ChildWindow.qml'
>> --- qml/Stage/ChildWindow.qml 1970-01-01 00:00:00 +0000
>> +++ qml/Stage/ChildWindow.qml 2017-01-18 19:24:19 +0000
>> @@ -0,0 +1,156 @@
>> [...]
>> +
>> + width: surface ? surface.size.width : 0
>> + height: surface ? surface.size.height : 0
>> +
>> + // Make it get shown and hidden with a fade in/out effect
>> + opacity: surface && surface.state !== Mir.MinimizedState && surface.state !== Mir.HiddenState ? 1.0 : 0.0
>> + Behavior on opacity { UbuntuNumberAnimation {} }
> I wonder if this might be better set to SnapDuration instead of the default of FastDuration.

I don't really have a preference. Want me to change to that?

>
>> === added file 'qml/Stage/ChildWindowTree.qml'
>> --- qml/Stage/ChildWindowTree.qml 1970-01-01 00:00:00 +0000
>> +++ qml/Stage/ChildWindowTree.qml 2017-01-18 19:24:19 +0000
>> @@ -0,0 +1,129 @@
>> +/*
>> [...]
>> + }
>> +
>> + readonly property bool windowedTransitionRunning: false
> hmm... is this used somewhere? if it's readonly and set to false, what is it good for?

As the comment above says, that's API that MoveHandler expects its
target to have.

>
>> === modified file 'qml/Stage/MoveHandler.qml'
>> --- qml/Stage/MoveHandler.qml 2016-12-12 16:45:09 +0000
>> +++ qml/Stage/MoveHandler.qml 2017-01-18 19:24:19 +0000
>> @@ -117,35 +119,38 @@
>> target.requestRestore();
>> }
>>
>> - var pos = mapToItem(target.parent, mouse.x, mouse.y);
>> + var pos = mapToItem(target.parent, mouse.x, mouse.y); // How can that work if we're just a QtObject (not an Item)?
> good question, does it?

It must, otherwise resize wouldn't be working. :D

According to lukaz it gets from the context, to from the closest Item
parent...
/me shrugs
But it does deserve a refactoring at some point. This is quite messy.

>
>> === modified file 'tests/mocks/Unity/Application/ApplicationInfo.cpp'
>> --- tests/mocks/Unity/Application/ApplicationInfo.cpp 2016-12-20 15:50:41 +0000
>> +++ tests/mocks/Unity/Application/ApplicationInfo.cpp 2017-01-18 19:24:19 +0000
>> @@ -122,7 +123,9 @@
>> auto surface = surfaceManager->createSurface(surfaceName,
>> Mir::NormalType,
>> fullscreen() ? Mir::FullscreenState : Mir::RestoredState,
>> - m_screenshotFileName);
>> + nullptr, /* parentSurface */
> is there a space too much?

Yes. Fixed.

lp:~dandrader/unity8/childWindows updated
2771. By Lukáš Tinkl

Fix keymap not being applied on the shell itself (LP: #1626435)

Approved by: Gerry Boland, Unity8 CI Bot

2772. By Albert Astals Cid

Limit tab-focus travelling on dialogs with a fence

Approved by: Lukáš Tinkl, Unity8 CI Bot

2773. By Lukáš Tinkl

Shell dialog improvements (kbd focus, mouse eater)

Approved by: Michael Zanetti, Unity8 CI Bot

2774. By Albert Astals Cid

Restore focus to where it was when our ShellDialogs get unloaded

UITK Dialogs want to have this feature but it seems to be broken, so i'm fixing it here first (since we use dialogs in a kind of special way)
I'll try to fix UITK next

Approved by: Andrea Cimitan, Unity8 CI Bot

2775. By Michael Terry

Simplify the lightdm mock to make future greeter improvements easier to test.

I simplified the mock liblightdm to avoid separate files for the Private classes. That can all go into the main files. The separation isn't worth wading through the files to find what you want.

And I dropped the mock LightDM plugin entirely. (opting instead for a tiny "mock()" API call on the real plugin that returns an object that can be used to manipulate our mock liblightdm, if we're in testing mode)

Approved by: Albert Astals Cid, Unity8 CI Bot

2776. By Josh Arenson

Add a test for the session chooser icon in the greeter's sessions list

Approved by: Albert Astals Cid, Unity8 CI Bot

2777. By Michael Terry

Add support for guest sessions in unity8-greeter.

Adds support for the "hasGuestAccount" and "selectGuest" LightDM hints and does so largely by having the users model report a "*guest" user, rather than adding special support in qml.

Approved by: Albert Astals Cid, Unity8 CI Bot

2778. By Michael Terry

Add support for LightDM hints for manual logins and hiding normal users.

Approved by: Albert Astals Cid, Unity8 CI Bot

2779. By Michael Terry

Use a model for PAM prompts, supporting more possible interactions.

- This lets us show more than one message and more than one prompt from PAM.

- We now also show error text when a user enters a wrong password. This matches unity7-greeter behavior.

- Similarly, when a fingerprint login is attempted, but we are demanding a real login (e.g. the user hasn't logged in before), we now show a message to explain that a bit.

- Simplify the Greeter/View interactions a bit. We no longer need to signal quite as much events, since the view reflects the prompts model directly.

- Fix keyboard focus highlight handling among prompts.

- Update and expand the tests.

Approved by: Albert Astals Cid

2780. By Albert Astals Cid

Update current session after changing the user

This matches unity7 greeter behaviour, i.e. if you change the session and then change the user, the session that shows up is the last session that new user logged in and not the new session you selected in the previous user

Approved by: Josh Arenson, Unity8 CI Bot

2781. By Albert Astals Cid

Add keyboard navigation for Indicators

Esc closes
Left/Right selects prev/next indicator

Approved by: Michael Zanetti, Unity8 CI Bot

2782. By Nick Dedekind

Added Alt+F10 shortcut to open app menus. (LP: #1656896)

Approved by: Albert Astals Cid, Unity8 CI Bot

2783. By Daniel d'Andrada

Simplify DecoratedWindow

Reduce the number of nested MouseAreas

Approved by: Nick Dedekind, Unity8 CI Bot

2784. By Nick Dedekind

Fixed menu layout width calculations. (LP: #1657050)

Approved by: Albert Astals Cid, Unity8 CI Bot

2785. By Michael Zanetti

hint the launcher to indicate a successful size change to the user (LP: #1646457)

Approved by: Lukáš Tinkl, Unity8 CI Bot

2786. By Lukáš Tinkl

Start searching directly as you type, w/o having to first focus/click the search field.

Approved by: Michael Zanetti, Unity8 CI Bot

2787. By Michael Zanetti

Improvements for the appdrawer

Allow cancelling of the reveal gesture
move the app store uri to a gsetting (LP: #1648173)

Approved by: Lukáš Tinkl, Unity8 CI Bot

2788. By Michael Zanetti

Adjust home key to still focus the dash instead of messing with the drawer

Approved by: Lukáš Tinkl

2789. By Albert Astals Cid

a window -> the current window

Approved by: Lukáš Tinkl

2790. By Lukáš Tinkl

Add a test for the real implementation of WindowStateStorage

Approved by: Albert Astals Cid, Unity8 CI Bot

2791. By Albert Astals Cid

There's no spreadDelegate_ anymore

Goes from ~9 to ~3 minutes

Approved by: Michael Zanetti, Unity8 CI Bot

2792. By Michael Terry

Fix grouping of autopkg output and allow optionally passing arguments to installed test scripts.

Approved by: Albert Astals Cid, Unity8 CI Bot

2793. By Lukáš Tinkl

Use a four finger gesture to open the drawer, much like in u7

Approved by: Michael Zanetti, Unity8 CI Bot

2794. By Michael Zanetti

allow 4 finger simulation with mousetouchadaptor

Approved by: Lukáš Tinkl, Unity8 CI Bot

2795. By Nick Dedekind

Skip Panel::test_drag_indicator_item_down_shows_menu

Approved by: Lukáš Tinkl, Michał Sawicz, Unity8 CI Bot

2796. By Daniel d'Andrada

Remove unnecessary warning message

It's being printed on every initialization for quite a while now and it's not prompting us
to perform any action. Thus this can't be really a warning if it's always there.

Approved by: Michael Zanetti, Unity8 CI Bot

2797. By CI Train Bot Account

Releasing 8.15+17.04.20170124-0ubuntu1

2798. By Launchpad Translations on behalf of unity-team

Launchpad automatic translations update.

2799. By Daniel d'Andrada

Initial support for child windows (menus, dialogs, tooltips)

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2017-01-10 14:46:09 +0000
+++ CMakeLists.txt 2017-01-19 15:00:39 +0000
@@ -70,7 +70,7 @@
70find_package(Qt5Concurrent 5.6 REQUIRED)70find_package(Qt5Concurrent 5.6 REQUIRED)
71find_package(Qt5Sql 5.6 REQUIRED)71find_package(Qt5Sql 5.6 REQUIRED)
7272
73pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=23)73pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=24)
74pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)74pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)
75pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)75pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
76pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)76pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
7777
=== modified file 'plugins/WindowManager/TopLevelWindowModel.cpp'
--- plugins/WindowManager/TopLevelWindowModel.cpp 2016-12-06 14:42:26 +0000
+++ plugins/WindowManager/TopLevelWindowModel.cpp 2017-01-19 15:00:39 +0000
@@ -176,18 +176,13 @@
176 // No point in signaling anything if we're resetting the whole model176 // No point in signaling anything if we're resetting the whole model
177 }177 }
178178
179 int id = generateId();179 Window *window = createWindow(surface);
180 Window *window = new Window(id, this);180
181 if (surface) {
182 window->setSurface(surface);
183 }
184 m_windowModel.prepend(ModelEntry(window, application));181 m_windowModel.prepend(ModelEntry(window, application));
185 if (surface) {182 if (surface) {
186 connectSurface(surface);183 connectSurface(surface);
187 }184 }
188185
189 connectWindow(window);
190
191 if (m_modelState == InsertingState) {186 if (m_modelState == InsertingState) {
192 endInsertRows();187 endInsertRows();
193 Q_EMIT countChanged();188 Q_EMIT countChanged();
@@ -322,34 +317,47 @@
322 }317 }
323}318}
324319
320Window *TopLevelWindowModel::createWindow(unityapi::MirSurfaceInterface *surface)
321{
322 int id = generateId();
323 Window *qmlWindow = new Window(id, this);
324 connectWindow(qmlWindow);
325 if (surface) {
326 qmlWindow->setSurface(surface);
327 }
328 return qmlWindow;
329}
330
325void TopLevelWindowModel::onSurfaceCreated(unityapi::MirSurfaceInterface *surface)331void TopLevelWindowModel::onSurfaceCreated(unityapi::MirSurfaceInterface *surface)
326{332{
327 DEBUG_MSG << "(" << surface << ")";333 DEBUG_MSG << "(" << surface << ")";
328 if (surface->type() == Mir::InputMethodType) {334
329 int id = generateId();335 if (surface->parentSurface()) {
330 Window *qmlWindow = new Window(id, this);336 // Wrap it in a Window so that we keep focusedWindow() up to date.
331 connectWindow(qmlWindow);337 Window *window = createWindow(surface);
332 qmlWindow->setSurface(surface);338 connect(surface, &QObject::destroyed, window, [=](){
333 setInputMethodWindow(qmlWindow);339 window->setSurface(nullptr);
340 window->deleteLater();
341 });
334 } else {342 } else {
335 auto application = m_applicationManager->findApplicationWithSurface(surface);343 if (surface->type() == Mir::InputMethodType) {
336 if (application) {344 setInputMethodWindow(createWindow(surface));
337 prependSurface(surface, application);
338 } else {345 } else {
339 // Must be a prompt session. No need to do add it as a prompt surface is not top-level.346 auto *application = m_applicationManager->findApplicationWithSurface(surface);
340 // It will show up in the ApplicationInfoInterface::promptSurfaceList of some application.347 if (application) {
341 // Still wrap it in a Window though, so that we keep focusedWindow() up to date.348 prependSurface(surface, application);
342 int id = generateId();349 } else {
343 Window *promptWindow = new Window(id, this);350 // Must be a prompt session. No need to do add it as a prompt surface is not top-level.
344 connectWindow(promptWindow);351 // It will show up in the ApplicationInfoInterface::promptSurfaceList of some application.
345 promptWindow->setSurface(surface);352 // Still wrap it in a Window though, so that we keep focusedWindow() up to date.
346 connect(surface, &QObject::destroyed, promptWindow, [=](){353 Window *promptWindow = createWindow(surface);
347 promptWindow->setSurface(nullptr);354 connect(surface, &QObject::destroyed, promptWindow, [=](){
348 promptWindow->deleteLater();355 promptWindow->setSurface(nullptr);
349 });356 promptWindow->deleteLater();
357 });
358 }
350 }359 }
351 }360 }
352 // TODO: handle surfaces that are neither top-level windows nor input method. eg: child dialogs, popups, menus
353}361}
354362
355void TopLevelWindowModel::removeAt(int index)363void TopLevelWindowModel::removeAt(int index)
356364
=== modified file 'plugins/WindowManager/TopLevelWindowModel.h'
--- plugins/WindowManager/TopLevelWindowModel.h 2016-12-06 14:42:26 +0000
+++ plugins/WindowManager/TopLevelWindowModel.h 2017-01-19 15:00:39 +0000
@@ -220,6 +220,8 @@
220220
221 void activateTopMostWindowWithoutId(int forbiddenId);221 void activateTopMostWindowWithoutId(int forbiddenId);
222222
223 Window *createWindow(unity::shell::application::MirSurfaceInterface *surface);
224
223 struct ModelEntry {225 struct ModelEntry {
224 ModelEntry() {}226 ModelEntry() {}
225 ModelEntry(Window *window,227 ModelEntry(Window *window,
226228
=== modified file 'plugins/WindowManager/Window.h'
--- plugins/WindowManager/Window.h 2016-11-30 19:24:02 +0000
+++ plugins/WindowManager/Window.h 2017-01-19 15:00:39 +0000
@@ -32,7 +32,6 @@
32 }32 }
33}33}
3434
35
36Q_DECLARE_LOGGING_CATEGORY(UNITY_WINDOW)35Q_DECLARE_LOGGING_CATEGORY(UNITY_WINDOW)
3736
38/**37/**
3938
=== modified file 'qml/Components/WindowControlButtons.qml'
--- qml/Components/WindowControlButtons.qml 2016-10-27 14:54:48 +0000
+++ qml/Components/WindowControlButtons.qml 2017-01-19 15:00:39 +0000
@@ -29,6 +29,7 @@
29 property bool windowIsMaximized: false29 property bool windowIsMaximized: false
30 property bool closeButtonShown: true30 property bool closeButtonShown: true
31 property bool maximizeButtonShown: true31 property bool maximizeButtonShown: true
32 property bool minimizeButtonVisible: true
32 property bool overlayShown33 property bool overlayShown
3334
34 signal closeClicked()35 signal closeClicked()
@@ -75,6 +76,7 @@
75 height: parent.height76 height: parent.height
76 width: height77 width: height
77 onClicked: root.minimizeClicked()78 onClicked: root.minimizeClicked()
79 visible: root.minimizeButtonVisible
7880
79 // We dont want touch events to fall through to parent,81 // We dont want touch events to fall through to parent,
80 // otherwise the containsMouse will not work.82 // otherwise the containsMouse will not work.
8183
=== added file 'qml/Stage/ChildWindow.qml'
--- qml/Stage/ChildWindow.qml 1970-01-01 00:00:00 +0000
+++ qml/Stage/ChildWindow.qml 2017-01-19 15:00:39 +0000
@@ -0,0 +1,159 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import Unity.Application 0.1
20
21Item {
22 id: root
23
24 // Set from outside.
25 property var surface
26 property Item boundsItem
27 property Item target
28 property alias requestedWidth: surfaceContainer.requestedWidth
29 property alias requestedHeight: surfaceContainer.requestedHeight
30
31 width: surface ? surface.size.width : 0
32 height: surface ? surface.size.height : 0
33
34 // Make it get shown and hidden with a fade in/out effect
35 opacity: surface && surface.state !== Mir.MinimizedState && surface.state !== Mir.HiddenState ? 1.0 : 0.0
36 Behavior on opacity { UbuntuNumberAnimation {} }
37 visible: opacity !== 0.0 // make it transparent to input as well
38
39 readonly property bool dragging: windowResizeArea.dragging || d.touchOverlayDragging || d.moveHandlerDragging
40
41 QtObject {
42 id: d
43 readonly property bool decorated: surface ? surface.type === Mir.UtilityType
44 || surface.type === Mir.DialogType
45 || surface.type === Mir.NormalType
46 : false
47
48 readonly property bool moveable: decorated
49 readonly property bool resizeable: decorated
50
51 property alias decoration: decorationLoader.item
52 property alias moveHandler: moveHandlerLoader.item
53
54 readonly property bool touchOverlayDragging: touchOverlayLoader.item ? touchOverlayLoader.item.dragging : false
55 readonly property bool moveHandlerDragging: moveHandlerLoader.item ? moveHandlerLoader.item.dragging : false
56 }
57
58 WindowResizeArea {
59 id: windowResizeArea
60 anchors {
61 top: decorationLoader.top
62 bottom: parent.bottom
63 left: parent.left; right: parent.right
64 }
65 target: root.target
66 boundsItem: root.boundsItem
67 minWidth: units.gu(10)
68 minHeight: units.gu(10)
69 borderThickness: units.gu(2)
70 enabled: d.resizeable
71 visible: enabled
72 onPressed: root.surface.activate();
73 }
74
75 BorderImage {
76 property real shadowThickness: root.surface && root.surface.focused ? units.gu(2) : units.gu(1.5)
77 anchors {
78 top: decorationLoader.top
79 bottom: parent.bottom
80 left: parent.left; right: parent.right
81 margins: -shadowThickness
82 }
83 source: "../graphics/dropshadow2gu.sci"
84 opacity: .3
85 }
86
87 Loader {
88 id: decorationLoader
89 anchors.bottom: root.top
90 anchors.left: root.left
91 anchors.right: root.right
92
93 visible: active
94 active: d.decorated
95
96 height: item ? item.height : 0
97
98 sourceComponent: Component {
99 WindowDecoration {
100 height: units.gu(3)
101 title: root.surface ? root.surface.name : ""
102 active: root.surface ? root.surface.focused : false
103 closeButtonVisible: false
104 minimizeButtonVisible: false
105 maximizeButtonShown: false
106 onPressed: root.surface.activate();
107 onPressedChanged: if (d.moveHandler) { d.moveHandler.handlePressedChanged(pressed, pressedButtons, mouseX, mouseY); }
108 onPositionChanged: if (d.moveHandler) {
109 d.moveHandler.handlePositionChanged(mouse);
110 }
111 onReleased: if (d.moveHandler) { d.moveHandler.handleReleased(); }
112 }
113 }
114 }
115
116 Loader {
117 id: moveHandlerLoader
118 active: d.moveable
119 sourceComponent: Component {
120 MoveHandler {
121 target: root.target
122 buttonsWidth: d.decoration ? d.decoration.buttonsWidth : 0
123 boundsItem: root.boundsItem
124 boundsTopMargin: decorationLoader.height
125 }
126 }
127 }
128
129 SurfaceContainer {
130 id: surfaceContainer
131
132 // Do not hold on to a dead surface so that it can be destroyed.
133 // FIXME It should not be QML's job to release the MirSurface if its backing surface goes away. Instead backing
134 // MirSurface should go away but the MirSurfaceItem should be able to live on with the last drawn frame
135 // and properties.
136 surface: root.surface && root.surface.live ? root.surface : null
137
138 requestedWidth: surface ? surface.size.width : 0
139 requestedHeight: surface ? surface.size.height : 0
140
141 // TODO ChildWindow parent will probably want to control those
142 interactive: true
143 consumesInput: true
144 }
145
146 Loader {
147 id: touchOverlayLoader
148 active: d.resizeable || d.moveable
149 anchors.top: decorationLoader.top
150 anchors.bottom: parent.bottom
151 anchors.left: parent.left
152 anchors.right: parent.right
153 sourceComponent: Component { WindowControlsOverlay {
154 target: root.target
155 resizeArea: windowResizeArea
156 boundsItem: root.boundsItem
157 } }
158 }
159}
0160
=== added file 'qml/Stage/ChildWindowRepeater.qml'
--- qml/Stage/ChildWindowRepeater.qml 1970-01-01 00:00:00 +0000
+++ qml/Stage/ChildWindowRepeater.qml 2017-01-19 15:00:39 +0000
@@ -0,0 +1,28 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18
19// Meant to be created with a Loader to circumvent the "ChildWindowTree is instantiated recursively" error from the QML engine
20Repeater {
21 id: root
22 property Item boundsItem
23 delegate: ChildWindowTree {
24 surface: model.surface
25 z: root.count - model.index
26 boundsItem: root.boundsItem
27 }
28}
029
=== added file 'qml/Stage/ChildWindowTree.qml'
--- qml/Stage/ChildWindowTree.qml 1970-01-01 00:00:00 +0000
+++ qml/Stage/ChildWindowTree.qml 2017-01-19 15:00:39 +0000
@@ -0,0 +1,127 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import Unity.Application 0.1
20
21Item {
22 id: root
23
24 property alias surface: childWindow.surface
25 property real displacementX: 0
26 property real displacementY: 0
27 property alias boundsItem: childWindow.boundsItem
28
29 x: surface ? surface.position.x + displacementX : 0
30 y: surface ? surface.position.y + displacementY : 0
31 width: childWindow.width
32 height: childWindow.height
33
34 ////
35 // API expected by MoveHandler (and some by WindowResizeArea as well)
36 readonly property bool maximized: false
37 readonly property bool maximizedLeft: false
38 readonly property bool maximizedRight: false
39 readonly property bool maximizedHorizontally: false
40 readonly property bool maximizedVertically: false
41 readonly property bool maximizedTopLeft: false
42 readonly property bool maximizedTopRight: false
43 readonly property bool maximizedBottomLeft: false
44 readonly property bool maximizedBottomRight: false
45 readonly property bool anyMaximized: maximized || maximizedLeft || maximizedRight || maximizedHorizontally || maximizedVertically ||
46 maximizedTopLeft || maximizedTopRight || maximizedBottomLeft || maximizedBottomRight
47
48 readonly property bool canBeCornerMaximized: false
49 readonly property bool canBeMaximizedLeftRight: false
50 readonly property bool canBeMaximized: false
51
52 readonly property var resizeArea: QtObject {
53 property real normalWidth: units.gu(1)
54 property real normalHeight: units.gu(1)
55 }
56
57 readonly property bool windowedTransitionRunning: false
58
59 // NB: those bindings will be overwritten by MoveHandler when you first move the window
60 property real windowedX: x
61 property real windowedY: y
62
63
64 property real restoredX
65 property real restoredY
66
67 state: "restored"
68 // end of API expected by MoveHandler
69 ////
70
71 ////
72 // API expected by WindowResizeArea
73 property real windowedWidth: childWindow.width
74 property real windowedHeight: childWindow.height
75 // end of API expected by WindowResizeArea
76 ////
77
78 ////
79 // API expected by WindowControlsOverlay
80 function activate() {
81 surface.activate();
82 }
83 // end of API expected by WindowControlsOverlay
84 ////
85
86 Binding {
87 target: root.surface
88 when: childWindow.dragging
89 property: "requestedPosition"
90 value: Qt.point(root.windowedX - root.displacementX,
91 root.windowedY - root.displacementY);
92 }
93
94 // It's a separate Item so that a window can be hid independently of its children
95 ChildWindow {
96 id: childWindow
97 target: root
98 requestedWidth: root.windowedWidth
99 requestedHeight: root.windowedHeight
100 }
101
102 Connections {
103 target: root.surface
104 onFocusRequested: {
105 root.surface.activate();
106 }
107 }
108
109 // Using a loader here mainly to circunvent the "ChildWindowTree is instantiated recursively" error from the QML engine
110 Loader {
111 id: childRepeaterLoader
112 source: "ChildWindowRepeater.qml"
113 active: root.surface && root.surface.childSurfaceList.count > 0
114 Binding {
115 target: childRepeaterLoader.item
116 when: childRepeaterLoader.item
117 property: "model"
118 value: root.surface ? root.surface.childSurfaceList : null
119 }
120 Binding {
121 target: childRepeaterLoader.item
122 when: childRepeaterLoader.item
123 property: "boundsItem"
124 value: root.boundsItem
125 }
126 }
127}
0128
=== modified file 'qml/Stage/DecoratedWindow.qml'
--- qml/Stage/DecoratedWindow.qml 2016-12-12 11:16:47 +0000
+++ qml/Stage/DecoratedWindow.qml 2017-01-19 15:00:39 +0000
@@ -67,8 +67,7 @@
67 readonly property int heightIncrement: !counterRotate ? applicationWindow.heightIncrement : applicationWindow.widthIncrement67 readonly property int heightIncrement: !counterRotate ? applicationWindow.heightIncrement : applicationWindow.widthIncrement
6868
69 property alias overlayShown: decoration.overlayShown69 property alias overlayShown: decoration.overlayShown
70 property alias stageWidth: moveHandler.stageWidth70 property alias boundsItem: moveHandler.boundsItem
71 property alias stageHeight: moveHandler.stageHeight
72 readonly property alias dragging: moveHandler.dragging71 readonly property alias dragging: moveHandler.dragging
7372
74 readonly property Item clientAreaItem: applicationWindow73 readonly property Item clientAreaItem: applicationWindow
@@ -196,18 +195,19 @@
196 ]195 ]
197 }196 }
198197
199 MouseArea {198 WindowDecoration {
199 id: decoration
200 closeButtonVisible: root.application.appId !== "unity8-dash"
201 objectName: "appWindowDecoration"
202
200 anchors { left: parent.left; top: parent.top; right: parent.right }203 anchors { left: parent.left; top: parent.top; right: parent.right }
201 height: units.gu(3)204 height: units.gu(3)
202205
206 title: applicationWindow.title
207
203 opacity: root.hasDecoration ? Math.min(1, root.showDecoration) : 0208 opacity: root.hasDecoration ? Math.min(1, root.showDecoration) : 0
204
205 Behavior on opacity { UbuntuNumberAnimation { } }209 Behavior on opacity { UbuntuNumberAnimation { } }
206210
207 drag.target: Item {}
208 drag.filterChildren: true
209 drag.threshold: 0
210
211 onPressed: root.decorationPressed();211 onPressed: root.decorationPressed();
212 onPressedChanged: moveHandler.handlePressedChanged(pressed, pressedButtons, mouseX, mouseY)212 onPressedChanged: moveHandler.handlePressedChanged(pressed, pressedButtons, mouseX, mouseY)
213 onPositionChanged: moveHandler.handlePositionChanged(mouse)213 onPositionChanged: moveHandler.handlePositionChanged(mouse)
@@ -216,47 +216,39 @@
216 moveHandler.handleReleased();216 moveHandler.handleReleased();
217 }217 }
218218
219 WindowDecoration {219 onCloseClicked: root.closeClicked();
220 id: decoration220 onMaximizeClicked: { root.decorationPressed(); root.maximizeClicked(); }
221 closeButtonVisible: root.application.appId !== "unity8-dash"221 onMaximizeHorizontallyClicked: { root.decorationPressed(); root.maximizeHorizontallyClicked(); }
222 objectName: "appWindowDecoration"222 onMaximizeVerticallyClicked: { root.decorationPressed(); root.maximizeVerticallyClicked(); }
223 anchors.fill: parent223 onMinimizeClicked: root.minimizeClicked();
224 title: applicationWindow.title224
225225 enableMenus: {
226 onCloseClicked: root.closeClicked();226 return active &&
227 onMaximizeClicked: { root.decorationPressed(); root.maximizeClicked(); }227 surface &&
228 onMaximizeHorizontallyClicked: { root.decorationPressed(); root.maximizeHorizontallyClicked(); }228 (PanelState.focusedPersistentSurfaceId === surface.persistentId && !PanelState.decorationsVisible)
229 onMaximizeVerticallyClicked: { root.decorationPressed(); root.maximizeVerticallyClicked(); }229 }
230 onMinimizeClicked: root.minimizeClicked();230 menu: sharedAppModel.model
231231
232 enableMenus: {232 Indicators.SharedUnityMenuModel {
233 return active &&233 id: sharedAppModel
234 surface &&234 property var menus: surface ? ApplicationMenuRegistry.getMenusForSurface(surface.persistentId) : []
235 (PanelState.focusedPersistentSurfaceId === surface.persistentId && !PanelState.decorationsVisible)235 property var menuService: menus.length > 0 ? menus[0] : undefined
236 }236
237 menu: sharedAppModel.model237 busName: menuService ? menuService.service : ""
238238 menuObjectPath: menuService && menuService.menuPath ? menuService.menuPath : ""
239 Indicators.SharedUnityMenuModel {239 actions: menuService && menuService.actionPath ? { "unity": menuService.actionPath } : {}
240 id: sharedAppModel240 }
241 property var menus: surface ? ApplicationMenuRegistry.getMenusForSurface(surface.persistentId) : []241
242 property var menuService: menus.length > 0 ? menus[0] : undefined242 Connections {
243243 target: ApplicationMenuRegistry
244 busName: menuService ? menuService.service : ""244 onSurfaceMenuRegistered: {
245 menuObjectPath: menuService && menuService.menuPath ? menuService.menuPath : ""245 if (surface && surfaceId === surface.persistentId) {
246 actions: menuService && menuService.actionPath ? { "unity": menuService.actionPath } : {}246 sharedAppModel.menus = Qt.binding(function() { return surface ? ApplicationMenuRegistry.getMenusForSurface(surface.persistentId) : [] });
247 }
248
249 Connections {
250 target: ApplicationMenuRegistry
251 onSurfaceMenuRegistered: {
252 if (surface && surfaceId === surface.persistentId) {
253 sharedAppModel.menus = Qt.binding(function() { return surface ? ApplicationMenuRegistry.getMenusForSurface(surface.persistentId) : [] });
254 }
255 }247 }
256 onSurfaceMenuUnregistered: {248 }
257 if (surface && surfaceId === surface.persistentId) {249 onSurfaceMenuUnregistered: {
258 sharedAppModel.menus = Qt.binding(function() { return surface ? ApplicationMenuRegistry.getMenusForSurface(surface.persistentId) : [] });250 if (surface && surfaceId === surface.persistentId) {
259 }251 sharedAppModel.menus = Qt.binding(function() { return surface ? ApplicationMenuRegistry.getMenusForSurface(surface.persistentId) : [] });
260 }252 }
261 }253 }
262 }254 }
263255
=== modified file 'qml/Stage/MoveHandler.qml'
--- qml/Stage/MoveHandler.qml 2016-12-12 16:45:09 +0000
+++ qml/Stage/MoveHandler.qml 2017-01-19 15:00:39 +0000
@@ -19,15 +19,14 @@
19import Ubuntu.Components 1.319import Ubuntu.Components 1.3
20import Utils 0.120import Utils 0.1
21import "../Components"21import "../Components"
22import "../Components/PanelState"
2322
24QtObject {23QtObject {
25 id: root24 id: root
2625
27 property Item target // appDelegate26 property Item target // appDelegate
28 property int stageWidth
29 property int stageHeight
30 property real buttonsWidth: 027 property real buttonsWidth: 0
28 property Item boundsItem
29 property real boundsTopMargin: 0
3130
32 readonly property bool dragging: priv.dragging31 readonly property bool dragging: priv.dragging
3332
@@ -79,7 +78,10 @@
79 // length of the triggerArea square diagonal78 // length of the triggerArea square diagonal
80 var diagLength = Math.sqrt(2 * priv.triggerArea * priv.triggerArea);79 var diagLength = Math.sqrt(2 * priv.triggerArea * priv.triggerArea);
81 var ratio = 1 - (distance / diagLength);80 var ratio = 1 - (distance / diagLength);
82 return bx > 0 && bx <= stageWidth && by > 0 && by <= stageHeight ? ratio : 1; // everything "outside" of our square from the center is 181
82 // everything "outside" of our square from the center is 1
83 var mousePosBoundsCoords = target.mapToItem(root.boundsItem, bx, by);
84 return root.boundsItem.contains(mousePosBoundsCoords) ? ratio : 1;
83 }85 }
84 property real progress: 086 property real progress: 0
85 }87 }
@@ -117,35 +119,38 @@
117 target.requestRestore();119 target.requestRestore();
118 }120 }
119121
120 var pos = mapToItem(target.parent, mouse.x, mouse.y);122 var pos = mapToItem(target.parent, mouse.x, mouse.y); // How can that work if we're just a QtObject (not an Item)?
123 var bounds = boundsItem.mapToItem(target.parent, 0, 0, boundsItem.width, boundsItem.height);
124 bounds.y += boundsTopMargin;
125 bounds.height -= boundsTopMargin;
121 // Use integer coordinate values to ensure that target is left in a pixel-aligned126 // Use integer coordinate values to ensure that target is left in a pixel-aligned
122 // position. Mouse movement could have subpixel precision, yielding a fractional127 // position. Mouse movement could have subpixel precision, yielding a fractional
123 // mouse position.128 // mouse position.
124 target.windowedX = Math.round(pos.x - priv.distanceX);129 target.windowedX = Math.round(pos.x - priv.distanceX);
125 target.windowedY = Math.round(Math.max(pos.y - priv.distanceY, PanelState.panelHeight));130 target.windowedY = Math.round(Math.max(pos.y - priv.distanceY, bounds.top));
126131
127 if (sensingPoints) { // edge/corner detection when dragging via the touch overlay132 if (sensingPoints) { // edge/corner detection when dragging via the touch overlay
128 if (sensingPoints.topLeft.x < priv.triggerArea && sensingPoints.topLeft.y < PanelState.panelHeight + priv.triggerArea133 if (sensingPoints.topLeft.x < priv.triggerArea && sensingPoints.topLeft.y < bounds.top + priv.triggerArea
129 && target.canBeCornerMaximized) { // top left134 && target.canBeCornerMaximized) { // top left
130 priv.progress = priv.progressInCorner(0, PanelState.panelHeight, sensingPoints.topLeft.x, sensingPoints.topLeft.y);135 priv.progress = priv.progressInCorner(bounds.left, bounds.top, sensingPoints.topLeft.x, sensingPoints.topLeft.y);
131 priv.resetEdges();136 priv.resetEdges();
132 priv.nearTopLeftCorner = true;137 priv.nearTopLeftCorner = true;
133 root.fakeMaximizeTopLeftAnimationRequested(priv.progress);138 root.fakeMaximizeTopLeftAnimationRequested(priv.progress);
134 } else if (sensingPoints.topRight.x > stageWidth - priv.triggerArea && sensingPoints.topRight.y < PanelState.panelHeight + priv.triggerArea139 } else if (sensingPoints.topRight.x > bounds.right - priv.triggerArea && sensingPoints.topRight.y < bounds.top + priv.triggerArea
135 && target.canBeCornerMaximized) { // top right140 && target.canBeCornerMaximized) { // top right
136 priv.progress = priv.progressInCorner(stageWidth, PanelState.panelHeight, sensingPoints.topRight.x, sensingPoints.topRight.y);141 priv.progress = priv.progressInCorner(bounds.right, bounds.top, sensingPoints.topRight.x, sensingPoints.topRight.y);
137 priv.resetEdges();142 priv.resetEdges();
138 priv.nearTopRightCorner = true;143 priv.nearTopRightCorner = true;
139 root.fakeMaximizeTopRightAnimationRequested(priv.progress);144 root.fakeMaximizeTopRightAnimationRequested(priv.progress);
140 } else if (sensingPoints.bottomLeft.x < priv.triggerArea && sensingPoints.bottomLeft.y > stageHeight - priv.triggerArea145 } else if (sensingPoints.bottomLeft.x < priv.triggerArea && sensingPoints.bottomLeft.y > bounds.bottom - priv.triggerArea
141 && target.canBeCornerMaximized) { // bottom left146 && target.canBeCornerMaximized) { // bottom left
142 priv.progress = priv.progressInCorner(0, stageHeight, sensingPoints.bottomLeft.x, sensingPoints.bottomLeft.y);147 priv.progress = priv.progressInCorner(bounds.left, bounds.bottom, sensingPoints.bottomLeft.x, sensingPoints.bottomLeft.y);
143 priv.resetEdges();148 priv.resetEdges();
144 priv.nearBottomLeftCorner = true;149 priv.nearBottomLeftCorner = true;
145 root.fakeMaximizeBottomLeftAnimationRequested(priv.progress);150 root.fakeMaximizeBottomLeftAnimationRequested(priv.progress);
146 } else if (sensingPoints.bottomRight.x > stageWidth - priv.triggerArea && sensingPoints.bottomRight.y > stageHeight - priv.triggerArea151 } else if (sensingPoints.bottomRight.x > bounds.right - priv.triggerArea && sensingPoints.bottomRight.y > bounds.bottom - priv.triggerArea
147 && target.canBeCornerMaximized) { // bottom right152 && target.canBeCornerMaximized) { // bottom right
148 priv.progress = priv.progressInCorner(stageWidth, stageHeight, sensingPoints.bottomRight.x, sensingPoints.bottomRight.y);153 priv.progress = priv.progressInCorner(bounds.right, bounds.bottom, sensingPoints.bottomRight.x, sensingPoints.bottomRight.y);
149 priv.resetEdges();154 priv.resetEdges();
150 priv.nearBottomRightCorner = true;155 priv.nearBottomRightCorner = true;
151 root.fakeMaximizeBottomRightAnimationRequested(priv.progress);156 root.fakeMaximizeBottomRightAnimationRequested(priv.progress);
@@ -154,13 +159,13 @@
154 priv.resetEdges();159 priv.resetEdges();
155 priv.nearLeftEdge = true;160 priv.nearLeftEdge = true;
156 root.fakeMaximizeLeftAnimationRequested(priv.progress);161 root.fakeMaximizeLeftAnimationRequested(priv.progress);
157 } else if (sensingPoints.right.x > stageWidth - priv.triggerArea && target.canBeMaximizedLeftRight) { // right162 } else if (sensingPoints.right.x > bounds.right - priv.triggerArea && target.canBeMaximizedLeftRight) { // right
158 priv.progress = MathUtils.clampAndProject(sensingPoints.right.x, stageWidth - priv.triggerArea, stageWidth, 0, 1);163 priv.progress = MathUtils.clampAndProject(sensingPoints.right.x, bounds.right - priv.triggerArea, bounds.right, 0, 1);
159 priv.resetEdges();164 priv.resetEdges();
160 priv.nearRightEdge = true;165 priv.nearRightEdge = true;
161 root.fakeMaximizeRightAnimationRequested(priv.progress);166 root.fakeMaximizeRightAnimationRequested(priv.progress);
162 } else if (sensingPoints.top.y < PanelState.panelHeight + priv.triggerArea && target.canBeMaximized) { // top167 } else if (sensingPoints.top.y < bounds.top + priv.triggerArea && target.canBeMaximized) { // top
163 priv.progress = MathUtils.clampAndProject(sensingPoints.top.y, PanelState.panelHeight + priv.triggerArea, 0, 0, 1);168 priv.progress = MathUtils.clampAndProject(sensingPoints.top.y, bounds.top + priv.triggerArea, 0, 0, 1);
164 priv.resetEdges();169 priv.resetEdges();
165 priv.nearTopEdge = true;170 priv.nearTopEdge = true;
166 root.fakeMaximizeAnimationRequested(priv.progress);171 root.fakeMaximizeAnimationRequested(priv.progress);
167172
=== modified file 'qml/Stage/Stage.qml'
--- qml/Stage/Stage.qml 2017-01-03 12:04:08 +0000
+++ qml/Stage/Stage.qml 2017-01-19 15:00:39 +0000
@@ -665,6 +665,13 @@
665 }665 }
666 }666 }
667667
668 Item {
669 id: boundariesForWindowPlacement
670 anchors.fill: parent
671 anchors.topMargin: PanelState.panelHeight
672 visible: false
673 }
674
668 Repeater {675 Repeater {
669 id: appRepeater676 id: appRepeater
670 model: topLevelSurfaceList677 model: topLevelSurfaceList
@@ -833,7 +840,6 @@
833 readonly property var surface: model.window.surface840 readonly property var surface: model.window.surface
834 readonly property var window: model.window841 readonly property var window: model.window
835842
836 readonly property alias resizeArea: resizeArea
837 readonly property alias focusedSurface: decoratedWindow.focusedSurface843 readonly property alias focusedSurface: decoratedWindow.focusedSurface
838 readonly property bool dragging: touchControls.overlayShown ? touchControls.dragging : decoratedWindow.dragging844 readonly property bool dragging: touchControls.overlayShown ? touchControls.dragging : decoratedWindow.dragging
839845
@@ -890,7 +896,7 @@
890 screenWidth: appContainer.width896 screenWidth: appContainer.width
891 screenHeight: appContainer.height897 screenHeight: appContainer.height
892 leftMargin: root.leftMargin898 leftMargin: root.leftMargin
893 minimumY: PanelState.panelHeight899 minimumY: boundariesForWindowPlacement.y
894 }900 }
895901
896 Connections {902 Connections {
@@ -1520,7 +1526,7 @@
1520 anchors.margins: touchControls.overlayShown ? borderThickness/2 : -borderThickness1526 anchors.margins: touchControls.overlayShown ? borderThickness/2 : -borderThickness
15211527
1522 target: appDelegate1528 target: appDelegate
1523 minimumY: PanelState.panelHeight // disallow resizing up past Panel1529 boundsItem: boundariesForWindowPlacement
1524 minWidth: units.gu(10)1530 minWidth: units.gu(10)
1525 minHeight: units.gu(10)1531 minHeight: units.gu(10)
1526 borderThickness: units.gu(2)1532 borderThickness: units.gu(2)
@@ -1539,7 +1545,7 @@
1539 anchors.top: appDelegate.top1545 anchors.top: appDelegate.top
1540 application: model.application1546 application: model.application
1541 surface: model.window.surface1547 surface: model.window.surface
1542 active: appDelegate.focus1548 active: model.window.focused
1543 focus: true1549 focus: true
1544 interactive: root.interactive1550 interactive: root.interactive
1545 showDecoration: 11551 showDecoration: 1
@@ -1548,8 +1554,7 @@
1548 width: implicitWidth1554 width: implicitWidth
1549 height: implicitHeight1555 height: implicitHeight
1550 highlightSize: windowInfoItem.iconMargin / 21556 highlightSize: windowInfoItem.iconMargin / 2
1551 stageWidth: appContainer.width1557 boundsItem: boundariesForWindowPlacement
1552 stageHeight: appContainer.height
15531558
1554 requestedWidth: appDelegate.requestedWidth1559 requestedWidth: appDelegate.requestedWidth
1555 requestedHeight: appDelegate.requestedHeight1560 requestedHeight: appDelegate.requestedHeight
@@ -1604,11 +1609,12 @@
16041609
1605 WindowControlsOverlay {1610 WindowControlsOverlay {
1606 id: touchControls1611 id: touchControls
1612 anchors.fill: appDelegate
1607 target: appDelegate1613 target: appDelegate
1614 resizeArea: resizeArea
1608 enabled: false1615 enabled: false
1609 visible: enabled1616 visible: enabled
1610 stageWidth: appContainer.width1617 boundsItem: boundariesForWindowPlacement
1611 stageHeight: appContainer.height
16121618
1613 onFakeMaximizeAnimationRequested: if (!appDelegate.maximized) fakeRectangle.maximize(amount, true)1619 onFakeMaximizeAnimationRequested: if (!appDelegate.maximized) fakeRectangle.maximize(amount, true)
1614 onFakeMaximizeLeftAnimationRequested: if (!appDelegate.maximizedLeft) fakeRectangle.maximizeLeft(amount, true)1620 onFakeMaximizeLeftAnimationRequested: if (!appDelegate.maximizedLeft) fakeRectangle.maximizeLeft(amount, true)
@@ -1703,6 +1709,41 @@
1703 sourceSize.height: height1709 sourceSize.height: height
1704 }1710 }
1705 }1711 }
1712
1713 Item {
1714 // Group all child windows in this item so that we can fade them out together when going to the spread
1715 // (and fade them in back again when returning from it)
1716 readonly property bool stageOnProperState: root.state === "windowed"
1717 || root.state === "staged"
1718 || root.state === "stagedWithSideStage"
1719
1720 // TODO: Is it worth the extra cost of layering to avoid the opacity artifacts of intersecting children?
1721 // Btw, will involve more than uncommenting the line below as children won't necessarily fit this item's
1722 // geometry. This is just a reference.
1723 //layer.enabled: opacity !== 0.0 && opacity !== 1.0
1724
1725 opacity: stageOnProperState ? 1.0 : 0.0
1726 visible: opacity !== 0.0 // make it transparent to input as well
1727 Behavior on opacity { UbuntuNumberAnimation {} }
1728
1729 Repeater {
1730 id: childWindowRepeater
1731 model: appDelegate.surface ? appDelegate.surface.childSurfaceList : null
1732
1733 delegate: ChildWindowTree {
1734 surface: model.surface
1735
1736 // Account for the displacement caused by window decoration in the top-level surface
1737 // Ie, the top-level surface is not positioned at (0,0) of this ChildWindow's parent (appDelegate)
1738 displacementX: appDelegate.clientAreaItem.x
1739 displacementY: appDelegate.clientAreaItem.y
1740
1741 boundsItem: boundariesForWindowPlacement
1742
1743 z: childWindowRepeater.count - model.index
1744 }
1745 }
1746 }
1706 }1747 }
1707 }1748 }
1708 }1749 }
17091750
=== modified file 'qml/Stage/WindowControlsOverlay.qml'
--- qml/Stage/WindowControlsOverlay.qml 2016-12-27 22:09:12 +0000
+++ qml/Stage/WindowControlsOverlay.qml 2017-01-19 15:00:39 +0000
@@ -18,17 +18,14 @@
18import Ubuntu.Components 1.318import Ubuntu.Components 1.3
19import Ubuntu.Gestures 0.119import Ubuntu.Gestures 0.1
20import Unity.Application 0.120import Unity.Application 0.1
21import "../Components/PanelState"
2221
23Item {22Item {
24 id: root23 id: root
25 enabled: target && !target.fullscreen
26 anchors.fill: target
2724
28 // to be set from outside25 // to be set from outside
29 property Item target // appDelegate26 property Item target // appDelegate
30 property alias stageWidth: moveHandler.stageWidth27 property WindowResizeArea resizeArea
31 property alias stageHeight: moveHandler.stageHeight28 property Item boundsItem
3229
33 // to be read from outside30 // to be read from outside
34 readonly property alias overlayShown: overlay.visible31 readonly property alias overlayShown: overlay.visible
@@ -90,9 +87,7 @@
9087
91 QtObject {88 QtObject {
92 id: priv89 id: priv
93 readonly property var resizeArea: root.target && root.target.resizeArea ? root.target.resizeArea : null90 readonly property bool dragging: moveHandler.dragging || (root.resizeArea && root.resizeArea.dragging)
94 readonly property bool ensureWindow: root.target.state == "normal" || root.target.state == "restored"
95 readonly property bool dragging: moveHandler.dragging || (resizeArea && resizeArea.dragging)
9691
97 function getSensingPoints() {92 function getSensingPoints() {
98 var xPoints = [];93 var xPoints = [];
@@ -162,6 +157,8 @@
162 objectName: "moveHandler"157 objectName: "moveHandler"
163 target: root.target158 target: root.target
164159
160 boundsItem: root.boundsItem
161
165 onFakeMaximizeAnimationRequested: root.fakeMaximizeAnimationRequested(amount)162 onFakeMaximizeAnimationRequested: root.fakeMaximizeAnimationRequested(amount)
166 onFakeMaximizeLeftAnimationRequested: root.fakeMaximizeLeftAnimationRequested(amount)163 onFakeMaximizeLeftAnimationRequested: root.fakeMaximizeLeftAnimationRequested(amount)
167 onFakeMaximizeRightAnimationRequested: root.fakeMaximizeRightAnimationRequested(amount)164 onFakeMaximizeRightAnimationRequested: root.fakeMaximizeRightAnimationRequested(amount)
@@ -193,65 +190,65 @@
193 ResizeGrip { // top left190 ResizeGrip { // top left
194 anchors.horizontalCenter: parent.left191 anchors.horizontalCenter: parent.left
195 anchors.verticalCenter: parent.top192 anchors.verticalCenter: parent.top
196 visible: priv.ensureWindow || target.maximizedBottomRight193 visible: root.enabled || target.maximizedBottomRight
197 resizeTarget: priv.resizeArea194 resizeTarget: root.resizeArea
198 }195 }
199196
200 ResizeGrip { // top center197 ResizeGrip { // top center
201 anchors.horizontalCenter: parent.horizontalCenter198 anchors.horizontalCenter: parent.horizontalCenter
202 anchors.verticalCenter: parent.top199 anchors.verticalCenter: parent.top
203 rotation: 45200 rotation: 45
204 visible: priv.ensureWindow || target.maximizedHorizontally || target.maximizedBottomLeft || target.maximizedBottomRight201 visible: root.enabled || target.maximizedHorizontally || target.maximizedBottomLeft || target.maximizedBottomRight
205 resizeTarget: priv.resizeArea202 resizeTarget: root.resizeArea
206 }203 }
207204
208 ResizeGrip { // top right205 ResizeGrip { // top right
209 anchors.horizontalCenter: parent.right206 anchors.horizontalCenter: parent.right
210 anchors.verticalCenter: parent.top207 anchors.verticalCenter: parent.top
211 rotation: 90208 rotation: 90
212 visible: priv.ensureWindow || target.maximizedBottomLeft209 visible: root.enabled || target.maximizedBottomLeft
213 resizeTarget: priv.resizeArea210 resizeTarget: root.resizeArea
214 }211 }
215212
216 ResizeGrip { // right213 ResizeGrip { // right
217 anchors.horizontalCenter: parent.right214 anchors.horizontalCenter: parent.right
218 anchors.verticalCenter: parent.verticalCenter215 anchors.verticalCenter: parent.verticalCenter
219 rotation: 135216 rotation: 135
220 visible: priv.ensureWindow || target.maximizedVertically || target.maximizedLeft ||217 visible: root.enabled || target.maximizedVertically || target.maximizedLeft ||
221 target.maximizedTopLeft || target.maximizedBottomLeft218 target.maximizedTopLeft || target.maximizedBottomLeft
222 resizeTarget: priv.resizeArea219 resizeTarget: root.resizeArea
223 }220 }
224221
225 ResizeGrip { // bottom right222 ResizeGrip { // bottom right
226 anchors.horizontalCenter: parent.right223 anchors.horizontalCenter: parent.right
227 anchors.verticalCenter: parent.bottom224 anchors.verticalCenter: parent.bottom
228 visible: priv.ensureWindow || target.maximizedTopLeft225 visible: root.enabled || target.maximizedTopLeft
229 resizeTarget: priv.resizeArea226 resizeTarget: root.resizeArea
230 }227 }
231228
232 ResizeGrip { // bottom center229 ResizeGrip { // bottom center
233 anchors.horizontalCenter: parent.horizontalCenter230 anchors.horizontalCenter: parent.horizontalCenter
234 anchors.verticalCenter: parent.bottom231 anchors.verticalCenter: parent.bottom
235 rotation: 45232 rotation: 45
236 visible: priv.ensureWindow || target.maximizedHorizontally || target.maximizedTopLeft || target.maximizedTopRight233 visible: root.enabled || target.maximizedHorizontally || target.maximizedTopLeft || target.maximizedTopRight
237 resizeTarget: priv.resizeArea234 resizeTarget: root.resizeArea
238 }235 }
239236
240 ResizeGrip { // bottom left237 ResizeGrip { // bottom left
241 anchors.horizontalCenter: parent.left238 anchors.horizontalCenter: parent.left
242 anchors.verticalCenter: parent.bottom239 anchors.verticalCenter: parent.bottom
243 rotation: 90240 rotation: 90
244 visible: priv.ensureWindow || target.maximizedTopRight241 visible: root.enabled || target.maximizedTopRight
245 resizeTarget: priv.resizeArea242 resizeTarget: root.resizeArea
246 }243 }
247244
248 ResizeGrip { // left245 ResizeGrip { // left
249 anchors.horizontalCenter: parent.left246 anchors.horizontalCenter: parent.left
250 anchors.verticalCenter: parent.verticalCenter247 anchors.verticalCenter: parent.verticalCenter
251 rotation: 135248 rotation: 135
252 visible: priv.ensureWindow || target.maximizedVertically || target.maximizedRight ||249 visible: root.enabled || target.maximizedVertically || target.maximizedRight ||
253 target.maximizedTopRight || target.maximizedBottomRight250 target.maximizedTopRight || target.maximizedBottomRight
254 resizeTarget: priv.resizeArea251 resizeTarget: root.resizeArea
255 }252 }
256 }253 }
257}254}
258255
=== modified file 'qml/Stage/WindowDecoration.qml'
--- qml/Stage/WindowDecoration.qml 2016-12-12 11:16:47 +0000
+++ qml/Stage/WindowDecoration.qml 2017-01-19 15:00:39 +0000
@@ -28,6 +28,7 @@
28 property alias closeButtonVisible: buttons.closeButtonShown28 property alias closeButtonVisible: buttons.closeButtonShown
29 property alias title: titleLabel.text29 property alias title: titleLabel.text
30 property alias maximizeButtonShown: buttons.maximizeButtonShown30 property alias maximizeButtonShown: buttons.maximizeButtonShown
31 property alias minimizeButtonVisible: buttons.minimizeButtonVisible
31 property bool active: false32 property bool active: false
32 property alias overlayShown: buttons.overlayShown33 property alias overlayShown: buttons.overlayShown
33 property var menu: undefined34 property var menu: undefined
@@ -38,6 +39,10 @@
38 acceptedButtons: Qt.AllButtons // prevent leaking unhandled mouse events39 acceptedButtons: Qt.AllButtons // prevent leaking unhandled mouse events
39 hoverEnabled: true40 hoverEnabled: true
4041
42 drag.target: Item {}
43 drag.filterChildren: true
44 drag.threshold: 0
45
41 signal closeClicked()46 signal closeClicked()
42 signal minimizeClicked()47 signal minimizeClicked()
43 signal maximizeClicked()48 signal maximizeClicked()
@@ -64,8 +69,8 @@
64 (menuBar.showRequested || root.containsMouse)69 (menuBar.showRequested || root.containsMouse)
65 }70 }
6671
67 // We dont want touch events to fall through to parent,72 // We dont want touch events to fall through to parent as it expect some child MouseArea to have them
68 // otherwise the containsMouse will not work.73 // If not some MouseArea in the menu bar, it will be this one.
69 MouseArea {74 MouseArea {
70 anchors.fill: parent75 anchors.fill: parent
71 propagateComposedEvents: true76 propagateComposedEvents: true
7277
=== modified file 'qml/Stage/WindowResizeArea.qml'
--- qml/Stage/WindowResizeArea.qml 2016-12-12 16:45:09 +0000
+++ qml/Stage/WindowResizeArea.qml 2017-01-19 15:00:39 +0000
@@ -32,7 +32,7 @@
32 // The area will anchor to it and manage resize events32 // The area will anchor to it and manage resize events
33 property Item target: null33 property Item target: null
34 property int borderThickness: 034 property int borderThickness: 0
35 property real minimumY: -100000000 // By default, impose no limit35 property Item boundsItem
36 property int minWidth: 036 property int minWidth: 0
37 property int minHeight: 037 property int minHeight: 0
3838
@@ -243,7 +243,8 @@
243 }243 }
244244
245 if (d.topBorder) {245 if (d.topBorder) {
246 var newTargetY = Math.max(d.startY + deltaY, root.minimumY);246 var bounds = boundsItem.mapToItem(target.parent, 0, 0, boundsItem.width, boundsItem.height);
247 var newTargetY = Math.max(d.startY + deltaY, bounds.y);
247 var bottomBorderY = target.windowedY + target.height;248 var bottomBorderY = target.windowedY + target.height;
248 if (bottomBorderY > newTargetY + d.minimumHeight) {249 if (bottomBorderY > newTargetY + d.minimumHeight) {
249 if (bottomBorderY < newTargetY + d.maximumHeight) {250 if (bottomBorderY < newTargetY + d.maximumHeight) {
250251
=== modified file 'tests/mocks/Unity/Application/ApplicationInfo.cpp'
--- tests/mocks/Unity/Application/ApplicationInfo.cpp 2016-12-20 15:50:41 +0000
+++ tests/mocks/Unity/Application/ApplicationInfo.cpp 2017-01-19 15:00:39 +0000
@@ -94,6 +94,7 @@
94 auto surface = surfaceManager->createSurface(QString("prompt foo"),94 auto surface = surfaceManager->createSurface(QString("prompt foo"),
95 Mir::NormalType,95 Mir::NormalType,
96 Mir::RestoredState,96 Mir::RestoredState,
97 nullptr, /* parentSurface */
97 screenshotUrl);98 screenshotUrl);
98 surfaceManager->notifySurfaceCreated(surface);99 surfaceManager->notifySurfaceCreated(surface);
99100
@@ -122,7 +123,9 @@
122 auto surface = surfaceManager->createSurface(surfaceName,123 auto surface = surfaceManager->createSurface(surfaceName,
123 Mir::NormalType,124 Mir::NormalType,
124 fullscreen() ? Mir::FullscreenState : Mir::RestoredState,125 fullscreen() ? Mir::FullscreenState : Mir::RestoredState,
125 m_screenshotFileName);126 nullptr, /* parentSurface */
127 m_screenshotFileName,
128 m_qmlFilePath);
126129
127 surface->setShellChrome(m_shellChrome);130 surface->setShellChrome(m_shellChrome);
128131
@@ -201,6 +204,11 @@
201 }204 }
202}205}
203206
207void ApplicationInfo::setQmlFilename(const QString &qmlFilename)
208{
209 m_qmlFilePath = QString("qrc:///Unity/Application/%1").arg(qmlFilename);
210}
211
204void ApplicationInfo::setName(const QString &value)212void ApplicationInfo::setName(const QString &value)
205{213{
206 if (value != m_name) {214 if (value != m_name) {
207215
=== modified file 'tests/mocks/Unity/Application/ApplicationInfo.h'
--- tests/mocks/Unity/Application/ApplicationInfo.h 2016-12-23 11:05:09 +0000
+++ tests/mocks/Unity/Application/ApplicationInfo.h 2017-01-19 15:00:39 +0000
@@ -29,6 +29,7 @@
2929
30#include <QList>30#include <QList>
31#include <QTimer>31#include <QTimer>
32#include <QUrl>
3233
33using namespace unity::shell::application;34using namespace unity::shell::application;
3435
@@ -58,6 +59,7 @@
5859
59 void setIconId(const QString &iconId);60 void setIconId(const QString &iconId);
60 void setScreenshotId(const QString &screenshotId);61 void setScreenshotId(const QString &screenshotId);
62 void setQmlFilename(const QString &);
6163
62 void setAppId(const QString &value) { m_appId = value; }64 void setAppId(const QString &value) { m_appId = value; }
63 QString appId() const override { return m_appId; }65 QString appId() const override { return m_appId; }
@@ -152,6 +154,7 @@
152 QList<MirSurface*> m_closingSurfaces;154 QList<MirSurface*> m_closingSurfaces;
153 bool m_manualSurfaceCreation{false};155 bool m_manualSurfaceCreation{false};
154 Mir::ShellChrome m_shellChrome{Mir::NormalChrome};156 Mir::ShellChrome m_shellChrome{Mir::NormalChrome};
157 QUrl m_qmlFilePath;
155};158};
156159
157Q_DECLARE_METATYPE(ApplicationInfo*)160Q_DECLARE_METATYPE(ApplicationInfo*)
158161
=== modified file 'tests/mocks/Unity/Application/ApplicationManager.cpp'
--- tests/mocks/Unity/Application/ApplicationManager.cpp 2016-12-07 11:19:17 +0000
+++ tests/mocks/Unity/Application/ApplicationManager.cpp 2017-01-19 15:00:39 +0000
@@ -480,6 +480,15 @@
480 application->setName("Primary Oriented");480 application->setName("Primary Oriented");
481 application->setSupportedOrientations(Qt::PrimaryOrientation);481 application->setSupportedOrientations(Qt::PrimaryOrientation);
482 m_availableApplications.append(application);482 m_availableApplications.append(application);
483
484 application = new ApplicationInfo(this);
485 application->setAppId("kate");
486 application->setName("Kate");
487 application->setIconId("libreoffice");
488 application->setScreenshotId("libreoffice");
489 application->setQmlFilename("Kate.qml");
490 application->setIsTouchApp(false);
491 m_availableApplications.append(application);
483}492}
484493
485494
486495
=== modified file 'tests/mocks/Unity/Application/MirSurface.cpp'
--- tests/mocks/Unity/Application/MirSurface.cpp 2016-12-02 18:15:36 +0000
+++ tests/mocks/Unity/Application/MirSurface.cpp 2017-01-19 15:00:39 +0000
@@ -74,6 +74,7 @@
74MirSurface::MirSurface(const QString& name,74MirSurface::MirSurface(const QString& name,
75 Mir::Type type,75 Mir::Type type,
76 Mir::State state,76 Mir::State state,
77 MirSurface *parentSurface,
77 const QUrl& screenshot,78 const QUrl& screenshot,
78 const QUrl &qmlFilePath)79 const QUrl &qmlFilePath)
79 : unity::shell::application::MirSurfaceInterface(nullptr)80 : unity::shell::application::MirSurfaceInterface(nullptr)
@@ -90,6 +91,8 @@
90 , m_height(-1)91 , m_height(-1)
91 , m_slowToResize(false)92 , m_slowToResize(false)
92 , m_shellChrome(Mir::NormalChrome)93 , m_shellChrome(Mir::NormalChrome)
94 , m_parentSurface(parentSurface)
95 , m_childSurfaceList(new MirSurfaceListModel(this))
93{96{
94 DEBUG_MSG("state=" << stateToStr(state));97 DEBUG_MSG("state=" << stateToStr(state));
9598
@@ -493,6 +496,36 @@
493 }496 }
494}497}
495498
499void MirSurface::openMenu(qreal x, qreal y, qreal width, qreal height)
500{
501 auto *menu = SurfaceManager::instance()->createSurface("menu", Mir::MenuType, Mir::HiddenState,
502 this /* parentSurface */,
503 QUrl() /* screenshot */,
504 QUrl("qrc:///Unity/Application/KateMenu.qml"));
505
506 menu->setRequestedPosition(QPoint(x,y));
507 menu->resize(width, height);
508 menu->requestState(Mir::RestoredState);
509
510 SurfaceManager::instance()->notifySurfaceCreated(menu);
511}
512
513void MirSurface::openDialog(qreal x, qreal y, qreal width, qreal height)
514{
515 auto *dialog = SurfaceManager::instance()->createSurface("dialog", Mir::DialogType, Mir::HiddenState,
516 this /* parentSurface */,
517 QUrl() /* screenshot */,
518 QUrl("qrc:///Unity/Application/KateDialog.qml"));
519
520 dialog->setRequestedPosition(QPoint(x,y));
521 dialog->resize(width, height);
522 dialog->requestState(Mir::RestoredState);
523
524 SurfaceManager::instance()->notifySurfaceCreated(dialog);
525
526 dialog->requestFocus();
527}
528
496void MirSurface::setRequestedPosition(const QPoint &value)529void MirSurface::setRequestedPosition(const QPoint &value)
497{530{
498 if (value != m_requestedPosition) {531 if (value != m_requestedPosition) {
@@ -505,3 +538,13 @@
505 Q_EMIT positionChanged(m_position);538 Q_EMIT positionChanged(m_position);
506 }539 }
507}540}
541
542MirSurfaceInterface* MirSurface::parentSurface() const
543{
544 return m_parentSurface;
545}
546
547MirSurfaceListInterface* MirSurface::childSurfaceList() const
548{
549 return m_childSurfaceList;
550}
508551
=== modified file 'tests/mocks/Unity/Application/MirSurface.h'
--- tests/mocks/Unity/Application/MirSurface.h 2016-12-03 18:41:45 +0000
+++ tests/mocks/Unity/Application/MirSurface.h 2017-01-19 15:00:39 +0000
@@ -45,6 +45,7 @@
45 MirSurface(const QString& name,45 MirSurface(const QString& name,
46 Mir::Type type,46 Mir::Type type,
47 Mir::State state,47 Mir::State state,
48 MirSurface *parentSurface,
48 const QUrl& screenshot,49 const QUrl& screenshot,
49 const QUrl &qmlFilePath = QUrl());50 const QUrl &qmlFilePath = QUrl());
50 virtual ~MirSurface();51 virtual ~MirSurface();
@@ -94,6 +95,9 @@
94 QPoint requestedPosition() const override { return m_requestedPosition; }95 QPoint requestedPosition() const override { return m_requestedPosition; }
95 void setRequestedPosition(const QPoint &) override;96 void setRequestedPosition(const QPoint &) override;
9697
98 unity::shell::application::MirSurfaceInterface* parentSurface() const override;
99 unity::shell::application::MirSurfaceListInterface* childSurfaceList() const override;
100
97 Q_INVOKABLE void close() override;101 Q_INVOKABLE void close() override;
98 Q_INVOKABLE void activate() override;102 Q_INVOKABLE void activate() override;
99103
@@ -121,6 +125,9 @@
121125
122 Q_INVOKABLE virtual void setInputBounds(const QRect &boundsRect);126 Q_INVOKABLE virtual void setInputBounds(const QRect &boundsRect);
123127
128 Q_INVOKABLE void openMenu(qreal x, qreal y, qreal width, qreal height);
129 Q_INVOKABLE void openDialog(qreal x, qreal y, qreal width, qreal height);
130
124 /////131 /////
125 // internal mock stuff132 // internal mock stuff
126133
@@ -216,6 +223,10 @@
216223
217 QPoint m_position;224 QPoint m_position;
218 QPoint m_requestedPosition;225 QPoint m_requestedPosition;
226
227 unity::shell::application::MirSurfaceInterface* m_parentSurface;
228
229 MirSurfaceListModel *m_childSurfaceList;
219};230};
220231
221#endif // MOCK_MIR_SURFACE_H232#endif // MOCK_MIR_SURFACE_H
222233
=== modified file 'tests/mocks/Unity/Application/MirSurfaceItem.cpp'
--- tests/mocks/Unity/Application/MirSurfaceItem.cpp 2016-12-23 11:05:09 +0000
+++ tests/mocks/Unity/Application/MirSurfaceItem.cpp 2017-01-19 15:00:39 +0000
@@ -159,7 +159,9 @@
159159
160 if (m_qmlItem) {160 if (m_qmlItem) {
161 QQmlProperty orientationProp(m_qmlItem, "orientationAngle");161 QQmlProperty orientationProp(m_qmlItem, "orientationAngle");
162 orientationProp.write(QVariant::fromValue(orientationAngle()));162 if (orientationProp.isValid()) {
163 orientationProp.write(QVariant::fromValue(orientationAngle()));
164 }
163 }165 }
164}166}
165167
@@ -167,7 +169,9 @@
167{169{
168 if (m_qmlItem) {170 if (m_qmlItem) {
169 QQmlProperty screenshotSource(m_qmlItem, "screenshotSource");171 QQmlProperty screenshotSource(m_qmlItem, "screenshotSource");
170 screenshotSource.write(QVariant::fromValue(screenshotUrl));172 if (screenshotSource.isValid()) {
173 screenshotSource.write(QVariant::fromValue(screenshotUrl));
174 }
171 }175 }
172}176}
173177
@@ -193,12 +197,23 @@
193197
194 {198 {
195 QQmlProperty screenshotSource(m_qmlItem, "screenshotSource");199 QQmlProperty screenshotSource(m_qmlItem, "screenshotSource");
196 screenshotSource.write(QVariant::fromValue(m_qmlSurface->screenshotUrl()));200 if (screenshotSource.isValid()) {
201 screenshotSource.write(QVariant::fromValue(m_qmlSurface->screenshotUrl()));
202 }
197 }203 }
198204
199 {205 {
200 QQmlProperty orientationProp(m_qmlItem, "orientationAngle");206 QQmlProperty orientationProp(m_qmlItem, "orientationAngle");
201 orientationProp.write(QVariant::fromValue(orientationAngle()));207 if (orientationProp.isValid()) {
208 orientationProp.write(QVariant::fromValue(orientationAngle()));
209 }
210 }
211
212 {
213 QQmlProperty surfaceProperty(m_qmlItem, "surface");
214 if (surfaceProperty.isValid()) {
215 surfaceProperty.write(QVariant::fromValue(m_qmlSurface));
216 }
202 }217 }
203}218}
204219
205220
=== modified file 'tests/mocks/Unity/Application/MirSurfaceListModel.h'
--- tests/mocks/Unity/Application/MirSurfaceListModel.h 2016-11-30 19:24:02 +0000
+++ tests/mocks/Unity/Application/MirSurfaceListModel.h 2017-01-19 15:00:39 +0000
@@ -44,7 +44,6 @@
44 bool contains(MirSurface *surface) const { return m_surfaceList.contains(surface); }44 bool contains(MirSurface *surface) const { return m_surfaceList.contains(surface); }
4545
46private:46private:
47 void appendSurface(MirSurface *surface);
48 void raise(MirSurface *surface);47 void raise(MirSurface *surface);
49 void moveSurface(int from, int to);48 void moveSurface(int from, int to);
50 void connectSurface(MirSurface *surface);49 void connectSurface(MirSurface *surface);
5150
=== modified file 'tests/mocks/Unity/Application/SurfaceManager.cpp'
--- tests/mocks/Unity/Application/SurfaceManager.cpp 2017-01-03 12:45:42 +0000
+++ tests/mocks/Unity/Application/SurfaceManager.cpp 2017-01-19 15:00:39 +0000
@@ -61,10 +61,15 @@
61MirSurface *SurfaceManager::createSurface(const QString& name,61MirSurface *SurfaceManager::createSurface(const QString& name,
62 Mir::Type type,62 Mir::Type type,
63 Mir::State state,63 Mir::State state,
64 const QUrl& screenshot)64 MirSurface *parentSurface,
65 const QUrl &screenshot,
66 const QUrl &qmlFilePath)
65{67{
66 MirSurface* surface = new MirSurface(name, type, state, screenshot);68 MirSurface* surface = new MirSurface(name, type, state, parentSurface, screenshot, qmlFilePath);
67 registerSurface(surface);69 registerSurface(surface);
70 if (parentSurface) {
71 static_cast<MirSurfaceListModel*>(parentSurface->childSurfaceList())->addSurface(surface);
72 }
68 return surface;73 return surface;
69}74}
7075
@@ -72,12 +77,14 @@
72{77{
73 m_surfaces.prepend(surface);78 m_surfaces.prepend(surface);
7479
75 surface->setMinimumWidth(m_newSurfaceMinimumWidth);80 if (!surface->parentSurface()) {
76 surface->setMaximumWidth(m_newSurfaceMaximumWidth);81 surface->setMinimumWidth(m_newSurfaceMinimumWidth);
77 surface->setMinimumHeight(m_newSurfaceMinimumHeight);82 surface->setMaximumWidth(m_newSurfaceMaximumWidth);
78 surface->setMaximumHeight(m_newSurfaceMaximumHeight);83 surface->setMinimumHeight(m_newSurfaceMinimumHeight);
79 surface->setWidthIncrement(m_newSurfaceWidthIncrement);84 surface->setMaximumHeight(m_newSurfaceMaximumHeight);
80 surface->setHeightIncrement(m_newSurfaceHeightIncrement);85 surface->setWidthIncrement(m_newSurfaceWidthIncrement);
86 surface->setHeightIncrement(m_newSurfaceHeightIncrement);
87 }
8188
82 connect(surface, &MirSurface::stateRequested, this, [=](Mir::State state) {89 connect(surface, &MirSurface::stateRequested, this, [=](Mir::State state) {
83 this->onStateRequested(surface, state);90 this->onStateRequested(surface, state);
8491
=== modified file 'tests/mocks/Unity/Application/SurfaceManager.h'
--- tests/mocks/Unity/Application/SurfaceManager.h 2017-01-03 12:45:42 +0000
+++ tests/mocks/Unity/Application/SurfaceManager.h 2017-01-19 15:00:39 +0000
@@ -49,7 +49,9 @@
49 Q_INVOKABLE MirSurface* createSurface(const QString& name,49 Q_INVOKABLE MirSurface* createSurface(const QString& name,
50 Mir::Type type,50 Mir::Type type,
51 Mir::State state,51 Mir::State state,
52 const QUrl& screenshot);52 MirSurface *parentSurface,
53 const QUrl &screenshot,
54 const QUrl &qmlFilePath = QUrl());
5355
5456
55 void notifySurfaceCreated(unity::shell::application::MirSurfaceInterface *);57 void notifySurfaceCreated(unity::shell::application::MirSurfaceInterface *);
5658
=== modified file 'tests/mocks/Unity/Application/VirtualKeyboard.cpp'
--- tests/mocks/Unity/Application/VirtualKeyboard.cpp 2016-09-26 12:25:19 +0000
+++ tests/mocks/Unity/Application/VirtualKeyboard.cpp 2017-01-19 15:00:39 +0000
@@ -24,10 +24,11 @@
2424
25VirtualKeyboard::VirtualKeyboard()25VirtualKeyboard::VirtualKeyboard()
26 : MirSurface("input-method",26 : MirSurface("input-method",
27 Mir::InputMethodType,27 Mir::InputMethodType,
28 Mir::MinimizedState,28 Mir::MinimizedState,
29 QUrl("qrc:///Unity/Application/vkb_portrait.png"),29 nullptr, /* parentSurface */
30 QUrl("qrc:///Unity/Application/VirtualKeyboard.qml"))30 QUrl("qrc:///Unity/Application/vkb_portrait.png"),
31 QUrl("qrc:///Unity/Application/VirtualKeyboard.qml"))
31{32{
32}33}
3334
3435
=== added file 'tests/mocks/Unity/Application/resources/Kate.qml'
--- tests/mocks/Unity/Application/resources/Kate.qml 1970-01-01 00:00:00 +0000
+++ tests/mocks/Unity/Application/resources/Kate.qml 2017-01-19 15:00:39 +0000
@@ -0,0 +1,49 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20Rectangle {
21 id: root
22 color: "white"
23 implicitWidth: width
24 implicitHeight: height
25
26 property var surface
27
28 Column {
29 Button {
30 text: "Open Menu"
31 property real nextY: y
32 property real menuHeight: units.gu(5)
33 onClicked: {
34 surface.openMenu(x+width, nextY, units.gu(10), menuHeight);
35 nextY += menuHeight + units.gu(.5)
36 }
37 }
38
39 Button {
40 text: "Open Dialog"
41 property real dialogWidth: units.gu(30)
42 property real dialogHeight: units.gu(20)
43 onClicked: {
44 surface.openDialog(root.x+(root.width/2)-(dialogWidth/2), root.y+(root.height/2)-(dialogHeight/2),
45 dialogWidth, dialogHeight);
46 }
47 }
48 }
49}
050
=== added file 'tests/mocks/Unity/Application/resources/KateDialog.qml'
--- tests/mocks/Unity/Application/resources/KateDialog.qml 1970-01-01 00:00:00 +0000
+++ tests/mocks/Unity/Application/resources/KateDialog.qml 2017-01-19 15:00:39 +0000
@@ -0,0 +1,48 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20Rectangle {
21 id: root
22 color: "grey"
23 implicitWidth: width
24 implicitHeight: height
25
26 property var surface
27
28 Text {
29 anchors.left: parent.left
30 anchors.right: parent.right
31 horizontalAlignment: Text.AlignHCenter
32 verticalAlignment: Text.AlignVCenter
33 text: "This is a child dialog."
34 }
35
36 Row {
37 anchors.bottom: parent.bottom
38 anchors.right: parent.right
39 Button {
40 text: "OK"
41 onClicked: root.surface.close()
42 }
43 Button {
44 text: "Cancel"
45 onClicked: root.surface.close()
46 }
47 }
48}
049
=== added file 'tests/mocks/Unity/Application/resources/KateMenu.qml'
--- tests/mocks/Unity/Application/resources/KateMenu.qml 1970-01-01 00:00:00 +0000
+++ tests/mocks/Unity/Application/resources/KateMenu.qml 2017-01-19 15:00:39 +0000
@@ -0,0 +1,41 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20Rectangle {
21 id: root
22 color: "grey"
23 implicitWidth: width
24 implicitHeight: height
25
26 property var surface
27
28 Text {
29 anchors.centerIn: parent
30 text: "menu"
31 }
32 MouseArea {
33 anchors.fill: parent
34 property real nextY: 0
35 onClicked: {
36 // ensure some overlap with is parent in order to visually check for nested opacity artifacts
37 root.surface.openMenu(x+(width*0.6), nextY, units.gu(10), root.height);
38 nextY += root.height
39 }
40 }
41}
042
=== modified file 'tests/mocks/Unity/Application/resources/surfaces.qrc'
--- tests/mocks/Unity/Application/resources/surfaces.qrc 2015-11-05 17:59:16 +0000
+++ tests/mocks/Unity/Application/resources/surfaces.qrc 2017-01-19 15:00:39 +0000
@@ -1,5 +1,8 @@
1<RCC>1<RCC>
2 <qresource prefix="/Unity/Application">2 <qresource prefix="/Unity/Application">
3 <file>Kate.qml</file>
4 <file>KateDialog.qml</file>
5 <file>KateMenu.qml</file>
3 <file>VirtualKeyboard.qml</file>6 <file>VirtualKeyboard.qml</file>
4 <file>MirSurfaceItem.qml</file>7 <file>MirSurfaceItem.qml</file>
5 <file>vkb_portrait.png</file>8 <file>vkb_portrait.png</file>
69
=== modified file 'tests/qmltests/Stage/ApplicationCheckBox.qml'
--- tests/qmltests/Stage/ApplicationCheckBox.qml 2016-11-30 19:24:02 +0000
+++ tests/qmltests/Stage/ApplicationCheckBox.qml 2017-01-19 15:00:39 +0000
@@ -162,7 +162,7 @@
162 }162 }
163 }163 }
164164
165 // Rows of application surfaces165 // Rows of top-level application surfaces
166 Repeater {166 Repeater {
167 model: d.application ? d.application.surfaceList : null167 model: d.application ? d.application.surfaceList : null
168 RowLayout {168 RowLayout {
169169
=== modified file 'tests/qmltests/Stage/tst_WindowResizeArea.qml'
--- tests/qmltests/Stage/tst_WindowResizeArea.qml 2016-12-21 16:20:58 +0000
+++ tests/qmltests/Stage/tst_WindowResizeArea.qml 2017-01-19 15:00:39 +0000
@@ -90,6 +90,7 @@
90 id: windowResizeArea90 id: windowResizeArea
91 anchors.fill: parent91 anchors.fill: parent
92 target: fakeWindow92 target: fakeWindow
93 boundsItem: bounds
93 borderThickness: units.gu(2)94 borderThickness: units.gu(2)
94 minWidth: units.gu(15)95 minWidth: units.gu(15)
95 minHeight: units.gu(10)96 minHeight: units.gu(10)
@@ -121,7 +122,16 @@
121 active: windowLoaderCheckbox.checked122 active: windowLoaderCheckbox.checked
122 }123 }
123124
125 Item {
126 id: bounds
127 anchors.left: parent.left
128 anchors.top: parent.top
129 anchors.right: controls.left
130 anchors.bottom: parent.bottom
131 }
132
124 Rectangle {133 Rectangle {
134 id: controls
125 anchors.right: parent.right135 anchors.right: parent.right
126 anchors.top: parent.top136 anchors.top: parent.top
127 anchors.bottom: parent.bottom137 anchors.bottom: parent.bottom

Subscribers

People subscribed via source and target branches