[webkit-changes] [WebKit/WebKit] cad5d7: [GTK][WPE] Initialize display ID as early as possible

Carlos Garcia Campos noreply at github.com
Tue Feb 6 01:29:42 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cad5d7e5ed760db4515ca25da8080fe5e85b7e90
      https://github.com/WebKit/WebKit/commit/cad5d7e5ed760db4515ca25da8080fe5e85b7e90
  Author: Carlos Garcia Campos <cgarcia at igalia.com>
  Date:   2024-02-06 (Tue, 06 Feb 2024)

  Changed paths:
    M Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
    M Source/WebKit/UIProcess/API/wpe/WPEWebView.cpp
    M Source/WebKit/UIProcess/glib/DisplayVBlankMonitor.cpp
    M Source/WebKit/UIProcess/glib/DisplayVBlankMonitorDRM.cpp
    M Source/WebKit/UIProcess/glib/ScreenManager.h
    M Source/WebKit/UIProcess/gtk/ScreenManagerGtk.cpp
    M Source/WebKit/UIProcess/wpe/ScreenManagerWPE.cpp

  Log Message:
  -----------
  [GTK][WPE] Initialize display ID as early as possible
https://bugs.webkit.org/show_bug.cgi?id=268744

Reviewed by Adrian Perez de Castro.

In GTK we currently get the display ID when the toplevel window is
realized and gets a monitor assigned. This is happening right after the
web page is initialized, which means we always create the web page with
0 display ID and right after that a window screen change happens.
Because of this we end up creating two display link monitors. We can
avoid this by initializing the web view display id as soon as possible
using the primary display ID, that in most of the cases will be then one
used when the monitor is assigned to the toplevel.

This patch also ensures we never create a DRM vblank monitor when
display ID is 0, since that's never a valid monitor. We just
fallback to the timer vblank monitor in that case.

* Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseConstructed):
* Source/WebKit/UIProcess/API/wpe/WPEWebView.cpp:
(WKWPE::m_backend):
* Source/WebKit/UIProcess/glib/DisplayVBlankMonitor.cpp:
(WebKit::DisplayVBlankMonitor::create):
* Source/WebKit/UIProcess/glib/DisplayVBlankMonitorDRM.cpp:
(WebKit::DisplayVBlankMonitorDRM::create):
* Source/WebKit/UIProcess/glib/ScreenManager.h:
(WebKit::ScreenManager::primaryDisplayID const):
* Source/WebKit/UIProcess/gtk/ScreenManagerGtk.cpp:
(WebKit::ScreenManager::ScreenManager):
(WebKit::ScreenManager::updatePrimaryDisplayID):
(WebKit::ScreenManager::collectScreenProperties const):
* Source/WebKit/UIProcess/wpe/ScreenManagerWPE.cpp:
(WebKit::ScreenManager::ScreenManager):
(WebKit::ScreenManager::updatePrimaryDisplayID):
(WebKit::ScreenManager::collectScreenProperties const):

Canonical link: https://commits.webkit.org/274136@main




More information about the webkit-changes mailing list