From ce07249c9b99959fdac7973257526e7dd700d5d9 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Mon, 22 Sep 2025 14:58:02 +0800 Subject: Impl SetToForeground RequestRepaint of xcb window. --- src/platform/gui/xcb/Window.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/platform/gui/xcb/Window.cpp b/src/platform/gui/xcb/Window.cpp index 5e63e08e..63ea68b1 100644 --- a/src/platform/gui/xcb/Window.cpp +++ b/src/platform/gui/xcb/Window.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -262,6 +263,19 @@ bool XcbWindow::ReleaseMouse() { void XcbWindow::SetCursor(std::shared_ptr cursor) { NotImplemented(); } +void XcbWindow::SetToForeground() { + SetVisibility(WindowVisibilityType::Show); + assert(xcb_window_.has_value()); + const static uint32_t values[] = {XCB_STACK_MODE_ABOVE}; + xcb_configure_window(application_->GetXcbConnection(), *xcb_window_, + XCB_CONFIG_WINDOW_STACK_MODE, values); +} + +void XcbWindow::RequestRepaint() { + // TODO: true throttle + paint_event_.Raise(nullptr); +} + std::unique_ptr XcbWindow::BeginPaint() { assert(cairo_surface_); -- cgit v1.2.3