Skip to content
Open
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
6 changes: 3 additions & 3 deletions packages/window_manager/linux/window_manager_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static FlMethodResponse* set_aspect_ratio(WindowManagerPlugin* self,
static_cast<GdkWindowHints>(self->window_hints & ~GDK_HINT_ASPECT);
}

gdk_window_set_geometry_hints(get_gdk_window(self), &self->window_geometry,
gtk_window_set_geometry_hints(get_window(self), nullptr, &self->window_geometry,
self->window_hints);
g_autoptr(FlValue) result = fl_value_new_bool(true);
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
Expand Down Expand Up @@ -309,7 +309,7 @@ static FlMethodResponse* set_minimum_size(WindowManagerPlugin* self,
static_cast<GdkWindowHints>(self->window_hints & ~GDK_HINT_MIN_SIZE);
}

gdk_window_set_geometry_hints(get_gdk_window(self), &self->window_geometry,
gtk_window_set_geometry_hints(get_window(self), nullptr, &self->window_geometry,
self->window_hints);

g_autoptr(FlValue) result = fl_value_new_bool(true);
Expand Down Expand Up @@ -338,7 +338,7 @@ static FlMethodResponse* set_maximum_size(WindowManagerPlugin* self,
if (self->window_geometry.max_height < 0)
self->window_geometry.max_height = G_MAXINT;

gdk_window_set_geometry_hints(get_gdk_window(self), &self->window_geometry,
gtk_window_set_geometry_hints(get_window(self), nullptr, &self->window_geometry,
self->window_hints);

g_autoptr(FlValue) result = fl_value_new_bool(true);
Expand Down
8 changes: 4 additions & 4 deletions packages/window_manager/windows/window_manager_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ bool IsWindows11OrGreater() {
dwBuild = (DWORD)(HIWORD(dwVersion));
#pragma warning(pop)

return dwBuild < 22000;
return dwBuild >= 22000;
}

class WindowManagerPlugin : public flutter::Plugin {
Expand Down Expand Up @@ -168,9 +168,9 @@ std::optional<LRESULT> WindowManagerPlugin::HandleWindowProc(HWND hWnd,
adjustNCCALCSIZE(hWnd, reinterpret_cast<NCCALCSIZE_PARAMS*>(lParam));
} else {
NCCALCSIZE_PARAMS* sz = reinterpret_cast<NCCALCSIZE_PARAMS*>(lParam);
// on windows 10, if set to 0, there's a white line at the top
// of the app and I've yet to find a way to remove that.
sz->rgrc[0].top += IsWindows11OrGreater() ? 0 : 1;
// Do not add top offset on Windows 10, otherwise DWM interprets the non-zero
// non-client top margin as having a native caption and renders the system title bar.
sz->rgrc[0].top += 0;
// The following lines are required for resizing the window.
// https://github.com/leanflutter/window_manager/issues/483
sz->rgrc[0].right -= 8;
Expand Down