You've already forked godot
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user