Skip to content

Subtract client decorations height from flutter surface height #312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ const xdg_toplevel_listener ELinuxWindowWayland::kXdgToplevelListener = {
self->window_decorations_->Resize(next_width, next_height);
}
if (self->binding_handler_delegate_) {
self->binding_handler_delegate_->OnWindowSizeChanged(next_width,
next_height);
self->binding_handler_delegate_->OnWindowSizeChanged(
next_width,
next_height - self->WindowDecorationsPhysicalHeight());
}
},
.close =
Expand Down Expand Up @@ -1604,8 +1605,17 @@ void ELinuxWindowWayland::UpdateWindowScale() {

if (this->binding_handler_delegate_) {
this->binding_handler_delegate_->OnWindowSizeChanged(
this->view_properties_.width, this->view_properties_.height);
this->view_properties_.width,
this->view_properties_.height -
this->WindowDecorationsPhysicalHeight());
}
}

uint32_t ELinuxWindowWayland::WindowDecorationsPhysicalHeight() const {
if (!this->window_decorations_)
return 0;

return this->window_decorations_->Height() * current_scale_;
}

} // namespace flutter
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ class ELinuxWindowWayland : public ELinuxWindow, public WindowBindingHandler {
// Updates the surface scale of the window from the list of entered outputs.
void UpdateWindowScale();

// Get window decorations height in physical pixels.
uint32_t WindowDecorationsPhysicalHeight() const;

static const wl_registry_listener kWlRegistryListener;
static const xdg_wm_base_listener kXdgWmBaseListener;
static const xdg_surface_listener kXdgSurfaceListener;
Expand Down