aboutsummaryrefslogtreecommitdiff
path: root/src/platform/gui/xcb/Window.cpp
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-09-22 14:58:02 +0800
committerYuqian Yang <crupest@crupest.life>2025-09-22 21:56:27 +0800
commitce07249c9b99959fdac7973257526e7dd700d5d9 (patch)
treef12769dcc204bb8fe52ecf1a5bf8bdc7bdd0b1fb /src/platform/gui/xcb/Window.cpp
parent39b4261324bd61a9df7861c314459746bc0acd30 (diff)
downloadcru-ce07249c9b99959fdac7973257526e7dd700d5d9.tar.gz
cru-ce07249c9b99959fdac7973257526e7dd700d5d9.tar.bz2
cru-ce07249c9b99959fdac7973257526e7dd700d5d9.zip
Impl SetToForeground RequestRepaint of xcb window.
Diffstat (limited to 'src/platform/gui/xcb/Window.cpp')
-rw-r--r--src/platform/gui/xcb/Window.cpp14
1 files changed, 14 insertions, 0 deletions
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 <cairo-xcb.h>
#include <cairo.h>
#include <xcb/xcb.h>
+#include <xcb/xproto.h>
#include <cassert>
#include <cinttypes>
#include <cstdint>
@@ -262,6 +263,19 @@ bool XcbWindow::ReleaseMouse() {
void XcbWindow::SetCursor(std::shared_ptr<ICursor> 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<graphics::IPainter> XcbWindow::BeginPaint() {
assert(cairo_surface_);