fix: add Wayland support (#26022)

This commit is contained in:
Valentin Hăloiu 2020-10-20 20:24:52 +02:00 committed by GitHub
parent d38c47e748
commit c4525b4ea6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 272 additions and 159 deletions

View file

@ -22,6 +22,10 @@
#include "ui/events/event_constants.h"
#include "ui/events/keycodes/keyboard_code_conversion_x.h"
#if defined(USE_OZONE) || defined(USE_X11)
#include "ui/base/ui_base_features.h"
#endif
namespace electron {
namespace gtkui {
@ -222,12 +226,14 @@ void BuildSubmenuFromModel(ui::MenuModel* model,
}
#if defined(USE_X11)
ui::Accelerator accelerator;
if (model->GetAcceleratorAt(i, &accelerator)) {
gtk_widget_add_accelerator(menu_item, "activate", nullptr,
GetGdkKeyCodeForAccelerator(accelerator),
GetGdkModifierForAccelerator(accelerator),
GTK_ACCEL_VISIBLE);
if (!features::IsUsingOzonePlatform()) {
ui::Accelerator accelerator;
if (model->GetAcceleratorAt(i, &accelerator)) {
gtk_widget_add_accelerator(menu_item, "activate", nullptr,
GetGdkKeyCodeForAccelerator(accelerator),
GetGdkModifierForAccelerator(accelerator),
GTK_ACCEL_VISIBLE);
}
}
#endif