[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1110858: Patch: Bug#1110858



Please find attached the DEP-3–formatted patch discussed in the bug report, which appears to have been omitted by the auto-submission via the reportbug tool - Sorry!
Description: Center password and status prompts on the active display
 This removes use of Window.GetX() for horizontal placement in the
 ceratopsian Plymouth theme, fixing off-right prompts on multi-monitor
 mixed-resolution setups by centering via Window.GetWidth().
Author: Shaun Lewis <shaun@lewisonline.xyz>
Forwarded: yes
Last-Update: 2025-08-11
---
--- ./ceratopsian-theme/plymouth/ceratopsian.script.orig	2025-08-11 14:57:47.965813362 +0100
+++ ./ceratopsian-theme/plymouth/ceratopsian.script	2025-08-11 14:58:03.682310624 +0100
@@ -330,7 +330,7 @@
     message_label.height = message_image.GetHeight ();
 
     # Center the line horizontally
-    message_label.x = Window.GetX () + Window.GetWidth () / 2 - message_label.width / 2;
+    message_label.x = (Window.GetWidth (0) - message_label.width) / 2;
 
     message_label.y = top_of_the_text;
 
@@ -365,7 +365,7 @@
     fsck_label.height = fsck_label.image.GetHeight ();
 
     # Centre the label horizontally
-    fsck_label.x = Window.GetX () + Window.GetWidth () / 2 - fsck_label.width / 2;
+    fsck_label.x = (Window.GetWidth (0) - fsck_label.width) / 2;
 
     local.first_label = get_message_label (label, 1, 0);
 
@@ -482,7 +482,7 @@
     entry.sprite.SetImage (entry.image);
 
     # Centre the box horizontally
-    entry.x = Window.GetX () + Window.GetWidth () / 2 - entry.image.GetWidth () / 2;
+    entry.x = (Window.GetWidth (0) - entry.image.GetWidth ()) / 2;
 
     # Put the entry below the second label.
     entry.y = message_notification[2].y + label.height * 1.5;
@@ -530,7 +530,7 @@
     spaces = Math.Int( (password_dialogue.entry.image.GetWidth () - (margin * 2)) / (bullet_width / 2 ) );
     #DebugMedium ("spaces = " + spaces + ", bullets = " + bullets);
     bullets_area.width = margin + spaces * (bullet_width / 2);
-    bullets_area.x = Window.GetX () + Window.GetWidth () / 2 - bullets_area.width / 2;
+    bullets_area.x = (Window.GetWidth (0) - bullets_area.width) / 2;
     #DebugBottom ("pwd_entry (x,y) = " + password_dialogue.entry.x + "," + password_dialogue.entry.y
     #             + "), bullets_area.x = " + bullets_area.x + ", bullets_area.width = " + bullets_area.width);
     if (bullets > spaces)

Reply to: