Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OOBE] Resizing of window (at opening) results in unwanted effects #10598

Closed
Jay-o-Way opened this issue Apr 5, 2021 · 15 comments
Closed

[OOBE] Resizing of window (at opening) results in unwanted effects #10598

Jay-o-Way opened this issue Apr 5, 2021 · 15 comments
Labels
Issue-Bug Something isn't working Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. Priority-3 Bug that is low priority Product-Settings The standalone PowerToys Settings application

Comments

@Jay-o-Way
Copy link
Collaborator

Microsoft PowerToys version

0.35.0

Running as admin

No

Area(s) with issue?

General

Other Software

No response

Steps to reproduce

  • Open the Settings window
  • Click the "Welcome to PowerToys" link
  • Look closely at the nNavigation

✔️ Expected Behavior

None or normal animation

❌ Actual Behavior

There's an animation at the moment the window is opened, but it only applies to Seven of Nine navigation items. First two are stationary.

Also notice the incorrect display of the contents, the very first time.

2021-04-05.18-19-20.mp4
@Jay-o-Way Jay-o-Way added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Apr 5, 2021
@Jay-o-Way
Copy link
Collaborator Author

Very rare:
image

@htcfreek
Copy link
Collaborator

htcfreek commented Apr 5, 2021

Very rare:
image

That's strange. We had a bug on this while in pr state. But this should be fixed.

Can you add some details on you monitor setup for investigation, please.

cc: @niels9001

@Jay-o-Way
Copy link
Collaborator Author

The monitor setup is very standard, 1920x1080 @ 100%. It happened the very fist time while recording, and once later after clicking the link again and again. But like I said: it's rare :)

@htcfreek
Copy link
Collaborator

htcfreek commented Apr 5, 2021

The monitor setup is very standard, 1920x1080 @ 100%. It happened the very fist time while recording, and once later after clicking the link again and again. But like I said: it's rare :)

For me it's looks like a xaml/winui problem on your system. 🤷

@Jay-o-Way
Copy link
Collaborator Author

Jay-o-Way commented Apr 5, 2021

I'm guessing it (the width) has to do with the logic that happens when the window is called for. There are functions like

"window.width=0"
"window.height=0"
"fit into window"
"move to center"

(with the idea to remove flickering) and they all "shake the window around" and the contents just has have to deal with it. Every single time. I suggest to remove some of these weird things.

@htcfreek
Copy link
Collaborator

htcfreek commented Apr 5, 2021

I'm guessing it (the width) has to do with the logic that happens when the window is called for. There are functions like

"window.width=0"
"window.height=0"
"fit into window"
"move to center"

(with the idea to remove flickering) and they all "shake the window around" and the contents just has have to deal with it. I suggest to remove some of these weird things.

The move to center must be there to avoid incorrect placing. (Don't know the issue number at the moment.)

@Jay-o-Way
Copy link
Collaborator Author

Jay-o-Way commented Apr 5, 2021

#10022

        public static void ShowHide(Window window)
        {
            // To limit the visual flickering, show the window with a size of 0,0
            // and don't show it in the taskbar
            var originalHeight = window.Height;
            var originalWidth = window.Width;
            var originalMinHeight = window.MinHeight;
            var originalMinWidth = window.MinWidth;

            window.MinHeight = 0;
            window.MinWidth = 0;
            window.Height = 0;
            window.Width = 0;
            window.ShowInTaskbar = false;

            window.Show();
            window.Hide();

            window.Height = originalHeight;
            window.Width = originalWidth;
            window.MinHeight = originalMinHeight;
            window.MinWidth = originalMinWidth;
            window.ShowInTaskbar = true;
        }

It's overkill. Just use WindowStartupLocation="CenterScreen" or something.

@crutkas
Copy link
Member

crutkas commented Apr 5, 2021

This could totally be an artifact of XAML Islands / NavView WinUI 2.x. I've never seen it so I'd defer to just the migration then for WinUI 3 rather than fix it here.

After the recalc, it is rendered correctly so i'd put this as a low pri item and there is no clear repro and have the actual fix be the port in #6715

@crutkas crutkas closed this as completed Apr 5, 2021
@crutkas crutkas added Product-Settings The standalone PowerToys Settings application Resolution-Won't fix Priority-3 Bug that is low priority Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Apr 5, 2021
@Jay-o-Way
Copy link
Collaborator Author

@crutkas Freek and I have been going back and forth about the (rare) visual width bug, but what about the animation that does not get applied to the first two items??

@crutkas
Copy link
Member

crutkas commented Apr 5, 2021

I've noticed the animation quirk as well but that very well could also be a quirk of Islands. Settings actually has a similar keyboard focus quirk for items 3 and lower. Looking at the code nothing screamed smoking gun for cause. Knowing in a few months all this code will go a lift and shift to WinUI3, not something i feel we need to spend time on since they do actual quickly render correctly.

@htcfreek
Copy link
Collaborator

htcfreek commented Apr 5, 2021

@Jay-o-Way, @crutkas
I would like to mention that my name is neither htc nor freek. (htcfreek is a fantasy name made from letters of my name and a misspelled german word.) 😂 You can use htcfreek or Heiko.

@Jay-o-Way
I think this is a xaml bug. The animation is xaml driven and not initiated or manipulated by our code.

@niels9001
Copy link
Contributor

@Jay-o-Way Only OOBE suffers from this while we made no UI related changes to the default WinUI controls. I wasn't able to reproduce it on my machine.

I agree with @crutkas that this is probably one of the many visual bugs caused by XAML Islands. (The same code running in UWP does not have these bugs).

Once we adopt WinUI 3 these bugs are hopefully gone, if not let's revisit this issue then :).

@Jay-o-Way
Copy link
Collaborator Author

I would like to mention that my name is neither htc nor freek. (htcfreek is a fantasy name made from letters of my name and a misspelled german word.) 😂 You can use htcfreek or Heiko.

My apologies. Freek is a plausible name, but I was indeed assuming, since your full name doesn't show next to your screen name :)

For the rest: alright then. 🤐

@htcfreek
Copy link
Collaborator

htcfreek commented Apr 5, 2021

I would like to mention that my name is neither htc nor freek. (htcfreek is a fantasy name made from letters of my name and a misspelled german word.) 😂 You can use htcfreek or Heiko.

My apologies. Freek is a plausible name, but I was indeed assuming, since your full name doesn't show next to your screen name :)

Added my first name to the profile now. 😂

Freek (correctly: Freak) is someone that is really good in something and invests much time in that thing. In my situation: Computers 😅

@Jay-o-Way
Copy link
Collaborator Author

Jay-o-Way commented Apr 5, 2021

@niels9001 @crutkas @htcfreek Late insight 💡 I now realize the two things (width & 'animation') are a (unwanted and relatively slow) result of the immediate resizing - first to width & height of zero and back to normal. So, not a xaml bug, but a result of human programming.

@Jay-o-Way Jay-o-Way changed the title [OOBE] Start-up of Navigation buggy [OOBE] Resizing of window (at opening) results in unwanted effects Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. Priority-3 Bug that is low priority Product-Settings The standalone PowerToys Settings application
Projects
None yet
Development

No branches or pull requests

4 participants