Merge lp://staging/~michael-sheldon/maliit/obey-unity8-focus into lp://staging/~ubuntu-core-dev/maliit/maliit-framework-ubuntu

Proposed by Michael Sheldon
Status: Needs review
Proposed branch: lp://staging/~michael-sheldon/maliit/obey-unity8-focus
Merge into: lp://staging/~ubuntu-core-dev/maliit/maliit-framework-ubuntu
Diff against target: 186 lines (+155/-0)
4 files modified
debian/changelog (+8/-0)
debian/control (+1/-0)
debian/patches/0015-obey-unity8-focus.patch (+145/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp://staging/~michael-sheldon/maliit/obey-unity8-focus
Reviewer Review Type Date Requested Status
Daniel d'Andrada (community) code Approve
Tyler Hicks Approve
Review via email: mp+298312@code.staging.launchpad.net

Commit message

Add 0015-obey-unity8-focus.patch to check that applications have focus when running under Unity8

Description of the change

Add 0015-obey-unity8-focus.patch to check that applications have focus when running under Unity8

To post a comment you must log in.
52. By Michael Sheldon

Run quilt refresh on patches

53. By Michael Sheldon

Add build dependency for libdbus-dev

Revision history for this message
Tyler Hicks (tyhicks) wrote :

What happens if another app gains focus after this check? Does maliit receive some sort of notification so that it can revalidate that the connected app still has focus?

review: Needs Information
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

When application focus is changed the OSK is dismissed, once a field that accepts input is focused in a new app after the switch it requests the active context again causing the focus to be checked for the new app prior to the keyboard being displayed again.

Revision history for this message
Tyler Hicks (tyhicks) wrote :

Thanks. That makes sense.

What happens if the application exits, gets killed, etc., after the isPidFocused check returns true? Does another application gain focus and get access to the OSK or is the OSK immediately dismissed?

review: Needs Information
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

activateContext only provides access to the keyboard for the dbus connection that requested it, so even if the keyboard wasn't dismissed (which it should be), no other application would gain access without first requesting that they be made the activate context (and so being subject to a focus check)

Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

And dbus connections in maliit are peer-to-peer, so once the app dies its authorised dbus connection dies with it.

Revision history for this message
Tyler Hicks (tyhicks) wrote :

Hi Michael - I'm happy with the higher level design answers that you provided. I had one small observation in that I left inline. I'm going to go ahead and give this my approval but would like you to follow up on the observation. I'm assuming that you'll get someone more familiar with maliit/Mir to give a closer code review than I can provide but I've given the diff a cursory look.

review: Approve
54. By Michael Sheldon

Delete unity focus dbus connection when destroying dbusinputcontextconnection

55. By Michael Sheldon

Fix missing comma in dependency list

56. By Michael Sheldon

Fix libdbus-1-dev dependency

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

Patch looks ok to me. Didn't test though.

Nitpicks:

"""
 DBusInputContextConnection::~DBusInputContextConnection()
 {
+ if (mUnityFocus != 0) {
+ delete mUnityFocus;
+ }
 }
"""

This check is unnecessary. You can simply call delete straightaway. It will be a NOOP if the pointer is null.

--------

"""
+++ maliit-framework-0.99.1+git20151118+62bd54b/connection/dbusinputcontextconnection.h
@@ -19,7 +19,9 @@

 #include "serverdbusaddress.h"

+#include <QDBusArgument>
 #include <QDBusContext>
+#include <QDBusInterface>
 #include <QDBusVariant>

"""

Since I don't that QDBusArgument header being used here, I would move that #include to the cpp file.

To further lighten up this header file, I would also move "#include <QDBusInterface>" to the cpp and have a "class QDBusInterface" forward declaration instead, which is enough for this header.

review: Approve (code)
57. By Michael Sheldon

Minor code cleanups based on review

Unmerged revisions

57. By Michael Sheldon

Minor code cleanups based on review

56. By Michael Sheldon

Fix libdbus-1-dev dependency

55. By Michael Sheldon

Fix missing comma in dependency list

54. By Michael Sheldon

Delete unity focus dbus connection when destroying dbusinputcontextconnection

53. By Michael Sheldon

Add build dependency for libdbus-dev

52. By Michael Sheldon

Run quilt refresh on patches

51. By Michael Sheldon

Add 0015-obey-unity8-focus.patch to check that applications have focus when running under Unity8

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