File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
platform/linuxbsd/wayland Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -557,6 +557,37 @@ Vector<DisplayServer::WindowID> DisplayServerWayland::get_window_list() const {
557557 return ret;
558558}
559559
560+ int64_t DisplayServerWayland::window_get_native_handle (HandleType p_handle_type, WindowID p_window) const {
561+ MutexLock mutex_lock (wayland_thread.mutex );
562+
563+ switch (p_handle_type) {
564+ case DISPLAY_HANDLE: {
565+ return (int64_t )wayland_thread.get_wl_display ();
566+ } break ;
567+
568+ case WINDOW_HANDLE: {
569+ return (int64_t )wayland_thread.window_get_wl_surface (p_window);
570+ } break ;
571+
572+ case WINDOW_VIEW: {
573+ return 0 ; // Not supported.
574+ } break ;
575+
576+ #ifdef GLES3_ENABLED
577+ case OPENGL_CONTEXT: {
578+ if (egl_manager) {
579+ return (int64_t )egl_manager->get_context (p_window);
580+ }
581+ return 0 ;
582+ } break ;
583+ #endif // GLES3_ENABLED
584+
585+ default : {
586+ return 0 ;
587+ } break ;
588+ }
589+ }
590+
560591DisplayServer::WindowID DisplayServerWayland::get_window_at_screen_position (const Point2i &p_position) const {
561592 // Standard Wayland APIs don't support this.
562593 return MAIN_WINDOW_ID;
Original file line number Diff line number Diff line change @@ -200,6 +200,8 @@ class DisplayServerWayland : public DisplayServer {
200200
201201 virtual Vector<DisplayServer::WindowID> get_window_list () const override ;
202202
203+ virtual int64_t window_get_native_handle (HandleType p_handle_type, WindowID p_window = MAIN_WINDOW_ID) const override ;
204+
203205 virtual WindowID get_window_at_screen_position (const Point2i &p_position) const override ;
204206
205207 virtual void window_attach_instance_id (ObjectID p_instance, WindowID p_window_id = MAIN_WINDOW_ID) override ;
You can’t perform that action at this time.
0 commit comments