microsoft / WSA

Developer-related issues and feature requests for Windows Subsystem for Android
MIT License
1.52k stars 836 forks source link

WSA starting 2308 and into 2309 - app window resize degraded - content stays fixed to narrow center layout #469

Open Beej126 opened 11 months ago

Beej126 commented 11 months ago

Steps to reproduce

(this could be dupe of #425. it seemed different enough that i started new bit i'll be ready to close and move over there if directed)

The AllTrails app (currently v18.4.3) is a solid repro of undesired behavior.

Up to WSA 2307.40000.6 it resizes very fluidly, including maximize. As of WSA 2308, when app window is resized, the contents stay fixed to narrow center layout. I am seeing this degraded resize response in 2309.40000.2.0

Besides resize, the mouse and touchscreen inputs are also degraded... for example, on the map screen within AllTrails app, the mouse input only seems to register when the mouse tracks outside of the visible map, and it seems to only work on the left white space of the window vs the right.

Also notable, I'm seeing the prompt "This app does not support resize. Tap refresh to attempt anyway."... upon trying the refresh button, the screen does actually rerender into more of the open space and might be a reasonable solution but within a few seconds after, the app always crashes out.

✔️ Expected Behavior

Screenshot of desired: image

❌ Actual Behavior

Screenshot of undesired: image

Other Software

No response

Please specify the version of Windows Subsystem for Android

2309.40000.2.0

stleusc commented 10 months ago

I had the same issue and noticed that in the advanced developer settings for my app, there was a checkbox along the lines of: FORCE_APP_NOT_RESIZABLE or something like that. Unticked it and all is well again. I know for sure I never turned that on though.

stleusc commented 10 months ago

I had the same issue and noticed that in the advanced developer settings for my app, there was a checkbox along the lines of: FORCE_APP_NOT_RESIZABLE or something like that. Unticked it and all is well again. I know for sure I never turned that on though.

Manage Developer Settings -> App Compatibilty Changes -> YOUR APP -> FORCE_NO_RESIZE_APP

That was suddenly set for my app and I had the same behavior you described. Unchecked that fixed it.

Beej126 commented 10 months ago

I had the same issue and noticed that in the advanced developer settings for my app, there was a checkbox along the lines of: FORCE_APP_NOT_RESIZABLE or something like that. Unticked it and all is well again. I know for sure I never turned that on though.

@stleusc, thanks for the suggestion... navigating into App Compatibility Changes on my system, i get the message:

No apps available App compatibility changes can only be modified for debuggable apps. Install a debuggable app and try again.

poking around a little more i've come to see that expanding to certain window sizes and then closing and restarting the app is a fairly workable solution... when the app is restarted, the content will fully occupy the window... using any of the the Windows 11 "snap" vertical layouts seems to work well this way.

still though, resizing the window while the app is running makes it start SCALING content, versus how previous builds would more desirably EXPAND to use the space with no scaling.

Beej126 commented 10 months ago

I had the same issue and noticed that in the advanced developer settings for my app, there was a checkbox along the lines of: FORCE_APP_NOT_RESIZABLE or something like that. Unticked it and all is well again. I know for sure I never turned that on though.

@stleusc, thanks for the suggestion... navigating into App Compatibility Changes on my system, i get the message:

No apps available App compatibility changes can only be modified for debuggable apps. Install a debuggable app and try again.

poking around a little more i've come to see that expanding to certain window sizes and then closing and restarting the app is a fairly workable solution... when the app is restarted, the content will fully occupy the window... using any of the the Windows 11 "snap" vertical layouts seems to work...

still though, resizing the window while the app is running makes it start SCALING content, versus how previous builds would more desirably EXPAND to use the space with no scaling and the mouse interaction is still off track, requiring mousing into approximately the left quarter of the window in white space outside of the app content for mouse action to register.

mbalajee commented 10 months ago

I had the same issue, turning OFF the FORCE_APP_NOT_RESIZABLE flag fixed the issue. Would be helpful to turn this off programmatically so users wouldn't face this issue

EDIT: I don't see the issue for apps installed from amazon app store. Happens only for side loaded apps. So hopefully this is not an issue in production 🤞

Beej126 commented 10 months ago

EDIT: I don't see the issue for apps installed from amazon app store. Happens only for side loaded apps. So hopefully this is not an issue in production 🤞

ah there's my difference, i'm sideloading the app i'm dealing with... i'm assuming that's why the FORCE_APP_NOT_RESIZABLE option is not available

nieubank commented 10 months ago

If this is an app you're developing, explicitly tagging the default/launcher activity as resizeableActivity="true" will opt-out of these heuristics.

Unfortunately a majority of apps don't handle resize well so we've automatically opt-in those that target less than SDK 23, have a fixed orientation launcher activity.

mbalajee commented 10 months ago

@nieubank Our app targets sdk 33 and the flag FORCE_APP_NOT_RESIZABLE is still enabled by default. I have to disable it everytime for the resize to work. resizeableActivity="true" is the default for apps targetting N and above.

nieubank commented 10 months ago

@nieubank Our app targets sdk 33 and the flag FORCE_APP_NOT_RESIZABLE is still enabled by default. I have to disable it everytime for the resize to work. resizeableActivity="true" is the default for apps targetting N and above.

Yes, it is the default, however we see as many as 60% of apps that don't specify anything in their manifest (so true by default) do not handle resize in freeform mode correctly, so we treat the default as false in WSA (we used to only do this for Amazon-installed apps, but in 2308 expanded that mode broadly to provide consistency). So the best way to ensure the app is treated as resizeable is to explicitly add true to the manifest.

Beej126 commented 10 months ago

thanks @nieubank, this is helpful info... any chance we could lobby for a developer setting that flips this mode back the other way?

stleusc commented 10 months ago

I don't think that's fully correct... Or at least not properly working. My app explicitly sets the property to true in the manifest and still got the flag applied!


From: Beej @.> Sent: Wednesday, November 15, 2023 12:38:38 PM To: microsoft/WSA @.> Cc: Stephan Leuschner @.>; Mention @.> Subject: Re: [microsoft/WSA] WSA starting 2308 and into 2309 - app window resize degraded - content stays fixed to narrow center layout (Issue #469)

thanks @nieubankhttps://github.com/nieubank, this is helpful info... any chance we could lobby for a developer setting that flips this mode back the other way?

— Reply to this email directly, view it on GitHubhttps://github.com/microsoft/WSA/issues/469#issuecomment-1812977301, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAIUMSWG5I73HX26PKIHCXDYET4Z5AVCNFSM6AAAAAA673MBYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJSHE3TOMZQGE. You are receiving this because you were mentioned.Message ID: @.***>

Beej126 commented 10 months ago

@nieubank, i just went and tweaked the AndroidManifest.xml for my app to include android:resizeableActivity="true" on the MAIN/LAUNCHER activity and it does seem to behave a little differently in that it does now interactively scale the content but this is still different than previous behavior where the app content would expand to use the space without scaling and the mouse input is still way off... is there perhaps another additional setting to reach the desired behavior in tandem with resizeableActivity?

mbalajee commented 10 months ago

@nieubank I created an Amazon app store account ONLY to test the resizing behavior. Uploaded app to the store, with resizableActivity set to true for the launcher activity in the Manifest file, and installed it from Amazon app store. Now when the app window resizes, content is not scaled automatically, I had to click the refresh button at the bottom corner to resize, which relaunches the app.

I don't see the app in Manage Developer Settings -> App Compatibility Changes -> YOUR APP (Not showing up for any apps installed from Amazon app store). I only see this option for the debug builds (tested by installing directly from Android studio).

We're basically struck here. We will be launching it soon for public and would very much love to have the resizing issue fixed.

Below are the recordings from release build (installed from amazon store) and debug build (installed from Android studio)

App installed from Amazon app store (resizableActivity = true) App compatibility not showing release build installed from app store
App (Debug variant) installed directly from Android studio (resizableActivity = true) App compatibility showing debug builds

I can invite you to the Live Testing account if necessary

mbalajee commented 9 months ago

android:resizeableActivity=true in AndroidManifest.xml fixed the problem. App is now automatically resized when dragged around the corners.

Issue: However if the app was initially installed with resizeableActivity=false then it stays that way even when the app is uninstalled & reinstalled after setting resizeableActivity=true. It looks like WSA remembers some of these settings even when the app is gone.

@nieubank

viliml commented 7 months ago

Yes, it is the default, however we see as many as 60% of apps that don't specify anything in their manifest (so true by default) do not handle resize in freeform mode correctly, so we treat the default as false in WSA (we used to only do this for Amazon-installed apps, but in 2308 expanded that mode broadly to provide consistency). So the best way to ensure the app is treated as resizeable is to explicitly add true to the manifest.

@nieubank Has there been any progress on that front? Ideally as more app developers put the necessary resizeable=false in their manifests, you should revert this hack and return to standard-defined behavior.

Beej126 commented 7 months ago

Yes, it is the default, however we see as many as 60% of apps that don't specify anything in their manifest (so true by default) do not handle resize in freeform mode correctly, so we treat the default as false in WSA (we used to only do this for Amazon-installed apps, but in 2308 expanded that mode broadly to provide consistency). So the best way to ensure the app is treated as resizeable is to explicitly add true to the manifest.

@nieubank and anyone else on the project tuned into this, as an end user of the android on windows feature, I want to reiterate the significant degradation in capability that comes with this decision... my experience running modern popular apps via sideload is that ALL apps regardless of the resizing flag have been degraded, not just from a resizing standpoint but basic mouse interaction. The bundle of changes that came in with this determination appear to include unintended collateral regression. Moving beyond WSA 2307 is untenable. Grateful there is at least a solid working version available. Shame that if this is never addressed, essentially translates into this team throwing it's time down a hole coding enhancements that will never be used. Really hoping your team can reconsider and readdress. Wondering if this is going under the radar due to end users not having upgraded to this version yet in volume, and if so, not knowing where/how to report the issue.