Mir

Merge lp://qastaging/~mir-team/mir/cursor-spike-phase-2 into lp://qastaging/mir/0.1

Proposed by Robert Carr
Status: Work in progress
Proposed branch: lp://qastaging/~mir-team/mir/cursor-spike-phase-2
Merge into: lp://qastaging/mir/0.1
Prerequisite: lp://qastaging/~mir-team/mir/cursor-spike-phase-1-resubmit
Diff against target: 674 lines (+536/-0)
11 files modified
include/client/mir_toolkit/mir_client_library.h (+11/-0)
include/shared/mir_toolkit/client_types.h (+16/-0)
src/client/mir_client_library.cpp (+5/-0)
src/client/mir_surface.cpp (+27/-0)
src/client/mir_surface.h (+5/-0)
src/server/frontend/protobuf_message_processor.cpp (+4/-0)
src/server/frontend/session_mediator.cpp (+9/-0)
src/server/frontend/session_mediator.h (+5/-0)
src/shared/protobuf/mir_protobuf.proto (+9/-0)
tests/acceptance-tests/CMakeLists.txt (+1/-0)
tests/acceptance-tests/test_client_cursor_api.cpp (+444/-0)
To merge this branch: bzr merge lp://qastaging/~mir-team/mir/cursor-spike-phase-2
Reviewer Review Type Date Requested Status
Kevin DuBois (community) Needs Information
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+213733@code.qastaging.launchpad.net

Commit message

Define client cursor API and implement up until stub in session mediator. Define expected behavior through disabled acceptance tests.

Description of the change

Cursor spike phase 2! phases 3 and 4* are coming later today. This is just split up for ease of code review.

Contains the client side API definitions protobuf changes and implementation up until SessionMediator.

Contains the behavior definition in terms of disabled acceptance tests.

Phase 3 will contain some refactoring of existing code to enable implementing the tests on server side.

Phase 4 contains the new cursor controller object (new impl of cursor listener) which provides most of the implementation

To post a comment you must log in.
Revision history for this message
Kevin DuBois (kdub) wrote :

nits:
l32, most of the client headers seem to stick to the 80-char-columns rule (although the style guide says 120-char-columns)

l35, 'nad'

needs fixings:
the protobuf message should have:
 optional string error = 127;

l10/l16 comment doesn't seem to match the function

l10, It wasn't immediately obvious to me from the context and functions that the "cursor_theme" and "cursor_name" were c-strings that correspond to something on the server side. (I thought we were sending a raw pixel buffer at first glance).

needs info:
How does the client get the strings (theme name/cursor name) that it needs to use this api?

although it makes sense to ignore the strings if enabled is false, it almost lends itself to having 2 functions added to the API, one concerning turning the cursor on and off, and the other setting the cursor to something different.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
1491. By Robert Carr

client_types.h: Restrict to 80 characters, fix typo s/nad/and

1492. By Robert Carr

mir_client_library.h: Update configure_cursor comments

Revision history for this message
Robert Carr (robertcarr) wrote :

Updated comments.

Not sure about the protobuf message containing error? As it stands the message is just the parameters and the function returns void (similar to release_surface for example). Should rpc configure_cursor need to return CursorResponse { optional string error } ?

Strangely not anything like this in the RPC api...either things return real values (and the error is interspersed) or return void (release surface, screencast, etc).

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

with the protobuf error field, we can leave the message as I suppose, and add it later. (adding an error msg is easy, when we need it)

I guess I'll switch to needs info for the other points...
The comments are clearer, but I still don't know where to find the name of available themes from.
Is the cursor being enabled or disabled on a per-surface basis the requirement that we have? (or is it just to turn the cursor on or off on the whole screen?)
Would 2 api functions (enable/disable and select image), be more natural?

review: Needs Information
Revision history for this message
Robert Carr (robertcarr) wrote :

>> The comments are clearer, but I still don't know where to find the name of available themes from.

I think in general you use the default theme, either toolkits handle configuration of different theme, or the system default changes (I lend towards the second). I think the main use case for theme, is i.e. a game installs a custom crazy game cursor theme and wishes to refer to it by name as a more convenient form of uploading custom cursors via API.

>> Is the cursor being enabled or disabled on a per-surface basis the requirement that we have? (or is it
>> just to turn the cursor on or off on the whole screen?)

Cursor is being enabled or disabled per surface for XMir v. Unity8 under USC. Of course it could be done just turning the cursor on/off for the whole screen. If we did this though, we would have to introduce some sort of meditation functionality similar to the display configuration (i.e. screen cursor state request from active session). Given that there is still a need to configure cursor per surface (e.g. text input cursor v. pointer), it seems best to not introduce this second full screen cursor state behavior.

>> Would 2 api functions (enable/disable and select image), be more natural?

I decided no because it opens more questions (What happens if you select an image while cursor is disabled?). I think just setting the total cursor state per surface is a hard model to misinterpret.

Unmerged revisions

1492. By Robert Carr

mir_client_library.h: Update configure_cursor comments

1491. By Robert Carr

client_types.h: Restrict to 80 characters, fix typo s/nad/and

1490. By Robert Carr

Define API with client/server RPC infrastructure + acceptance tests (Disabled)

1489. By Robert Carr

render_surfaces.cpp: Remove unused variables

1488. By Robert Carr

Remove old code for input=off from render_surfaces.cpp

1487. By Robert Carr

Rename CursorLoader->CursorImagesV

1486. By Robert Carr

Merge trunk

1485. By Robert Carr

Rename CursorRepository -> CursorLoader

1484. By Robert Carr

Const correctness

1483. By Robert Carr

render_surfaces: Use a null cursor instance instead of a nullptr\!

Preview Diff

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

Subscribers

People subscribed via source and target branches