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

Ubuntu logo shifts vertically when the login screen appears #4019

Closed
xnox opened this issue Nov 25, 2023 · 6 comments
Closed

Ubuntu logo shifts vertically when the login screen appears #4019

xnox opened this issue Nov 25, 2023 · 6 comments

Comments

@xnox
Copy link

xnox commented Nov 25, 2023

Expected Behavior

gnome-shell login-dialog uses a logo at the bottom of the screen which is the same file as the one use by plymouth

I expect the logo to remain on screen in the same place.

Actual Behavior

Plymouth positions the logo 96% on the vertical screen:

$ grep Watermark /usr/share/plymouth/themes/bgrt/bgrt.plymouth 
WatermarkHorizontalAlignment=.5
WatermarkVerticalAlignment=.96

yaru-themes positions the logo with margin 24px or 3em (depending on version)

https://github.com/ubuntu/yaru/blob/77d2d5ddedc00efd24f3bb2464efc689d6891b96/gnome-shell/src/gnome-shell-sass/widgets/_login-lock.scss#L40C1-L42C2

.login-dialog-logo-bin {
  margin:3em 0;
}

Steps to Reproduce the Problem

when 3em is not 4% of the screen height the logo will shift on screen.

System information

Jammy & Mantic have this problem

Yaru version

Jammy & Mantic have this problem

Screenshots

I don't know how to make them of the login screen. It is possible to run plymouth emulator

Upstream check

It does happen with upstream themes, as by default gnome spinner theme does not use a watermark logo in plymouth, and we do. Upstream solution is to "fade-in" watermark logo only once the login screen appears to avoid trying to line up the two logos.

How to fix it

Plymouth doesn't know what 3em is, it knows display dimentions, and scaling, and calculates absolute position on screen at 96% of vertical space.

This is tricky, i've tried changing gnome-shell css to say something like

.login-dialog-logo-bin {
  margin:4% 0;
}

But that doesn't work, because it ends up as 0% as it seems like the login-dialog-logo-bin has no idea what the outer space size is, and thus fails to calculate 4%. In gnome-shell javascript I have also failed to calculate what the total screen size is for each display to position the logo right.

Another alternative is to literary patch the logo to have free transparent margin around it, and just place it at the bottom of the screen. But then every ubuntu flavour would have to do that if they use gnome-shell & plymouth.

Another alternative is to patch both gnome-shell and plymouth to maybe pad the logo based on the dimensions of the logo (i.e. 10% of the rendered scaled logo) which should be screen independent.

I am at a loss here, but happy to help with patching plymouth / gnome-shelll / yaru-themes to make it work.

@Feichtmeier
Copy link
Member

Thanks @xnox

@Muqtxdir I know I started the plymouth theme years ago but I think you polished it. Where is the current code at? 😆

@Muqtxdir
Copy link
Member

hi @xnox

I apologize for such a late reply. my personal preference here would be to have the same behavior as that of upstream as it would not require to maintain patch but if you feel the patches to plymouth and yaru-theme would be a better option, then I am fine with that approach as well.

@xnox
Copy link
Author

xnox commented Jan 22, 2024

hi @xnox

I apologize for such a late reply. my personal preference here would be to have the same behavior as that of upstream as it would not require to maintain patch but if you feel the patches to plymouth and yaru-theme would be a better option, then I am fine with that approach as well.

there is no upstream behaviour to match here. In plymouth "upstream" they choose not to show logo on the bottom, and only make it fade in gdm on the bottom. Thus whichever placement of the distro logo on the bottom in gdm is, is what is "standard".

In our plymouth we do show distribution logo on the bottom & override gdm to not do fade-in and be in almost the same location.

But because said location is calculated differently there is jumping jitter in vertical placement of the logo between gdm and plymouth.

The two calculations are different, and I'm failing to figure out how I can match one calculation to the other, due to lack of CSS knowledge. (ie. change plymouth calculation, or change gdm3 and/or yaru css calculation, or change both of them).

@xnox
Copy link
Author

xnox commented Feb 18, 2024

With noble, I believe this is impossible to fix, as plymouth and gnome-shell have different opinions about the screen topology, scaling, fractional scaling, on per screen basis thus one can match it perfectly in like VM but not on any real laptop (anything modern with high dpi screens).

Instead I will move the plymouth logo out of the way as a bookmark, such that the transition is intentionally jumpy. This also means we can turn back on the stock upstream fade-in of the gnome login shell.

@xnox xnox closed this as completed Feb 18, 2024
@xnox
Copy link
Author

xnox commented Feb 18, 2024

Fixed in plymouth via https://launchpad.net/ubuntu/+source/plymouth/24.004.60-1ubuntu2

But this now also means, that we can turn on "fade-in" of the watermark logo back on (stock gnome behaviour) too.

@vanvugt
Copy link
Contributor

vanvugt commented Feb 19, 2024

The Ubuntu bug for this is https://bugs.launchpad.net/bugs/1872594

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants