@@ -31,10 +31,12 @@ namespace QWK {
31
31
}
32
32
33
33
inline void setupNecessaryAttributes () {
34
- // https://github.com/microsoft/terminal/blob/71a6f26e6ece656084e87de1a528c4a8072eeabd/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp#L940
35
- // Must extend top frame to client area
36
- static QVariant defaultMargins = QVariant::fromValue (QMargins (0 , 1 , 0 , 0 ));
37
- ctx->setWindowAttribute (QStringLiteral (" extra-margins" ), defaultMargins);
34
+ if (!isWin11OrGreater ()) {
35
+ // https://github.com/microsoft/terminal/blob/71a6f26e6ece656084e87de1a528c4a8072eeabd/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp#L940
36
+ // Must extend top frame to client area
37
+ static QVariant defaultMargins = QVariant::fromValue (QMargins (0 , 1 , 0 , 0 ));
38
+ ctx->setWindowAttribute (QStringLiteral (" extra-margins" ), defaultMargins);
39
+ }
38
40
39
41
// Enable dark mode by default, otherwise the system borders are white
40
42
ctx->setWindowAttribute (QStringLiteral (" dark-mode" ), true );
@@ -45,7 +47,17 @@ namespace QWK {
45
47
(Qt::WindowMinimized | Qt::WindowMaximized | Qt::WindowFullScreen));
46
48
}
47
49
48
- inline void drawBorder () {
50
+ inline void drawBorderEmulated (QPainter *painter, const QRect &rect) {
51
+ QRegion region (rect);
52
+ void *args[] = {
53
+ painter,
54
+ const_cast <QRect *>(&rect),
55
+ ®ion,
56
+ };
57
+ ctx->virtual_hook (AbstractWindowContext::DrawWindows10BorderHook_Emulated, args);
58
+ }
59
+
60
+ inline void drawBorderNative () {
49
61
ctx->virtual_hook (AbstractWindowContext::DrawWindows10BorderHook_Native, nullptr );
50
62
}
51
63
@@ -54,6 +66,11 @@ namespace QWK {
54
66
}
55
67
56
68
inline void updateExtraMargins (bool windowActive) {
69
+ if (isWin11OrGreater ()) {
70
+ return ;
71
+ }
72
+
73
+ // ### FIXME: transparent seam
57
74
if (windowActive) {
58
75
// Restore margins when the window is active
59
76
static QVariant defaultMargins = QVariant::fromValue (QMargins (0 , 1 , 0 , 0 ));
0 commit comments