FLAG_LAYOUT_NO_LIMITS it is not respected on one screen mode

Copper Contributor

The FLAG_LAYOUT_NO_LIMITS is not respected on one screen mode on real device and emulator. 

 

2021-09-22_23-08-14.png2021-09-22_23-08-34.png

 

This was reported by one of my app user and can be replicated really easy on emulator. Placing a View with FLAG_LAYOUT_NO_LIMITS outside the screen boundaries does not work on single screen mode, as you can see in the screenshots above. When both screens are visible, the blue rectangle (a view) it is correctly placed outside the screen, when the screen is closed it is restricted inside the screen. 

 

Video demo with the problem: https://streamable.com/2tgevf

5 Replies

@micku7zu thanks for the additional info - from what I understand this is the same issue we discussed on Twitter but with a different repro? Adding the GitHub link so that all the relevant info is here:

https://github.com/micku7zu/SurfaceDuoDispathGestureBug

 

I downloaded Quick Cursor app (great idea BTW) and noticed that in 1.11.3 you've listed a Surface Duo bug as fixed (Sep 21, 2021). Since this post is from Sep 22, it seems like there are still issues with FLAG_LAYOUT_NO_LIMITS though? To confirm: the cursor tracking part seems to work on both dual-screen and both single-screens, however the click target is wrong when it's only the right screen that's active?

The changelog from Quick Cursor refers to some other bug (my resizing algorithm), not related to any of the discussions I opened here.

This bug with FLAG_LAYOUT_NO_LIMITS was not discussed on Twitter, it is something new that some user reported after I've talked with you about the other bug: https://techcommunity.microsoft.com/t5/surface-duo-sdk/display-screen-fold-info-from-accessibility-s...

None of this bugs can be fixed in the app, from my current Android knowledge.

The FLAG_LAYOUT_NO_LIMITS issue can be reproduced easily in Quick Cursor:

1. Enable Quick Cursor -> Settings -> Debug -> Visual Debug
2. Move the tracker outside the screen with the screens open
3. Move the tracker outside the screen with only one screen active

You will see that the blue rectangle under the tracker (a view attached directly to Window Manager with FLAG_LAYOUT_NO_LIMITS) is restricted inside window limits when one screen is active. This should not happen according to the Android Documentation.

Or just do a sample app and attach a view to Window Manager outside the screen coordinates, it should work with the flag but it doesn't.

@Craig_Dunn 

To summarize, there are two bugs reported by the same user of my app in different days:

 

1. AccessibilityService.dispatchGesture coordinates x,y are not adjusted correctly when the user is using only the right screen (the left one is off). This can be an intended way of working but then there should be a way to detect that only the right screen is on, to adjust the coordinates from the app: https://techcommunity.microsoft.com/t5/surface-duo-sdk/display-screen-fold-info-from-accessibility-s...

 

2. FLAG_LAYOUT_NO_LIMITS is not working when one screen is open(this discussion):  https://techcommunity.microsoft.com/t5/surface-duo-sdk/flag-layout-no-limits-it-is-not-respected-on-...

 

I've created two separate discussions because they are completely different. 


@Craig_Dunn wrote:

I downloaded Quick Cursor app (great idea BTW) 


Thanks! I consider the app extremely useful considering the screen sizes trends and also a necessity for certain people with disabilities. 

 

I don't own a Surface Duo device, I just test it on the emulator, so I don't know exactly how easy is to use the app on it, but I have some users that use the app and reported those bugs. 

 

I want to adapt/fix the app for Surface Duo and for the recently released Surface Duo 2. I've currently made some nasty hacks for Duo for the app to be usable, but the opened discussions can't be fixed because Surface Duo Android implementation doesn't respect the official documentation (or needs to complicated hackish solution). 

Gotcha, thanks for the clarification.