From 70e9404912e0047f14861abc8d4e3982c23685fd Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Mon, 22 Sep 2025 14:58:02 +0800 Subject: Impl RequestFocus of xcb window. --- include/cru/platform/gui/Window.h | 2 ++ include/cru/platform/gui/xcb/Window.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'include/cru') diff --git a/include/cru/platform/gui/Window.h b/include/cru/platform/gui/Window.h index 742ef798..f877545e 100644 --- a/include/cru/platform/gui/Window.h +++ b/include/cru/platform/gui/Window.h @@ -72,6 +72,8 @@ struct INativeWindow : virtual IPlatformResource { // The lefttop of the rect is relative to screen lefttop. virtual void SetWindowRect(const Rect& rect) = 0; + // Return true if window gained the focus. But the return value should be + // ignored, since it does not guarantee anything. virtual bool RequestFocus() = 0; // Relative to client lefttop. diff --git a/include/cru/platform/gui/xcb/Window.h b/include/cru/platform/gui/xcb/Window.h index ba4798a5..346cbd55 100644 --- a/include/cru/platform/gui/xcb/Window.h +++ b/include/cru/platform/gui/xcb/Window.h @@ -42,7 +42,7 @@ class XcbWindow : public XcbResource, public virtual INativeWindow { Rect GetWindowRect() override; void SetWindowRect(const Rect& rect) override; - virtual bool RequestFocus() = 0; + bool RequestFocus() override; // Relative to client lefttop. virtual Point GetMousePosition() = 0; -- cgit v1.2.3