From f001c857722a8d7ebfc647be54f1a9cb3b2972c4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 14 Jun 2022 15:07:24 +1000 Subject: Cleanup: don't define wayland window methods as private This meant the system couldn't call window methods unless the window was cast to GHOST_Window. --- intern/ghost/intern/GHOST_SystemWayland.cpp | 2 +- intern/ghost/intern/GHOST_WindowWayland.h | 43 +++++++++++++++-------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp index 75e06abdc87..dceff4ef2b4 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.cpp +++ b/intern/ghost/intern/GHOST_SystemWayland.cpp @@ -2560,7 +2560,7 @@ GHOST_TSuccess GHOST_SystemWayland::setCursorGrab(const GHOST_TGrabCursorMode mo /* Fallback to window bounds. */ if (win->getCursorGrabBounds(bounds) == GHOST_kFailure) { - ((GHOST_Window *)win)->getClientBounds(bounds); + win->getClientBounds(bounds); } bounds.wrapPoint(x_new, y_new, 0, win->getCursorGrabAxis()); diff --git a/intern/ghost/intern/GHOST_WindowWayland.h b/intern/ghost/intern/GHOST_WindowWayland.h index de8eb429992..8fec725e122 100644 --- a/intern/ghost/intern/GHOST_WindowWayland.h +++ b/intern/ghost/intern/GHOST_WindowWayland.h @@ -40,27 +40,8 @@ class GHOST_WindowWayland : public GHOST_Window { uint16_t getDPIHint() override; - GHOST_TSuccess close(); - - GHOST_TSuccess activate(); - - GHOST_TSuccess deactivate(); - - GHOST_TSuccess notify_size(); - - wl_surface *surface() const; - - std::vector &outputs(); - - output_t *output_find_by_wl(struct wl_output *output); - - bool outputs_changed_update_scale(); + /* Ghost API */ - uint16_t dpi(); - - int scale(); - - protected: GHOST_TSuccess setWindowCursorGrab(GHOST_TGrabCursorMode mode) override; GHOST_TSuccess setWindowCursorShape(GHOST_TStandardCursor shape) override; @@ -111,6 +92,28 @@ class GHOST_WindowWayland : public GHOST_Window { void setOpaque() const; #endif + /* WAYLAND utility functions. */ + + GHOST_TSuccess close(); + + GHOST_TSuccess activate(); + + GHOST_TSuccess deactivate(); + + GHOST_TSuccess notify_size(); + + wl_surface *surface() const; + + std::vector &outputs(); + + output_t *output_find_by_wl(struct wl_output *output); + + bool outputs_changed_update_scale(); + + uint16_t dpi(); + + int scale(); + private: GHOST_SystemWayland *m_system; struct window_t *w; -- cgit v1.2.3