From 823b541a24af07eafbf60846bfd4c80f2ce9fa66 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Wed, 9 Jul 2008 21:40:58 +0000 Subject: [PATCH] - add ctrl-r to rotate text color palette back to stock values --- plymouth.spec | 7 ++- restore-color-palette.patch | 113 ++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 restore-color-palette.patch diff --git a/plymouth.spec b/plymouth.spec index b8217e4..2e9e5ad 100644 --- a/plymouth.spec +++ b/plymouth.spec @@ -1,7 +1,7 @@ Summary: Plymouth Graphical Boot Animation and Logger Name: plymouth Version: 0.5.0 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://freedesktop.org/software/plymouth/releases/%{name}-%{version}.tar.bz2 @@ -16,6 +16,7 @@ Requires: elfutils Requires: system-plymouth-plugin >= %{version}-%{release} Patch0: plymouth-0.5.0-fix-ppc.patch +Patch1: restore-color-palette.patch %description Plymouth provides an attractive graphical boot animation in @@ -69,6 +70,7 @@ spins in the shape of an infinity sign. %setup -q %patch0 -p1 -b .fix-ppc +%patch1 -p1 -b .restore-color-palette %build %configure --enable-tracing --disable-tests --without-boot-entry \ @@ -174,6 +176,9 @@ fi %{_libdir}/plymouth/spinfinity.so %changelog +* Wed Jul 9 2008 Ray Strode - 0.5.0-4 +- add ctrl-r to rotate text color palette back to stock values + * Tue Jul 8 2008 Ray Strode - 0.5.0-3 - Fix populate script on ppc (bug 454353) diff --git a/restore-color-palette.patch b/restore-color-palette.patch new file mode 100644 index 0000000..e04d64c --- /dev/null +++ b/restore-color-palette.patch @@ -0,0 +1,113 @@ +commit d10b3eb6da0521dc1bb0a2a1d62f619a2460d73c +Author: Ray Strode +Date: Wed Jul 9 17:36:44 2008 -0400 + + Add debugging feature to restore text palette + +diff --git a/src/libplybootsplash/ply-window.c b/src/libplybootsplash/ply-window.c +index 90f9cc6..d718203 100644 +--- a/src/libplybootsplash/ply-window.c ++++ b/src/libplybootsplash/ply-window.c +@@ -45,6 +45,7 @@ + #include "ply-logger.h" + #include "ply-utils.h" + ++#define KEY_CTRL_P ('\100' ^'P') + #define KEY_CTRL_T ('\100' ^'T') + #define KEY_CTRL_U ('\100' ^'U') + #define KEY_CTRL_W ('\100' ^'W') +@@ -143,6 +144,40 @@ ply_window_new (int vt_number) + return window; + } + ++static bool ++ply_window_look_up_color_palette (ply_window_t *window) ++{ ++ if (ioctl (window->tty_fd, GIO_CMAP, window->color_palette) < 0) ++ return false; ++ ++ return true; ++} ++ ++static bool ++ply_window_change_color_palette (ply_window_t *window) ++{ ++ if (ioctl (window->tty_fd, PIO_CMAP, window->color_palette) < 0) ++ return false; ++ ++ return true; ++} ++ ++static void ++ply_window_save_color_palette (ply_window_t *window) ++{ ++ memcpy (window->original_color_palette, window->color_palette, ++ TEXT_PALETTE_SIZE); ++} ++ ++static void ++ply_window_restore_color_palette (ply_window_t *window) ++{ ++ memcpy (window->color_palette, window->original_color_palette, ++ TEXT_PALETTE_SIZE); ++ ++ ply_window_change_color_palette (window); ++} ++ + static void + process_backspace (ply_window_t *window) + { +@@ -188,6 +223,12 @@ process_keyboard_input (ply_window_t *window, + { + switch (key) + { ++ ++ case KEY_CTRL_P: ++ ply_trace ("restore text palette to original value!"); ++ ply_window_restore_color_palette (window); ++ return; ++ + case KEY_CTRL_T: + ply_trace ("toggle text mode!"); + window->should_force_text_mode = !window->should_force_text_mode; +@@ -362,40 +403,6 @@ ply_window_look_up_geometry (ply_window_t *window) + return true; + } + +-static bool +-ply_window_look_up_color_palette (ply_window_t *window) +-{ +- if (ioctl (window->tty_fd, GIO_CMAP, window->color_palette) < 0) +- return false; +- +- return true; +-} +- +-static bool +-ply_window_change_color_palette (ply_window_t *window) +-{ +- if (ioctl (window->tty_fd, PIO_CMAP, window->color_palette) < 0) +- return false; +- +- return true; +-} +- +-static void +-ply_window_save_color_palette (ply_window_t *window) +-{ +- memcpy (window->original_color_palette, window->color_palette, +- TEXT_PALETTE_SIZE); +-} +- +-static void +-ply_window_restore_color_palette (ply_window_t *window) +-{ +- memcpy (window->color_palette, window->original_color_palette, +- TEXT_PALETTE_SIZE); +- +- ply_window_change_color_palette (window); +-} +- + bool + ply_window_open (ply_window_t *window) + {