/srv/irclogs.ubuntu.com/2014/07/21/#ubuntu-autopilot.txt

=== barry` is now known as barry_
=== barry_ is now known as barry
greybacko/16:49
elopiohey greyback. I've tried the tests, and I see the problem.17:46
elopioand I don't see a good solution.17:46
greybackthen we need a bad solution ;)17:46
elopiogreyback: lets say we hack the autopilot input  so when we click, it will do y + panel height17:47
elopiothen, I won't be able to click the panel.17:47
greybackelopio: then tests for fullscreen apps will be broken17:48
elopiothere are tests where we need to use the panel and the app.17:48
elopiogreyback: that too.17:48
greybackright, we can't hard-code it globally17:48
greybackso need to fix the globalRect to return the correct value17:49
elopiothat, or on each click of each app test, check if we are running under mir and if so, increase the y value.17:50
elopiofor each click, for each test, for each app, that's too much.17:51
greybackexcept if app fullscreen17:51
greybackit's still hacky17:51
greybackhow about testing on tablet and sidestage, where sides stage app is over to the right of the screen17:51
greybackwe can do a hack for now, but this is a problem that has to be solved ultimately17:51
elopioyes17:52
elopiogreyback: how hard is to make Mir behave as X does? is that not an option?17:53
greybackelopio: Mir & X are quite different. Apps do not know their position on screen. Only unity8 does17:54
greyback(mir being a library that unity8 uses)17:54
elopiogreyback: but if you can change whether the app draws over the panel or not, can't you update the x and y properly?17:56
elopioor maybe, I don't know, paint an invisible panel inside the app that's the same size as the top bar, so all the coordinates still make sense?17:56
elopiohum, I suppose you went all over those options already.17:57
greyback"invisible panel inside the app" is what is happening with Mir right now17:57
greybackand we removed that, it's a hack17:58
elopioah, that's why it used to work.17:58
greybackyep. It was a waste of memory and caused visual glitches17:59
elopiogreyback: Here is the only place where I think we have some chance:18:03
elopiohttp://bazaar.launchpad.net/~autopilot/autopilot-qt/trunk/view/head:/driver/introspection.cpp#L16418:03
greybackelopio: Is it dynamic? As in, if you're testing an app and part of the test is to reposition the app's window, will it reflect that?18:32
elopiogreyback: it should, yes.18:32
elopioat least on X that works.18:33
greybackelopio: that's not a safe comparison :) Mir != X in many ways18:33
elopiogreyback: I know. What I'm saying is that if it doesn't work on Mir, we need to fix it.18:35
elopiowe need it to work on both.18:35
greybackelopio: sure18:35
elopiobut to answer your question: yes, everytime we call globalRect, it's refreshed.18:36
greybackok cool18:42
greybackthomi: hey, when you've had your morning coffee, can we have a chat? I need your advice19:47
greybackand help probably19:47
thomigreyback: heh, sure - we can chat now if you like19:47
greybackthomi: ok cool. So we've been working on a thing called QtCompositor, which changes how Mir renders stuff to screen19:48
greybackpart of those changes is problematic to autopilot19:49
thomiuh oh19:49
greybackwith the old (current) architecture, every application got a fullscreen surface, and it deliberately kept an invisible border at the top, so the app contents would not be covered by the panel19:49
greybackthe new (qtcomp) arch, the application gets a surface of the exact size it needs, and that surface positioned under the panel19:50
thomiok19:50
greybackit seems that AP tests for Mir are injecting input events via uevent. Those events must be in screen coordinates.19:51
thomiyes, they should be19:51
greybackwhen the app had a fullscreen surface, the surface coordinates = screen coordinates19:51
thomiahhh19:51
greybackbut now with qt comp, that is no longer the case19:51
thomiI see where you're going with this :)19:52
greyback:)19:52
thomiso, in libautopilot-qt, we ask Qt to translate each widget's coordinates to screen-space19:52
thomiand report those back to the autopilot test19:52
thomiso In the past, Qt knew enough to be able to do that translation19:52
thomilet me find the code real quick, one second19:53
greybackyeah, X let Qt find the current screen position of the window. However Mir does _not_19:53
barrythomi: hi.  i wasn't very helpful about those 64 datetimes :/19:53
thomigreyback: https://bazaar.launchpad.net/~autopilot/autopilot-qt/trunk/view/head:/driver/introspection.cpp#L17119:54
thomibarry: I'll take a look in a moment and get back to you - you'll be online in 30 minutes or so?19:54
barrythomi: yep19:54
greybackthomi: with qtcomp, the only thing which knows the current surface position is unity819:55
thomigreyback: so if we can't do that, this is potentially a very large problem19:55
thomihmmm19:55
greybackthomi: what I can do is expose that information out of unity8 somehow, either via AP helper, or dbus at the worst.19:56
greybackbut that ofc means AP depends on unity819:56
thomiwell, we can make it depend on unity8 on the phablet devices only for now19:56
thomiand we really need to be able to get that information without having to put u8 into testability mode19:57
thomiwhich means some sort of separate IPC, and dbus seems appropriate19:57
greybackack19:57
thomiso this is a bit of an engineering problem from our side, but I'm sure it's solvable19:57
thomihmmmk19:57
thomiThe easiest way to do it would be to detect that we're on mir in autopilot-qt and do the dbus call there19:58
thomiso autopilot itself wouldn't have to change19:58
greybackok19:58
thomiand once we're doing that, we may as well store the surface coordinates in the app somehow19:59
thomihowever, that means making sure all apps can access the new u8 dbus interface (apparmour etc)19:59
greybackhow to identify a surface? appid would be unique, but is that info available?19:59
thomihmmm, not AFAIK, not in autopiot-qt anyway19:59
thomigreyback: could you use the caller from the dbus call?20:00
greybackthomi: possibly yes20:00
thomiso the u8 interface would simply be "tell me my surface geometry"20:00
greybackmakes sense20:00
thomigreyback: does the surface geometry ever change?20:01
thomiPresumably it will when the app moves from the side stage to the main stage20:01
greybackthomi: it can20:01
greybackyep20:01
greybackalso device rotation will resize the app surface (moving the panel)20:01
thomiok, so ideally we'd like a dbus signal for when that happens so we don't need to make this dbus call every time20:01
thomi..for when either of those things happens :)20:01
thomilike 'geometry_changed(new_geom)'20:02
greybackbut how to identify that surface?20:02
thomiahhh20:02
thomihmmm20:02
thomiugh20:02
greybacktbh the app knows when its surface has resized20:02
greybackit doesn't need dbus to tell it that20:03
greybackbut repositioned...20:03
thomihmmmm20:03
thomibut I'm not convinced that autopilot-qt knows that20:03
thomiso, taking a step back here, there is another option20:03
thomiwhich is to inject input events directly into the Qt event loop directly from autopilot-qt20:04
greybackAP-qt should be able to connect to the widthChanged and heightChanged signals on the QQUickView/Window20:04
thomihmmmm20:07
thomiap-qt has a rather limited view of the application tree. It can be tricky to find the specific node we want20:07
thomiugh20:08
greybackthomi: re inject-into-qt, it has a similar issue, those are just relatively positioned input events, Qt will not know then need to be transformed to the coord space of the surface20:08
thomiyeah20:08
thomihmmmm20:09
thomiok, so what about if we got the geometry information from autopilot itself20:10
thomiwe could then pass u8 the app id20:10
thomicrap, we can't monitor signals from AP at the moment20:11
greybackthomi: pid is unique and something we could use to identify surfaces20:11
thomiok, we have that too20:11
greybackcan send signals: surface with pid x has a geometry change20:11
thomiso the problem doing it from the AP client side is that we can't monitor dbus signals from the test20:12
greybackno? oh20:12
thomibecause we don't have an event loop running, since the test runner is all synchronous calls20:12
thomiand python-dbus won't run an event loop in a thread :(20:12
greybacksux20:12
thomiwe could hack something together with multiprocessing, but... that'd be awful20:13
thomigreyback: It seems to me like the best option here is to expose the surface geometry information to Qt in such a way that the  'mapToGlobal' call continues to work20:15
thomigreyback: to my mind, we're braking the contract between Qt and whatever sits above it if we don't supply that information any more20:15
thomiand, while I'd be happy hacking around it at a lower level, it seems like there's going to be some implementation issues no matter how we do it20:16
thomiI don't know anything about that interface, but is it not possible to do the work required there, so that method call continues to do the right thing?20:16
balloonshey thomi, we should chat about when you get some time https://bugs.launchpad.net/ubuntu-calendar-app/+bug/132860020:16
greybackthomi: I can't say I'm a big fan of that. I don't see why an app really needs to know its position on screen. But I'll put it to the Mir guys20:17
thomigreyback: well, the point isn't so much whether it needs to know or not20:17
thomigreyback: the point is that the API exists - there's a contract between Qt and the platform it runs on, and you're breaking that20:18
thomiballoons: ok, there's a queue for my attention at the moment, I'll add you to it :)20:18
thomigreyback: but like I say, I have no idea how much work that is. If it's less than 2 weeks development time, it's likely to be the fastest solution IMO20:19
thomi'cos any effort that involves refactoring autopilot / autopilot-qt is going to be rather slow and tedious20:19
greybackthomi: again I disagree, a pre-existing client API should not define the features of Mir.20:19
greybackbut I'll see if the Mir team are happy to expose this info20:20
thomigreyback: I agree that it should not, but in this case it does. Autopilot won't be  the only app that makes use of that Qt method, sooner or later something else will break20:20
thomiideally that method would be part of a Qt platform module, or similar20:20
thomiso different platforms can define how much they expose20:20
thomibut as it is, being a method on QWidget, you kind of have a responsibility to provide it, or you're breaking API20:21
thomigreyback: anyway, talk to the mir guys, and see what they say. I wonder if you could CC me in on that email please?20:21
greybackthat api call is backed by the qt platform api, but whether it is implemented is up to the implementer. I think that mapToGlobal is badly documented tbh20:22
thomiok, well, depending on the amount of work, it may be the shortest path to a solution20:22
thomiunless we can think of something better20:22
thomior you have a few extra developer-hours to patch autopilot-qt :)20:23
thomiballoons: barry, are you guys available for a quick hangout?20:27
barrythomi: yep, in 2m20:27
balloonssure ^^20:27
balloonswell.. hmm.. I might be voice only, my bw is tapped hard right now20:28
thomiI never understand how I have better internet in Dunedin, NZ than most people seem to in the states20:29
thomiare you guys still running on telegrams or something?20:30
barryi'm voice-only 'cause i'm not wearing pants20:30
barrythomi: i'm on20:30
thomihttps://plus.google.com/hangouts/_/g5odhpdf2zamosefl75lvqyrp4a?authuser=1&hl=en20:31
thomiballoons:20:32
thomi^^'20:32
balloonshopefully there isn't horrible lag :-) I can hear you20:32
barryhttps://docs.python.org/3/library/datetime.html#datetime.datetime.replace20:44
barryaware = naive.replace(tz=localtz)20:45
barryaware = naive.replace(tzinfo=localtz)20:45
thomigreyback: please also CC veebers in the email with the mir guys, since he'll be coordinating our side20:49
greybackack20:50

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!