In my previous post I wrote that after IE9 installation on my laptop, the transparency of Lenovo Thinkpad PowerManager gadget was broken down. Some time passed from that moment, meanwhile Lenovo released an PowerManager update, but the gadget still doesn't work properly. Because of that, I decided to fix the problem myself.
After some experimenting, I found the reason of broken transparency and figured out a way to bypass the problem. It turned out that the bug is not in the gadget, but in Internet Explorer. Installation of IE9 introduces the following bug. After every value assignment to document.body.style.backgroundImage, the PNG background transparency is toggled on/off. Knowing exactly where the bug is I prepared a small, step-by-step tutorial on how to fix the gadget on our own:
- Create some temporary working folder (in my case it was D:\Temp)
- Copy PWRMGR.JS file into the temp folder. The file can be found in the gadget folder (in my case it's C:\Program Files\Windows Sidebar\Gadgets\PowerManager.Gadget\EN-US)
- From http://www.virtualconspiracy.com/content/scrdec/download download the scrdec18.exe tool and save it in the temp working folder
- Open Command Prompt in the temp folder. It can be done for example by holding Shift key, right clicking somewhere in the Windows Explorer window (but not on a file icon) and selecting the "Open command window here" option
- Decode the PWRMGR.JS, file by issuing the following command:
scrdec18 pwrmgr.js pwrmgr_dec.js
- Open the decoded file - pwrmgr_dec.js - in some text editor (i.e. Notepad++)
- Find the resizeView() function
- Inside that function, replace every occurance of
BK.style.backgroundImage = BK.style.backgroundImage
The replacing will be necessary in 3 places, totally. Then, we save the changes, of course.
- Delete file PWRMGR.JS from the temp directory. Next, rename pwrmgr_dec.js into PWRMGR.JS
- From our temp working directory, copy PWRMGR.JS file into the folder from whick we took its original version. (in my case it's C:\Program Files\Windows Sidebar\Gadgets\PowerManager.Gadget\EN-US). Allow overwriting the file.
- We're done! For the changes to be visible we now have to restart the sidebar.exe process. It can be done for example by logging out and logging in again. Instead of that I recomend to issue the following command in the Command Prompt:
tskill sidebar && "%programfiles%\Windows Sidebar\sidebar.exe"
Of course, after performing all the above steps we are free to delete the temporary working directory.