Fix invalid surface size under Wayland when GHOST set the window size
When the window manager set the window size, there were no checks the size is a multiple of the buffer scale (a requirement for Wayland). This meant setting the window size could exit Blender without warning if an invalid window size was set.
This commit is contained in:
@@ -1683,8 +1683,11 @@ GHOST_TSuccess GHOST_WindowWayland::setClientSize(const uint32_t width, const ui
|
||||
std::lock_guard lock_frame_guard{window_->frame_pending_mutex};
|
||||
#endif
|
||||
|
||||
window_->frame_pending.size[0] = width;
|
||||
window_->frame_pending.size[1] = height;
|
||||
GWL_WindowFrame &frame_pending = window_->frame_pending;
|
||||
|
||||
frame_pending.size[0] = width;
|
||||
frame_pending.size[1] = height;
|
||||
gwl_round_int2_by(frame_pending.size, frame_pending.buffer_scale);
|
||||
|
||||
gwl_window_frame_pending_size_set(window_, nullptr, nullptr, nullptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user