From 444e628d22db67742181ae14ae2ed0a9c2b6cd67 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Mon, 22 Sep 2025 14:58:02 +0800 Subject: Impl window rect of xcb window. --- include/cru/platform/gui/xcb/Window.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'include/cru/platform/gui/xcb/Window.h') diff --git a/include/cru/platform/gui/xcb/Window.h b/include/cru/platform/gui/xcb/Window.h index 927c3db9..ba4798a5 100644 --- a/include/cru/platform/gui/xcb/Window.h +++ b/include/cru/platform/gui/xcb/Window.h @@ -1,5 +1,6 @@ #pragma once +#include "../../GraphicsBase.h" #include "../Window.h" #include "Base.h" @@ -38,13 +39,8 @@ class XcbWindow : public XcbResource, public virtual INativeWindow { Rect GetClientRect() override; void SetClientRect(const Rect& rect) override; - // Get the rect of the window containing frame. - // The lefttop of the rect is relative to screen lefttop. - virtual Rect GetWindowRect() = 0; - - // Set the rect of the window containing frame. - // The lefttop of the rect is relative to screen lefttop. - virtual void SetWindowRect(const Rect& rect) = 0; + Rect GetWindowRect() override; + void SetWindowRect(const Rect& rect) override; virtual bool RequestFocus() = 0; @@ -98,6 +94,11 @@ class XcbWindow : public XcbResource, public virtual INativeWindow { std::uint32_t length, std::uint32_t* out_length = nullptr); + // Relative to screen lefttop. + Point GetXcbWindowPosition(xcb_window_t window); + + std::optional Get_NET_FRAME_EXTENTS(xcb_window_t window); + private: XcbUiApplication* application_; std::optional xcb_window_; -- cgit v1.2.3