Code review comment for lp:~lukas-kde/unity8/globalshortcuts

Lukáš Tinkl (lukas-kde) wrote :

> On 06/08/15 18:35, Lukáš Tinkl wrote:
> >> In ShellDialog.qml
> >>
> >> """
> >> 1184 + forceActiveFocus()
> >> """
> >>
> >> Are you sure you need this? (as opposed to ensuring the focus property gets
> >> updated in the appropriate places)
> >>
> >> By the way, our coding style is to always use ";" for javascript code.
> > I tried really hard to avoid this but couldn't make the dialog accept the
> Esc keypress to close it otherwise.
> By the way, there's really efficient way of debugging focus issues. It
> will tell you who exactly has the active focus as it changes.
>
> In tests/uqmlscene/main.cpp:
>
> """
> #define UQMLSCENE_DEBUG_ACTIVE_FOCUS 0
> """
>
> Change it to 1. Then run a est "eg: make tryShell" and see the output as
> active focus jump from item to item.
>
> You can also use the ActiveFocusLogger in src/main.cpp if you wanna
> debug on unity8 proper running on the target device.
>
> It really clarifies the focus situation.

PopupBase somehow breaks the focus chain, moreover the power dialog does the same, I'm giving up on finding a proper solution here :)

cf: Dialogs.qml, l.92
function showPowerDialog() {
    if (!dialogLoader.active) {
        dialogLoader.sourceComponent = powerDialogComponent;
        dialogLoader.active = true;
        dialogLoader.item.forceActiveFocus();
    }
}

« Back to merge proposal