Changeset 231964 in webkit


Ignore:
Timestamp:
May 18, 2018 10:36:26 AM (6 years ago)
Author:
Fujii Hironori
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.

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r231948 r231964  
     12018-05-18  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [Win][MiniBrowser] Create MainWindow even in transparent mode
     4        https://bugs.webkit.org/show_bug.cgi?id=185597
     5
     6        Reviewed by Per Arne Vollan.
     7
     8        The current implementations doesn't create the MainWindow in
     9        transparent mode. The screenshot is in Bug 58300.
     10
     11        There were three problems:
     12        - Can't control the WebView. ie. going backward and forward.
     13        - Can't quit the program.
     14        - It makes implementation complicated.
     15
     16        * MiniBrowser/win/Common.cpp (resizeSubViews): Resize sub views
     17        even in the transparent mode.
     18        * MiniBrowser/win/WinMain.cpp:
     19        (wWinMain): Create the main window even in the transparent mode.
     20
    1212018-05-18  Antoine Quint  <graouts@apple.com>
    222
  • trunk/Tools/MiniBrowser/win/Common.cpp

    r231707 r231964  
    110110static void resizeSubViews()
    111111{
    112     if (gMiniBrowser->usesLayeredWebView() || !gViewWindow)
    113         return;
    114 
    115     float scaleFactor = WebCore::deviceScaleFactorForWindow(gViewWindow);
     112    float scaleFactor = WebCore::deviceScaleFactorForWindow(hMainWnd);
    116113
    117114    RECT rcClient;
     
    124121    MoveWindow(hForwardButtonWnd, width, 0, width, height, TRUE);
    125122    MoveWindow(hURLBarWnd, width * 2, 0, rcClient.right, height, TRUE);
     123
     124    ::SendMessage(hURLBarWnd, static_cast<UINT>(WM_SETFONT), reinterpret_cast<WPARAM>(gMiniBrowser->urlBarFont()), TRUE);
     125
     126    if (gMiniBrowser->usesLayeredWebView() || !gViewWindow)
     127        return;
    126128    MoveWindow(gViewWindow, 0, height, rcClient.right, rcClient.bottom - height, TRUE);
    127 
    128     ::SendMessage(hURLBarWnd, static_cast<UINT>(WM_SETFONT), reinterpret_cast<WPARAM>(gMiniBrowser->urlBarFont()), TRUE);
    129129}
    130130
  • trunk/Tools/MiniBrowser/win/WinMain.cpp

    r231707 r231964  
    7575    float scaleFactor = WebCore::deviceScaleFactorForWindow(nullptr);
    7676
    77     if (usesLayeredWebView) {
    78         hURLBarWnd = CreateWindow(L"EDIT", L"Type URL Here",
    79             WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL,
    80             scaleFactor * s_windowPosition.x, scaleFactor * (s_windowPosition.y + s_windowSize.cy), scaleFactor * s_windowSize.cx, scaleFactor * URLBAR_HEIGHT,
    81             0, 0, hInst, 0);
    82     } else {
    83         hMainWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
    84             CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0, 0, hInst, 0);
     77    hMainWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
     78        CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0, 0, hInst, 0);
    8579
    86         if (!hMainWnd)
    87             return FALSE;
     80    if (!hMainWnd)
     81        return FALSE;
    8882
    89         hBackButtonWnd = CreateWindow(L"BUTTON", L"<", WS_CHILD | WS_VISIBLE  | BS_TEXT, 0, 0, 0, 0, hMainWnd, 0, hInst, 0);
    90         hForwardButtonWnd = CreateWindow(L"BUTTON", L">", WS_CHILD | WS_VISIBLE | BS_TEXT, scaleFactor * CONTROLBUTTON_WIDTH, 0, 0, 0, hMainWnd, 0, hInst, 0);
    91         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);
     83    hBackButtonWnd = CreateWindow(L"BUTTON", L"<", WS_CHILD | WS_VISIBLE  | BS_TEXT, 0, 0, 0, 0, hMainWnd, 0, hInst, 0);
     84    hForwardButtonWnd = CreateWindow(L"BUTTON", L">", WS_CHILD | WS_VISIBLE | BS_TEXT, scaleFactor * CONTROLBUTTON_WIDTH, 0, 0, 0, hMainWnd, 0, hInst, 0);
     85    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);
    9286
    93         ShowWindow(hMainWnd, nCmdShow);
    94         UpdateWindow(hMainWnd);
    95     }
     87    ShowWindow(hMainWnd, nCmdShow);
     88    UpdateWindow(hMainWnd);
    9689
    9790    DefEditProc = reinterpret_cast<WNDPROC>(GetWindowLongPtr(hURLBarWnd, GWLP_WNDPROC));
Note: See TracChangeset for help on using the changeset viewer.