Skip to content

windows: Fix top border overlap#229

Open
3unjee wants to merge 1 commit into
stdware:mainfrom
3unjee:bunjee/ci-windows
Open

windows: Fix top border overlap#229
3unjee wants to merge 1 commit into
stdware:mainfrom
3unjee:bunjee/ci-windows

Conversation

@3unjee
Copy link
Copy Markdown

@3unjee 3unjee commented May 19, 2026

This PR fixes a top border overlap on Windows 11 by shifting the content accordingly.

NOTE: The issue can be tested from the main branch by adding a border of 1 pixel at the top of the QML window example, it gets hidden.

@3unjee 3unjee force-pushed the bunjee/ci-windows branch from e393150 to 7766054 Compare May 19, 2026 15:41
@wangwenx190 wangwenx190 self-requested a review May 25, 2026 08:38
@wangwenx190 wangwenx190 self-assigned this May 25, 2026
Copy link
Copy Markdown
Collaborator

@wangwenx190 wangwenx190 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! Only some minor issues

});

bool max;
bool full;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems you can initialize max and full with isMaximized() and isFullScreen() here? you didn't change their value in the following code block anyway, or am I missing something?

// border ends up painted on top of the client area, covering the top of the content.
// So we shift the clientRect accordingly. This only applies when the window is not
// maximized or full-screen.
if (isWin11OrGreater() && max == false && full == false) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (isWin11OrGreater() && max == false && full == false) {
if (isWin11OrGreater() && !max && !full) {

}
else {
max = isMaximized(hWnd);
full = isFullScreen(hWnd);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you won't need these two lines if you initialize them early

clientRect->top = originalTop;

max = isMaximized(hWnd);
full = isFullScreen(hWnd);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you won't need these two lines if you initialize them early

@wangwenx190
Copy link
Copy Markdown
Collaborator

Sorry for the late review. I've been to hospital last week and have no access to PC/network ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants