mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium version 120.0.6099.0 (#1217362)
- chrome: Disable upgrade/downgrade behavior (see #3608) - chrome: Disable process singleton behavior (see #3609) - chrome: Disable config as default system browser (see #3613)
This commit is contained in:
@@ -5,17 +5,20 @@
|
||||
|
||||
#include "libcef/browser/native/window_x11.h"
|
||||
|
||||
// Include first due to redefinition of x11::EventMask.
|
||||
#include "ui/base/x/x11_util.h"
|
||||
|
||||
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
|
||||
#include "libcef/browser/browser_host_base.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
|
||||
#include "net/base/network_interfaces.h"
|
||||
#include "ui/base/x/x11_util.h"
|
||||
#include "ui/events/platform/platform_event_source.h"
|
||||
#include "ui/events/platform/x11/x11_event_source.h"
|
||||
#include "ui/events/x/x11_event_translation.h"
|
||||
#include "ui/gfx/x/connection.h"
|
||||
#include "ui/gfx/x/x11_window_event_manager.h"
|
||||
#include "ui/gfx/x/xinput.h"
|
||||
#include "ui/gfx/x/xproto_util.h"
|
||||
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h"
|
||||
|
||||
@@ -340,7 +343,7 @@ views::DesktopWindowTreeHostLinux* CefWindowX11::GetHost() {
|
||||
|
||||
bool CefWindowX11::CanDispatchEvent(const ui::PlatformEvent& event) {
|
||||
auto* dispatching_event = connection_->dispatching_event();
|
||||
return dispatching_event && dispatching_event->window() == xwindow_;
|
||||
return dispatching_event && IsTargetedBy(*dispatching_event);
|
||||
}
|
||||
|
||||
uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) {
|
||||
@@ -353,7 +356,7 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) {
|
||||
}
|
||||
|
||||
void CefWindowX11::OnEvent(const x11::Event& event) {
|
||||
if (event.window() != xwindow_) {
|
||||
if (!IsTargetedBy(event)) {
|
||||
return;
|
||||
}
|
||||
ProcessXEvent(event);
|
||||
@@ -477,3 +480,55 @@ void CefWindowX11::ProcessXEvent(const x11::Event& event) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CefWindowX11::IsTargetedBy(const x11::Event& xev) const {
|
||||
if (auto* button = xev.As<x11::ButtonEvent>()) {
|
||||
return button->event == xwindow_;
|
||||
}
|
||||
if (auto* key = xev.As<x11::KeyEvent>()) {
|
||||
return key->event == xwindow_;
|
||||
}
|
||||
if (auto* motion = xev.As<x11::MotionNotifyEvent>()) {
|
||||
return motion->event == xwindow_;
|
||||
}
|
||||
if (auto* xievent = xev.As<x11::Input::DeviceEvent>()) {
|
||||
return xievent->event == xwindow_;
|
||||
}
|
||||
if (auto* motion = xev.As<x11::MotionNotifyEvent>()) {
|
||||
return motion->event == xwindow_;
|
||||
}
|
||||
if (auto* crossing = xev.As<x11::CrossingEvent>()) {
|
||||
return crossing->event == xwindow_;
|
||||
}
|
||||
if (auto* expose = xev.As<x11::ExposeEvent>()) {
|
||||
return expose->window == xwindow_;
|
||||
}
|
||||
if (auto* focus = xev.As<x11::FocusEvent>()) {
|
||||
return focus->event == xwindow_;
|
||||
}
|
||||
if (auto* configure = xev.As<x11::ConfigureNotifyEvent>()) {
|
||||
return configure->window == xwindow_;
|
||||
}
|
||||
if (auto* crossing_input = xev.As<x11::Input::CrossingEvent>()) {
|
||||
return crossing_input->event == xwindow_;
|
||||
}
|
||||
if (auto* map = xev.As<x11::MapNotifyEvent>()) {
|
||||
return map->window == xwindow_;
|
||||
}
|
||||
if (auto* unmap = xev.As<x11::UnmapNotifyEvent>()) {
|
||||
return unmap->window == xwindow_;
|
||||
}
|
||||
if (auto* client = xev.As<x11::ClientMessageEvent>()) {
|
||||
return client->window == xwindow_;
|
||||
}
|
||||
if (auto* property = xev.As<x11::PropertyNotifyEvent>()) {
|
||||
return property->window == xwindow_;
|
||||
}
|
||||
if (auto* selection = xev.As<x11::SelectionNotifyEvent>()) {
|
||||
return selection->requestor == xwindow_;
|
||||
}
|
||||
if (auto* visibility = xev.As<x11::VisibilityNotifyEvent>()) {
|
||||
return visibility->window == xwindow_;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@@ -72,6 +72,8 @@ class CefWindowX11 : public ui::PlatformEventDispatcher,
|
||||
|
||||
void ProcessXEvent(const x11::Event& xev);
|
||||
|
||||
bool IsTargetedBy(const x11::Event& xev) const;
|
||||
|
||||
CefRefPtr<CefBrowserHostBase> browser_;
|
||||
|
||||
// The display and the native X window hosting the root window.
|
||||
|
Reference in New Issue
Block a user