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

Animation not centered on multiple monitors #42

Open
gop3k opened this issue Oct 10, 2023 · 18 comments
Open

Animation not centered on multiple monitors #42

gop3k opened this issue Oct 10, 2023 · 18 comments

Comments

@gop3k
Copy link

gop3k commented Oct 10, 2023

I'm a Linux Mint 21.2 Cinnamon Edition user, and I've been using your Plymouth theme 'colorful_sliced'. I recently encountered an issue where the theme displays with an offset across both screens on my dual-screen setup.

After extensive research and experimentation, I managed to find a workaround by replacing "Window.GetX()" with "Window.GetX(0)" and "Window.GetY()" with "Window.GetY(0)"in the theme's script (lines 36 and 37), which centers the animation on both screens.

However, I'm keen to understand more about the values for functions like 'Window.GetX()' and 'Window.GetY()' used in Plymouth scripts. The official documentation lacks specific details, and online searches haven't provided clarity.

I'd appreciate your insights and if possible, testing this solution on your system.

Thank you for your contributions to the open-source community.

@IPlayZed
Copy link

When using a custom theme from here for multiple monitors it is not applied only to the main one in my case. On shutdown this doesn't happen. Also, hot-plugging causes the animation to crash.

@IPlayZed
Copy link

Probably this is linked to #36.

@TheRedCyclops
Copy link

In my case changing

flyingman_sprite.SetX(Window.GetX() + (Window.GetWidth(0) / 2 - flyingman_image[0].GetWidth() / 2)); # Place images in the center
flyingman_sprite.SetY(Window.GetY() + (Window.GetHeight(0) / 2 - flyingman_image[0].GetHeight() / 2));

to

flyingman_sprite.SetX(Window.GetX() + (Window.GetWidth(1) / 2 - flyingman_image[0].GetWidth() / 2)); # Place images in the center
flyingman_sprite.SetY(Window.GetY() + (Window.GetHeight(1) / 2 - flyingman_image[0].GetHeight() / 2));

in the script file fixes it

@dax-dot-gay
Copy link

Same issue here, also fixed by

In my case changing

flyingman_sprite.SetX(Window.GetX() + (Window.GetWidth(0) / 2 - flyingman_image[0].GetWidth() / 2)); # Place images in the center
flyingman_sprite.SetY(Window.GetY() + (Window.GetHeight(0) / 2 - flyingman_image[0].GetHeight() / 2));

to

flyingman_sprite.SetX(Window.GetX() + (Window.GetWidth(1) / 2 - flyingman_image[0].GetWidth() / 2)); # Place images in the center
flyingman_sprite.SetY(Window.GetY() + (Window.GetHeight(1) / 2 - flyingman_image[0].GetHeight() / 2));

in the script file fixes it

For circle_hud specifically

@IPlayZed
Copy link

Will this cause a regression (improper placement) if you use only 1 monitor? I can not test this now. @Glich440 @gop3k

I think it would cause issues if there is only 1 monitor if the array is 0 indexed always for GetWidth() and GetHeight().

Is there any way so this can be dynamically configured in runtime? IMO It would be reasonable to handle 1,2 and 3 horizontal monitor setups imo and falling back to showing only on 1 (and making sure it does not show on others) on more complex setups.
As far as I understand there would be no way to get information at this boot stage about how the monitors are placed (like two verticals and one on top at the middle)? @adi1090x

@TheRedCyclops
Copy link

TheRedCyclops commented Jun 22, 2024

I think that probably fixes it, but I can't test it right now due to another bug with the systemd password prompt not being shown, I would have to try the solutions in #10

@gop3k
Copy link
Author

gop3k commented Jun 28, 2024

Will this cause a regression (improper placement) if you use only 1 monitor? I can not test this now. @Glich440 @gop3k

I think it would cause issues if there is only 1 monitor if the array is 0 indexed always for GetWidth() and GetHeight().

These are my screens resolutions :1920x1080, 1280x1024

When I start my computer with only one screen, replacing "Window.GetX()" with "Window.GetX(0)" and "Window.GetY()" with "Window.GetY(0)" in the lines 36 and 37 of the theme's script work both with dual monitor and with only one monitor for me.

@TheRedCyclops
Copy link

I think that it may be related to what screen is detected first, in my case the smaller one is detected as 0. This may be due to the fact that it is connected via HDMI vs the larger one that is connected via Display Port

@gop3k
Copy link
Author

gop3k commented Jun 28, 2024

Almost the same here : the bigger monitor is on HDMI and the smaller one on Display Port.

@IPlayZed
Copy link

Then a PR with your changes would probably fix this for most setups.

@TheRedCyclops
Copy link

the problem is that if the index is set to 1 it probably breaks the most common setup, one monitor

@gop3k
Copy link
Author

gop3k commented Jun 29, 2024

Please see the first post: I didn't set any index to 1 and my fix works for both 1 monitor and 2.

@bphenriques
Copy link

bphenriques commented Sep 7, 2024

I face the same issue. Laptop screen connectef to a external screen. The animation bounces between places on both screens. Works fine when the external screen is disconnected

@IPlayZed
Copy link

IPlayZed commented Sep 8, 2024

I face the same issue. Laptop screen connectef to a external screen. The animation bounces between places on both screens. Works fine when the external screen is disconnected

@bphenriques Did applying the patch showed here solve this issue for you?

@bphenriques
Copy link

I face the same issue. Laptop screen connectef to a external screen. The animation bounces between places on both screens. Works fine when the external screen is disconnected

@bphenriques Did applying the patch showed here solve this issue for you?

I am on NixOS and I have to learn how to apply a patch. Will try this week and provide more details on my setup for reference

@bphenriques
Copy link

I face the same issue. Laptop screen connectef to a external screen. The animation bounces between places on both screens. Works fine when the external screen is disconnected

@bphenriques Did applying the patch showed here solve this issue for you?

I did test and it is hard to test reliably as it depends on how fast the external display turns on and attempts to show the boot logo.

I believe fixed at first but then it did not (switched between the configurations).

This is the overlay I used:

 (final: prev: {
    adi1090x-plymouth-themes = prev.adi1090x-plymouth-themes.overrideAttrs (previousAttrs: {
      installPhase = previousAttrs.installPhase + ''
        find $out/share/plymouth/themes/ -name \*.script -exec sed -i 's/Window.GetX()/Window.GetX(0)/g' {} \;
        find $out/share/plymouth/themes/ -name \*.script -exec sed -i 's/Window.GetY()/Window.GetY(0)/g' {} \;
      '';
    });
  })

@arthurzenika
Copy link

I'm getting hit by this problem too. In my case I also seem to have a resolution change at some point in the boot which is visually not great (single and dual screen problem).

@IPlayZed
Copy link

It would make the most sense to copy the configuration of the out of the box BGRT theme used to duplicate animation on all monitors. So far, I have not seen problems with that on any of my setups.

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

No branches or pull requests

6 participants