Backed out changeset: a02e097367ab
authorSerge Gautherie <sgautherie.bz@free.fr>
Wed, 06 May 2009 01:56:25 +0200
changeset 28020 78cf283336d3086acca4e12bac1b153e80e3911e
parent 28011 a02e097367ab0581ca4e862353c2dcb6be7716b1
child 28021 ae1a6296a59239c7fa505cfc815276b31bd71029
push id6843
push usersgautherie.bz@free.fr
push dateTue, 05 May 2009 23:59:14 +0000
treeherdermozilla-central@251caf79eba3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.2a1pre
Backed out changeset: a02e097367ab 1 of 3 changesets causing lots of test failures
widget/src/windows/nsScreenWin.cpp
widget/src/windows/nsWindow.cpp
--- a/widget/src/windows/nsScreenWin.cpp
+++ b/widget/src/windows/nsScreenWin.cpp
@@ -43,19 +43,16 @@
 #undef WINVER
 #define WINVER 0x0500
 #undef _WIN32_WINNT
 #define _WIN32_WINNT 0x0500
 
 #include "nsScreenWin.h"
 
 #ifdef WINCE
-#ifdef WINCE_WINDOWS_MOBILE
-#include "sipapi.h"
-#endif
 #define GetMonitorInfoW GetMonitorInfo
 #endif
 
 
 nsScreenWin :: nsScreenWin ( void* inScreen )
   : mScreen(inScreen)
 {
 #ifdef DEBUG
@@ -112,29 +109,16 @@ nsScreenWin :: GetRect(PRInt32 *outLeft,
 
 } // GetRect
 
 
 NS_IMETHODIMP
 nsScreenWin :: GetAvailRect(PRInt32 *outLeft, PRInt32 *outTop, PRInt32 *outWidth, PRInt32 *outHeight)
 {
   BOOL success = FALSE;
-#ifdef WINCE_WINDOWS_MOBILE
-  SIPINFO sipInfo;
-  memset(&sipInfo, 0, sizeof(SIPINFO));
-  sipInfo.cbSize = sizeof(SIPINFO);
-  if (SipGetInfo(&sipInfo) && !(sipInfo.fdwFlags & SIPF_OFF)) {
-    *outLeft = sipInfo.rcVisibleDesktop.left;
-    *outTop = sipInfo.rcVisibleDesktop.top;
-    *outWidth = sipInfo.rcVisibleDesktop.right - sipInfo.rcVisibleDesktop.left;
-    *outHeight = sipInfo.rcVisibleDesktop.bottom - sipInfo.rcVisibleDesktop.top;
-    return NS_OK;
-  }
-#endif
-
 #if _MSC_VER >= 1200
   if ( mScreen ) {
     MONITORINFO info;
     info.cbSize = sizeof(MONITORINFO);
     success = ::GetMonitorInfoW( (HMONITOR)mScreen, &info );
     if ( success ) {
       *outLeft = info.rcWork.left;
       *outTop = info.rcWork.top;
--- a/widget/src/windows/nsWindow.cpp
+++ b/widget/src/windows/nsWindow.cpp
@@ -203,47 +203,27 @@ static gfxIntSize gSharedSurfaceSize;
  * WinCE helpers
  */
 #ifdef WINCE
 
 #ifdef WINCE_HAVE_SOFTKB
 static PRBool gSoftKeyMenuBar = PR_FALSE;
 static PRBool gSoftKeyboardState = PR_FALSE;
 
-static void NotifySoftKbObservers() {
-  nsCOMPtr<nsIObserverService> observerService = do_GetService("@mozilla.org/observer-service;1");
-  if (observerService) {
-    SIPINFO sipInfo;
-    wchar_t rectBuf[256];
-    memset(&sipInfo, 0, sizeof(SIPINFO));
-    sipInfo.cbSize = sizeof(SIPINFO);
-    if (SipGetInfo(&sipInfo)) {
-      _snwprintf(rectBuf, 256, L"{\"left\": %d, \"top\": %d,"
-                 L" \"right\": %d, \"bottom\": %d}", 
-                 sipInfo.rcVisibleDesktop.left, 
-                 sipInfo.rcVisibleDesktop.top, 
-                 sipInfo.rcVisibleDesktop.right, 
-                 sipInfo.rcVisibleDesktop.bottom);
-      observerService->NotifyObservers(nsnull, "softkb-change", rectBuf);
-    }
-  }
-}
-
 static void ToggleSoftKB(PRBool show)
 {
   HWND hWndSIP = FindWindowW(L"SipWndClass", NULL );
   if (hWndSIP)
     ::ShowWindow(hWndSIP, show ? SW_SHOW: SW_HIDE);
 
   hWndSIP = FindWindowW(L"MS_SIPBUTTON", NULL ); 
   if (hWndSIP)
     ShowWindow(hWndSIP, show ? SW_SHOW: SW_HIDE);
 
-  SipShowIM(show ? SIPF_ON : SIPF_OFF);
-  NotifySoftKbObservers();
+  SHSipPreference(NULL, show ? SIP_UP: SIP_DOWN);
 }
 
 static void CreateSoftKeyMenuBar(HWND wnd)
 {
   if (!wnd)
     return;
   
   static HWND gSoftKeyMenuBar = nsnull;
@@ -4844,20 +4824,16 @@ PRBool nsWindow::ProcessMessage(UINT msg
         result = DispatchFocus(NS_ACTIVATE, PR_TRUE);
 #endif
       }
     }
     break;
 
     case WM_SETTINGCHANGE:
         getWheelInfo = PR_TRUE;
-#ifdef WINCE_WINDOWS_MOBILE
-        if (wParam == SPI_SETSIPINFO)
-          NotifySoftKbObservers();
-#endif
       break;
 
     case WM_PALETTECHANGED:
       if ((HWND)wParam == mWnd) {
         // We caused the WM_PALETTECHANGED message so avoid realizing
         // another foreground palette
         result = PR_TRUE;
         break;