diff options
| author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2026-03-04 13:29:50 +0000 |
|---|---|---|
| committer | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2026-03-04 13:29:50 +0000 |
| commit | fc5f66d94b99e9741fd537b21f0b0809383d8ded (patch) | |
| tree | 3567a8e54bb0243aabd836d0e0c18436bb9f0f77 | |
| parent | 12d3b8469526d707df830c41ca49f0bf7ae9891f (diff) | |
| download | theme-master.tar theme-master.tar.gz theme-master.tar.bz2 theme-master.tar.xz theme-master.zip | |
Older versions of plymouth used to clear the screen if the display
resolution changed whilst the splash screen was being displayed. The
current version leaves the old image in place, thus either partially
filling the screen or being cropped, depending on whether the display
resolution went up or down. We can use the display hotplug callback
mechanism to detect when the display reolution changes and resize the
image accordingly.
| -rw-r--r-- | common/plymouth/mga.script | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/common/plymouth/mga.script b/common/plymouth/mga.script index 32a4374..7297433 100644 --- a/common/plymouth/mga.script +++ b/common/plymouth/mga.script @@ -50,14 +50,19 @@ else { # for now we just take the image as it is - no up or down scaling # scale_factor = 1; -background.image = background.original_image.Scale(Window.GetMaxWidth() , Window.GetMaxHeight()); - background.sprite = SpriteNew(); -background.sprite.SetImage(background.image); -background.sprite.SetX(Window.GetMaxWidth() / 2 - background.image.GetWidth() / 2); # Place in the centre -background.sprite.SetY(Window.GetMaxHeight() / 2 - background.image.GetHeight() / 2); -background.sprite.SetZ(-10000); # Place right at the back +fun display_hotplug_callback () +{ + background.image = background.original_image.Scale(Window.GetMaxWidth() , Window.GetMaxHeight()); + background.sprite.SetImage(background.image); + background.sprite.SetX(Window.GetMaxWidth() / 2 - background.image.GetWidth() / 2); # Place in the centre + background.sprite.SetY(Window.GetMaxHeight() / 2 - background.image.GetHeight() / 2); + background.sprite.SetZ(-10000); # Place right at the back +} +Plymouth.SetDisplayHotplugFunction (display_hotplug_callback); + +display_hotplug_callback(); sprite_prompt = SpriteNew(); @@ -242,4 +247,3 @@ fun quit_callback () } Plymouth.SetQuitFunction(quit_callback); - |
