app: Re-work the deactivation part in application_id_state event 01/24901/2 10.91.0 10.92.0 10.93.0 9.99.2 9.99.3 9.99.4 jellyfish/9.99.2 jellyfish/9.99.3 jellyfish/9.99.4 jellyfish_9.99.2 jellyfish_9.99.3 jellyfish_9.99.4 koi/10.91.0 koi/10.92.0 koi/10.93.0 koi_10.91.0 koi_10.92.0 koi_10.93.0
authorMarius Vlad <marius.vlad@collabora.com>
Sat, 27 Jun 2020 15:20:19 +0000 (18:20 +0300)
committerMarius Vlad <marius.vlad@collabora.com>
Wed, 8 Jul 2020 17:40:39 +0000 (20:40 +0300)
commit3b0e548c3adae12e72cc6d6dc22f5ecc475aa7c2
tree060896dd1f8a4484caf267afe0adf539d68864cd
parent40e6e78a19483dc5822ded81cea041f3983a877f
app: Re-work the deactivation part in application_id_state event

In commit 11b9762f115778 we've added some logic in place that would
allow to start the application de-activated (that is hidden), as to
avoid 'stealing' the input focus (hoovering the pointer over a surface
will give that surface focus).

alexa-viewer application would be started by default by the system and
will be set 'invisible' (due to being a Qt app with the property set as
visible: false), and most likely this might cause a bit
of confusion for users. Also, by default, the compositor will display
the application as soon as started.

This patch re-works the de-activation part to handle a corner case, as
in commit 11b9762f115778 we would send the de-activate request as a
response in an event handler but it seems we can't guarantee that at that
time the surface was indeed activated.

So, instead of using application_id event, we use the application_id_state
event, which guarantees that we were actually sending the de-activate
request after we got the activate state event from the compositor.

Bug-AGL: SPEC-3412

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ie50b8011700d258a899374176fb78dcd528f88c1
app/main.cpp