Merge lp:~dandrader/qtmir/mousePointer into lp:qtmir
| Status: | Merged |
|---|---|
| Approved by: | Lukáš Tinkl on 2015-10-13 |
| Approved revision: | 380 |
| Merged at revision: | 388 |
| Proposed branch: | lp:~dandrader/qtmir/mousePointer |
| Merge into: | lp:qtmir |
| Diff against target: |
897 lines (+508/-104) 19 files modified
CMakeLists.txt (+1/-1) debian/control (+2/-2) demos/qml-demo-shell/ResizeArea.qml (+128/-0) demos/qml-demo-shell/TitleBar.qml (+4/-1) demos/qml-demo-shell/Window.qml (+4/-81) demos/qml-demo-shell/qml-demo-shell.qml (+19/-1) src/modules/Unity/Application/CMakeLists.txt (+0/-1) src/modules/Unity/Application/plugin.cpp (+8/-1) src/platforms/mirserver/CMakeLists.txt (+5/-1) src/platforms/mirserver/cursor.cpp (+152/-0) src/platforms/mirserver/cursor.h (+66/-0) src/platforms/mirserver/mirserver.cpp (+6/-0) src/platforms/mirserver/mirsingleton.cpp (+33/-0) src/platforms/mirserver/mirsingleton.h (+46/-0) src/platforms/mirserver/qteventfeeder.cpp (+19/-12) src/platforms/mirserver/qteventfeeder.h (+2/-1) src/platforms/mirserver/screen.cpp (+6/-0) src/platforms/mirserver/screen.h (+6/-1) tests/mirserver/QtEventFeeder/mock_qtwindowsystem.h (+1/-1) |
| To merge this branch: | bzr merge lp:~dandrader/qtmir/mousePointer |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| PS Jenkins bot | continuous-integration | 2015-09-22 | Needs Fixing on 2015-10-13 |
| Lukáš Tinkl (community) | Approve on 2015-10-13 | ||
| Gerry Boland | 2015-09-22 | Approve on 2015-10-09 | |
|
Review via email:
|
|||
This proposal supersedes a proposal from 2015-09-09.
Commit Message
Shell draws its own cursor using the new Cursor QML element
Description of the Change
* Are there any related MPs required for this MP to build/function as expected? Please list.
https:/
https:/
* Did you perform an exploratory manual test run of your code change and any related functionality?
Not applicable.
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
Not applicable.
| Gerry Boland (gerboland) wrote : | # |
=== added file 'src/modules/
=== added file 'src/modules/
I'm beginning to wonder if most of this code needs to live in qtmir at all. Since Unity8 draws it, why does QtMir need to do this work to find the image for it?
I also don't think it's QtMir's job to know anything about cursor themes.
Why doesn't QtMir just inform the shell of:
1. the position the cursor should be located at
2. the name of the desired cursor
Then unity8 can find the themed cursor image, figure out the hotspot and draw the cursor itself.
| Gerry Boland (gerboland) wrote : | # |
=== added file 'demos/
I like your code, neat and clean as always. But if I was writing this, I would have a single MouseArea behind the surface, instead of 8. It's ok for a demo, but that's a lot for a real shell.
| Daniel d'Andrada (dandrader) wrote : | # |
> === added file 'demos/
> I like your code, neat and clean as always. But if I was writing this, I would
> have a single MouseArea behind the surface, instead of 8. It's ok for a demo,
> but that's a lot for a real shell.
If I recall correctly, the main reason was because of the MouseArea.
But later on the cursor shape enumeration proved insufficient for exposing all the different shapes unity uses, forcing me to introduce the Mir.cursorName API.
So yeah, now that I've given up using MouseArea.
| Daniel d'Andrada (dandrader) wrote : | # |
> > === added file 'demos/
> > I like your code, neat and clean as always. But if I was writing this, I
> would
> > have a single MouseArea behind the surface, instead of 8. It's ok for a
> demo,
> > but that's a lot for a real shell.
>
> If I recall correctly, the main reason was because of the
> MouseArea.
> assume the given shape when hovering the mouse area. So I cannot be a single
> one.
>
> But later on the cursor shape enumeration proved insufficient for exposing all
> the different shapes unity uses, forcing me to introduce the Mir.cursorName
> API.
>
> So yeah, now that I've given up using MouseArea.
> a single mouse area.
FYI: I also copy-pasted ResizeArea.qml into unity8/mousePointer
| Daniel d'Andrada (dandrader) wrote : | # |
> === added file 'src/modules/
> === added file 'src/modules/
> I'm beginning to wonder if most of this code needs to live in qtmir at all.
> Since Unity8 draws it, why does QtMir need to do this work to find the image
> for it?
>
> I also don't think it's QtMir's job to know anything about cursor themes.
>
>
> Why doesn't QtMir just inform the shell of:
> 1. the position the cursor should be located at
> 2. the name of the desired cursor
> Then unity8 can find the themed cursor image, figure out the hotspot and draw
> the cursor itself.
Following the same rationale, one might also argue: "Why does qtmir has to know about application processes and upstart at all? let unity8 figure it out. qtmir should just spit out Sessions, MirSurfaces and MirSurfaceItems".
Also, by having this in qtmir, we pretty much shield unity8 from architectural changes down the road, once we ditch the QML cursor approach in favor of a unity-system-
| Daniel d'Andrada (dandrader) wrote : | # |
On 02/09/15 13:16, Gerry Boland wrote:
> === added file 'demos/
> I like your code, neat and clean as always. But if I was writing this, I would have a single MouseArea behind the surface, instead of 8. It's ok for a demo, but that's a lot for a real shell.
>
>
Fixed. Will do likewise in untiy8 tomorrow.
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:371
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| Gerry Boland (gerboland) wrote : | # |
> > === added file 'src/modules/
> > === added file 'src/modules/
> > I'm beginning to wonder if most of this code needs to live in qtmir at all.
> > Since Unity8 draws it, why does QtMir need to do this work to find the image
> > for it?
> >
> > I also don't think it's QtMir's job to know anything about cursor themes.
> >
> >
> > Why doesn't QtMir just inform the shell of:
> > 1. the position the cursor should be located at
> > 2. the name of the desired cursor
> > Then unity8 can find the themed cursor image, figure out the hotspot and
> draw
> > the cursor itself.
>
> Following the same rationale, one might also argue: "Why does qtmir has to
> know about application processes and upstart at all? let unity8 figure it out.
> qtmir should just spit out Sessions, MirSurfaces and MirSurfaceItems".
Actually that's the longer-term goal.
https:/
Zanetti wants to move such logic into Unity itself. This will make QtMir a thin wrapper of Mir functionality for Qt users, which is a much clearer purpose than what it currently has.
If somebody would like to make their own shell, then can make use of QtMir without being forced to use upstart for instance. If they want to use upstart, then they can use the Unity.Application plugin.
> Also, by having this in qtmir, we pretty much shield unity8 from architectural
> changes down the road, once we ditch the QML cursor approach in favor of a
> unity-system-
I don't think that will happen. We need the shell to manage the cursor position, in order to do fancy things like edge-push detection, slowing cursor over buttons (a11y) or moving cursor with keyboard (a11y).
My main reasons for wanting USC to draw cursor were:
1. latency, cursor will react as quickly as possible
2. hardware compositing, cursor lives in a special hardware buffer which the hardware composites on top of everything. Means moving cursor doesn't require entire screen re-renders.
Mir team have plans for both problems
1. not use the mir protobuf for input, but have unity8 open socket with event stream coming in. Should reduce latency
2. Mir adding API to allow shell to designate certain buffers/surfaces as being hardware composable. Cursor will definitely be one of those, if available.
| Daniel d'Andrada (dandrader) wrote : | # |
Ok, moved all Cursor stuff from qtmir to unity8.
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:372
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| Gerry Boland (gerboland) wrote : | # |
=== modified file 'debian/copyright'
can undo this.
| Daniel d'Andrada (dandrader) wrote : | # |
On 09/09/15 07:57, Gerry Boland wrote:
> === modified file 'debian/copyright'
> can undo this.
Done.
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:373
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| Gerry Boland (gerboland) wrote : | # |
Ok ignore my relativeMovement thing. I'll not object to the usual terminology.
However I fear I need to ask you to rebase on top of
https:/
as there's a few conflicts, and the concept of multiple qwindows does make this more complex.
+ // We will draw our own cursor.
+ add_init_
This isn't great, as the mir cursor object is still being created. Can we replace Mir's implementation with our own one? -- not a blocker on this MR, can consider this later.
++ src/platforms/
+qtmir::Mir::~Mir()
+{
+ m_instance = nullptr;
+}
You're not deleting what you potentially "new"ed. QScopedPointer helps prevent such accidents...
+++ src/platforms/
+private:
+ Mir();
maybe http://
Using this Mir singleton to save the cursorName will do fine for now, but I'm wary of it being a dumping ground for lots of little things.
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:371
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| Daniel d'Andrada (dandrader) wrote : | # |
On 09/09/15 10:36, Gerry Boland wrote:
> Review: Needs Fixing
>
> Ok ignore my relativeMovement thing. I'll not object to the usual terminology.
>
> However I fear I need to ask you to rebase on top of
> https:/
> as there's a few conflicts, and the concept of multiple qwindows does make this more complex.
Done.
>
> + // We will draw our own cursor.
> + add_init_
> This isn't great, as the mir cursor object is still being created. Can we replace Mir's implementation with our own one? -- not a blocker on this MR, can consider this later.
This will be the u-s-c cursor, and u-s-c will always have its own cursor
no matter what, I think. Don't think it's worth investigating this idea.
>
> ++ src/platforms/
> +qtmir::Mir::~Mir()
> +{
> + m_instance = nullptr;
> +}
> You're not deleting what you potentially "new"ed. QScopedPointer helps prevent such accidents...
I am. The only place that does "new Mir" is Mir::instance() and it's
done only once. This is a simple, no-nonsense, singleton implementation
that does its job AFAICT. You want the global, static, Mir::m_instance
to be a QScopedPointer? I fail to see how would that work and how it
would be better than the current code. If you really want to see a
QScopedPointer there please give me a diff as I didn't get the point.
>
> +++ src/platforms/
> +private:
> + Mir();
> maybe http://
Done.
> Using this Mir singleton to save the cursorName will do fine for now, but I'm wary of it being a dumping ground for lots of little things.
Yes, Mir.cursorName is surely not the best solution but anything better
would require way more work. This is like a stop-gap measure. Also given
the uncertainty of the current cursor approach (as we will eventually
move to u-s-c cursor) I didn't want to invest a lot of effort on
something that could evaporate in the near term.
| Daniel d'Andrada (dandrader) wrote : | # |
removed the multimonitor branch as a prerequisite as it still has issues.
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:376
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| Lukáš Tinkl (lukas-kde) wrote : | # |
The text input cursor (ibeam) is not mapped correctly; to xterm?
| Daniel d'Andrada (dandrader) wrote : | # |
Replied to inline comment
| Daniel d'Andrada (dandrader) wrote : | # |
> The text input cursor (ibeam) is not mapped correctly; to xterm?
It's mapped correctly, as I commented in the inline diff.
PS: Could please refrain from using inline comments in the future (for my MPs at least). I find it a badly implemented feature in launchpad. It's disjointed from the main comments and is kinda lost in the middle of the diff (there are hotkeys to jump between diff comments, but I find it gimmicky)
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:377
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| Lukáš Tinkl (lukas-kde) wrote : | # |
> > The text input cursor (ibeam) is not mapped correctly; to xterm?
>
> It's mapped correctly, as I commented in the inline diff.
I see, thanks for the explanation
> PS: Could please refrain from using inline comments in the future (for my MPs
> at least). I find it a badly implemented feature in launchpad. It's disjointed
> from the main comments and is kinda lost in the middle of the diff (there are
> hotkeys to jump between diff comments, but I find it gimmicky)
Noted
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:378
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:379
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| Gerry Boland (gerboland) wrote : | # |
Have tested this with silo22, it's working good. Code is good. LGTM
| Lukáš Tinkl (lukas-kde) wrote : | # |
bool Cursor:
Needs changing from Qt::MouseButton -> Qt::MouseButtons as the latter is expected by methods in QWindowSystemIn
- 380. By Daniel d'Andrada on 2015-10-13
-
s/Qt::MouseButt
on/Qt:: MouseButtons
| Daniel d'Andrada (dandrader) wrote : | # |
> bool Cursor:
> Qt::MouseButton buttons,...)
>
> Needs changing from Qt::MouseButton -> Qt::MouseButtons as the latter is
> expected by methods in QWindowSystemIn
> stuff like emulating middle mouse click by pressing both left and right mouse
> buttons at once.
Fixed.
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:380
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://

FAILED: Continuous integration, rev:370 jenkins. qa.ubuntu. com/job/ qtmir-ci/ 386/ jenkins. qa.ubuntu. com/job/ qtmir-wily- amd64-ci/ 119/console jenkins. qa.ubuntu. com/job/ qtmir-wily- armhf-ci/ 119/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/qtmir- ci/386/ rebuild
http://