1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Move global_menu_* methods to a separate NativeMenu class.

This commit is contained in:
bruvzg
2024-01-19 19:41:01 +02:00
parent a07dd0d6a5
commit c65a667924
36 changed files with 3500 additions and 1738 deletions

View File

@@ -192,6 +192,11 @@ void DisplayServerWayland::_show_window() {
bool DisplayServerWayland::has_feature(Feature p_feature) const {
switch (p_feature) {
#ifndef DISABLE_DEPRECATED
case FEATURE_GLOBAL_MENU: {
return (native_menu && native_menu->has_feature(NativeMenu::FEATURE_GLOBAL_MENU));
} break;
#endif
case FEATURE_MOUSE:
case FEATURE_CLIPBOARD:
case FEATURE_CURSOR_SHAPE:
@@ -1231,6 +1236,8 @@ DisplayServerWayland::DisplayServerWayland(const String &p_rendering_driver, Win
// Input.
Input::get_singleton()->set_event_dispatch_function(dispatch_input_events);
native_menu = memnew(NativeMenu);
#ifdef SPEECHD_ENABLED
// Init TTS
tts = memnew(TTS_Linux);
@@ -1355,6 +1362,12 @@ DisplayServerWayland::DisplayServerWayland(const String &p_rendering_driver, Win
DisplayServerWayland::~DisplayServerWayland() {
// TODO: Multiwindow support.
if (native_menu) {
memdelete(native_menu);
native_menu = nullptr;
}
if (main_window.visible) {
#ifdef VULKAN_ENABLED
if (rendering_device) {