mirror of
https://github.com/electron/electron.git
synced 2026-01-08 23:18:06 -05:00
refactor: remove introduce_ozoneplatform_electron_can_call_x11_property.patch (#47075)
* refactor: use x11_util::IsX11() in BuildSubmenuFromModel() * refactor: use x11_util::IsX11() in ElectronDesktopWindowTreeHostLinux::OnBoundsChanged() * refactor: use skia_can_fall_back_to_x11 in x11_util::IsX11() it is identical in practice to electron_can_call_x11 and does not require a Chromium patch * chore: remove introduce_ozoneplatform_electron_can_call_x11_property.patch * refactor: use ui::GetOzonePlatformId() to test for x11
This commit is contained in:
@@ -4,14 +4,13 @@
|
||||
|
||||
#include "shell/browser/linux/x11_util.h"
|
||||
|
||||
#include "ui/ozone/public/ozone_platform.h"
|
||||
#include "ui/ozone/platform_selection.h" // nogncheck
|
||||
|
||||
namespace x11_util {
|
||||
|
||||
bool IsX11() {
|
||||
return ui::OzonePlatform::GetInstance()
|
||||
->GetPlatformProperties()
|
||||
.electron_can_call_x11;
|
||||
static const bool is_x11 = ui::GetOzonePlatformId() == ui::kPlatformX11;
|
||||
return is_x11;
|
||||
}
|
||||
|
||||
} // namespace x11_util
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "base/feature_list.h"
|
||||
#include "base/i18n/rtl.h"
|
||||
#include "shell/browser/api/electron_api_web_contents.h"
|
||||
#include "shell/browser/linux/x11_util.h"
|
||||
#include "shell/browser/native_window_features.h"
|
||||
#include "shell/browser/native_window_views.h"
|
||||
#include "shell/browser/ui/views/client_frame_view_linux.h"
|
||||
@@ -82,9 +83,7 @@ void ElectronDesktopWindowTreeHostLinux::OnBoundsChanged(
|
||||
views::DesktopWindowTreeHostLinux::OnBoundsChanged(change);
|
||||
UpdateFrameHints();
|
||||
|
||||
if (ui::OzonePlatform::GetInstance()
|
||||
->GetPlatformProperties()
|
||||
.electron_can_call_x11) {
|
||||
if (x11_util::IsX11()) {
|
||||
// The OnWindowStateChanged should receive all updates but currently under
|
||||
// X11 it doesn't receive changes to the fullscreen status because chromium
|
||||
// is handling the fullscreen state changes synchronously, see
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "base/containers/flat_map.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/app/chrome_command_ids.h"
|
||||
#include "shell/browser/linux/x11_util.h"
|
||||
#include "shell/browser/ui/gtk_util.h"
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
#include "ui/base/accelerators/accelerator.h"
|
||||
@@ -219,9 +220,7 @@ void BuildSubmenuFromModel(ui::MenuModel* model,
|
||||
connect_to_activate = false;
|
||||
}
|
||||
|
||||
if (ui::OzonePlatform::GetInstance()
|
||||
->GetPlatformProperties()
|
||||
.electron_can_call_x11) {
|
||||
if (x11_util::IsX11()) {
|
||||
ui::Accelerator accelerator;
|
||||
if (model->GetAcceleratorAt(i, &accelerator)) {
|
||||
gtk_widget_add_accelerator(menu_item, "activate", nullptr,
|
||||
|
||||
Reference in New Issue
Block a user