[webkit-changes] [WebKit/WebKit] 9fd2ac: [GTK] Send screen properties from UI process to al...

Carlos Garcia Campos noreply at github.com
Thu Aug 17 22:12:24 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9fd2ac8b277e317e38359e922e9c7b7db7bebf9d
      https://github.com/WebKit/WebKit/commit/9fd2ac8b277e317e38359e922e9c7b7db7bebf9d
  Author: Carlos Garcia Campos <cgarcia at igalia.com>
  Date:   2023-08-17 (Thu, 17 Aug 2023)

  Changed paths:
    M Source/WebCore/platform/PlatformScreen.cpp
    M Source/WebCore/platform/PlatformScreen.h
    M Source/WebCore/platform/ScreenProperties.h
    M Source/WebCore/platform/gtk/PlatformScreenGtk.cpp
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/Shared/WebProcessCreationParameters.h
    M Source/WebKit/Shared/WebProcessCreationParameters.serialization.in
    M Source/WebKit/SourcesGTK.txt
    M Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp
    M Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp
    M Source/WebKit/UIProcess/gtk/GtkSettingsManager.cpp
    M Source/WebKit/UIProcess/gtk/GtkSettingsManager.h
    A Source/WebKit/UIProcess/gtk/ScreenManager.cpp
    A Source/WebKit/UIProcess/gtk/ScreenManager.h
    M Source/WebKit/WebProcess/WebProcess.h
    M Source/WebKit/WebProcess/WebProcess.messages.in
    M Source/WebKit/WebProcess/glib/WebProcessGLib.cpp

  Log Message:
  -----------
  [GTK] Send screen properties from UI process to all web processes
https://bugs.webkit.org/show_bug.cgi?id=260203

Reviewed by Michael Catanzaro.

Instead of web processes getting the properties from the default screen.
Add ScreenManager singleton to handle monitors in the default display,
used to collect properties of all screens. The web process will still
use the default or primary monitor always, because there's a mismatch
between the platform display ID assigned to monitors by ScreenManager
and the display ID set to the Page by the drawing area. This is because
of the way ThreadedCompositor works, which we plan to change soon, so it
will be automatically fixed and the right display ID will be used by
PlatformScreen functions receiving a Widget parameter.
This patch also removes screen DPI observer from PlatformScreen and it's
now implemented by GtkSettingsManager since what we are monitoring is
the GTK setting in the end.

* Source/WebCore/platform/PlatformScreen.cpp:
* Source/WebCore/platform/PlatformScreen.h: Remove setScreenDPIObserverHandler().
* Source/WebCore/platform/ScreenProperties.h:
* Source/WebCore/platform/gtk/PlatformScreenGtk.cpp:
(WebCore::widgetDisplayID): Get the PlatformDisplayID of the given Widget.
(WebCore::screenDepth): Use ScreenData.
(WebCore::screenDepthPerComponent): Ditto.
(WebCore::screenDPI): Check the GTK setting falling back to ScreenData.
(WebCore::screenRect): Use ScreenData.
(WebCore::screenAvailableRect): Ditto.
(WebCore::systemVisual): Deleted.
(WebCore::screenDPIObserverHandlersMap): Deleted.
(WebCore::gtkXftDPIChangedCallback): Deleted.
(WebCore::setScreenDPIObserverHandler): Deleted.
(WebCore::currentScreenMonitor): Deleted.
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/Shared/WebProcessCreationParameters.h:
* Source/WebKit/Shared/WebProcessCreationParameters.serialization.in:
* Source/WebKit/SourcesGTK.txt:
* Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewConstructed): Use GtkSettingsManager to monitor dpi changes.
(webkitWebViewDispose): Ditto.
* Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess): Collect screen properties and set the parameter.
* Source/WebKit/UIProcess/gtk/GtkSettingsManager.cpp:
(WebKit::GtkSettingsManager::settingsDidChange): Notify observers.
(WebKit::GtkSettingsManager::addObserver):
(WebKit::GtkSettingsManager::removeObserver):
* Source/WebKit/UIProcess/gtk/GtkSettingsManager.h:
* Source/WebKit/UIProcess/gtk/ScreenManager.cpp: Added.
(WebKit::ScreenManager::singleton):
(WebKit::generatePlatformDisplayID):
(WebKit::ScreenManager::ScreenManager):
(WebKit::ScreenManager::addMonitor):
(WebKit::ScreenManager::removeMonitor):
(WebKit::ScreenManager::propertiesDidChange const):
(WebKit::ScreenManager::collectScreenProperties const):
* Source/WebKit/UIProcess/gtk/ScreenManager.h: Copied from Source/WebKit/UIProcess/gtk/GtkSettingsManager.h.
* Source/WebKit/WebProcess/WebProcess.h:
* Source/WebKit/WebProcess/WebProcess.messages.in:
* Source/WebKit/WebProcess/glib/WebProcessGLib.cpp:
(WebKit::WebProcess::platformInitializeWebProcess): Initialize screen porperties.
(WebKit::WebProcess::setScreenProperties): Update screen properties.

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




More information about the webkit-changes mailing list