diff options
Diffstat (limited to 'c++/window/xcb.cpp')
-rw-r--r-- | c++/window/xcb.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/c++/window/xcb.cpp b/c++/window/xcb.cpp index 5f3485c..1b804ba 100644 --- a/c++/window/xcb.cpp +++ b/c++/window/xcb.cpp @@ -237,12 +237,26 @@ void window<backend::linux_xcb>::hide(){ xcb_unmap_window(device_->xcb_connection_, xcb_window_); } +const video_mode& window<backend::linux_xcb>::get_video_mode() const { + return video_mode_; +} + const std::string_view window<backend::linux_xcb>::get_title() const { return window_title_; } -const video_mode& window<backend::linux_xcb>::get_video_mode() const { - return video_mode_; +void window<backend::linux_xcb>::resize(uint64_t w, uint64_t h){ + const uint32_t values[2] = { + static_cast<uint32_t>(w), + static_cast<uint32_t>(h) + }; + + xcb_configure_window(device_->xcb_connection_, xcb_window_, + XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, + values); + + video_mode_.width = w; + video_mode_.height = h; } conveyor<data<schema::WindowEvents>> window<backend::linux_xcb>::on_event() { |