Title: [231964] trunk/Tools
Revision
231964
Author
[email protected]
Date
2018-05-18 10:36:26 -0700 (Fri, 18 May 2018)

Log Message

[Win][MiniBrowser] Create MainWindow even in transparent mode
https://bugs.webkit.org/show_bug.cgi?id=185597

Reviewed by Per Arne Vollan.

The current implementations doesn't create the MainWindow in
transparent mode. The screenshot is in Bug 58300.

There were three problems:
- Can't control the WebView. ie. going backward and forward.
- Can't quit the program.
- It makes implementation complicated.

* MiniBrowser/win/Common.cpp (resizeSubViews): Resize sub views
even in the transparent mode.
* MiniBrowser/win/WinMain.cpp:
(wWinMain): Create the main window even in the transparent mode.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (231963 => 231964)


--- trunk/Tools/ChangeLog	2018-05-18 17:34:19 UTC (rev 231963)
+++ trunk/Tools/ChangeLog	2018-05-18 17:36:26 UTC (rev 231964)
@@ -1,3 +1,23 @@
+2018-05-18  Fujii Hironori  <[email protected]>
+
+        [Win][MiniBrowser] Create MainWindow even in transparent mode
+        https://bugs.webkit.org/show_bug.cgi?id=185597
+
+        Reviewed by Per Arne Vollan.
+
+        The current implementations doesn't create the MainWindow in
+        transparent mode. The screenshot is in Bug 58300.
+
+        There were three problems:
+        - Can't control the WebView. ie. going backward and forward.
+        - Can't quit the program.
+        - It makes implementation complicated.
+
+        * MiniBrowser/win/Common.cpp (resizeSubViews): Resize sub views
+        even in the transparent mode.
+        * MiniBrowser/win/WinMain.cpp:
+        (wWinMain): Create the main window even in the transparent mode.
+
 2018-05-18  Antoine Quint  <[email protected]>
 
         [Web Animations] Turn Web Animations with CSS integration on for test runners

Modified: trunk/Tools/MiniBrowser/win/Common.cpp (231963 => 231964)


--- trunk/Tools/MiniBrowser/win/Common.cpp	2018-05-18 17:34:19 UTC (rev 231963)
+++ trunk/Tools/MiniBrowser/win/Common.cpp	2018-05-18 17:36:26 UTC (rev 231964)
@@ -109,11 +109,8 @@
 
 static void resizeSubViews()
 {
-    if (gMiniBrowser->usesLayeredWebView() || !gViewWindow)
-        return;
+    float scaleFactor = WebCore::deviceScaleFactorForWindow(hMainWnd);
 
-    float scaleFactor = WebCore::deviceScaleFactorForWindow(gViewWindow);
-
     RECT rcClient;
     GetClientRect(hMainWnd, &rcClient);
 
@@ -123,9 +120,12 @@
     MoveWindow(hBackButtonWnd, 0, 0, width, height, TRUE);
     MoveWindow(hForwardButtonWnd, width, 0, width, height, TRUE);
     MoveWindow(hURLBarWnd, width * 2, 0, rcClient.right, height, TRUE);
-    MoveWindow(gViewWindow, 0, height, rcClient.right, rcClient.bottom - height, TRUE);
 
     ::SendMessage(hURLBarWnd, static_cast<UINT>(WM_SETFONT), reinterpret_cast<WPARAM>(gMiniBrowser->urlBarFont()), TRUE);
+
+    if (gMiniBrowser->usesLayeredWebView() || !gViewWindow)
+        return;
+    MoveWindow(gViewWindow, 0, height, rcClient.right, rcClient.bottom - height, TRUE);
 }
 
 static void computeFullDesktopFrame()

Modified: trunk/Tools/MiniBrowser/win/WinMain.cpp (231963 => 231964)


--- trunk/Tools/MiniBrowser/win/WinMain.cpp	2018-05-18 17:34:19 UTC (rev 231963)
+++ trunk/Tools/MiniBrowser/win/WinMain.cpp	2018-05-18 17:36:26 UTC (rev 231964)
@@ -74,25 +74,18 @@
 
     float scaleFactor = WebCore::deviceScaleFactorForWindow(nullptr);
 
-    if (usesLayeredWebView) {
-        hURLBarWnd = CreateWindow(L"EDIT", L"Type URL Here",
-            WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL, 
-            scaleFactor * s_windowPosition.x, scaleFactor * (s_windowPosition.y + s_windowSize.cy), scaleFactor * s_windowSize.cx, scaleFactor * URLBAR_HEIGHT,
-            0, 0, hInst, 0);
-    } else {
-        hMainWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
-            CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0, 0, hInst, 0);
+    hMainWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
+        CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0, 0, hInst, 0);
 
-        if (!hMainWnd)
-            return FALSE;
+    if (!hMainWnd)
+        return FALSE;
 
-        hBackButtonWnd = CreateWindow(L"BUTTON", L"<", WS_CHILD | WS_VISIBLE  | BS_TEXT, 0, 0, 0, 0, hMainWnd, 0, hInst, 0);
-        hForwardButtonWnd = CreateWindow(L"BUTTON", L">", WS_CHILD | WS_VISIBLE | BS_TEXT, scaleFactor * CONTROLBUTTON_WIDTH, 0, 0, 0, hMainWnd, 0, hInst, 0);
-        hURLBarWnd = CreateWindow(L"EDIT", 0, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL, scaleFactor * CONTROLBUTTON_WIDTH * 2, 0, 0, 0, hMainWnd, 0, hInst, 0);
+    hBackButtonWnd = CreateWindow(L"BUTTON", L"<", WS_CHILD | WS_VISIBLE  | BS_TEXT, 0, 0, 0, 0, hMainWnd, 0, hInst, 0);
+    hForwardButtonWnd = CreateWindow(L"BUTTON", L">", WS_CHILD | WS_VISIBLE | BS_TEXT, scaleFactor * CONTROLBUTTON_WIDTH, 0, 0, 0, hMainWnd, 0, hInst, 0);
+    hURLBarWnd = CreateWindow(L"EDIT", 0, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL, scaleFactor * CONTROLBUTTON_WIDTH * 2, 0, 0, 0, hMainWnd, 0, hInst, 0);
 
-        ShowWindow(hMainWnd, nCmdShow);
-        UpdateWindow(hMainWnd);
-    }
+    ShowWindow(hMainWnd, nCmdShow);
+    UpdateWindow(hMainWnd);
 
     DefEditProc = reinterpret_cast<WNDPROC>(GetWindowLongPtr(hURLBarWnd, GWLP_WNDPROC));
     DefButtonProc = reinterpret_cast<WNDPROC>(GetWindowLongPtr(hBackButtonWnd, GWLP_WNDPROC));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to