diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2023-11-03 16:35:33 +0100 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2023-11-03 16:35:33 +0100 |
commit | 9ce4eb86a9571cc025d058ca8433c19b9b393a87 (patch) | |
tree | 0e25a0cddc02916c6e6d97b8e7d1e7308a147355 /c++ | |
parent | 1bccfebc0347ce7c4c6d25390f7bc8e04234012a (diff) |
window: implementing more missing funcs
Diffstat (limited to 'c++')
-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() { |