Skip to content

Commit f2f7170

Browse files
committed
Disable Terminal transparency (runs awfully), WM doesn't invalidate
whole window when contents are dirty
1 parent c2adae1 commit f2f7170

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

Applications/Terminal/colours.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ rgba_colour_t coloursProfile1[] = {
259259
};
260260

261261
rgba_colour_t coloursProfile2[] = {
262-
{ 0x14, 0x14, 0x14, 200}, // Black
262+
RGBAColour::FromRGB(0x000000), // Black
263263
RGBAColour::FromRGB(0xea192f), // Dark Red
264264
RGBAColour::FromRGB(0xb0db43), // Dark Green
265265
RGBAColour::FromRGB(0xffc145), // Dark Yellow

Applications/Terminal/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ void* PTYThread() {
475475
}
476476

477477
int main(int argc, char** argv) {
478-
terminalWindow = new GUI::Window("Terminal", {720, 480}, GUI::WindowFlag_Resizable | GUI::WindowFlag_Transparent,
478+
terminalWindow = new GUI::Window("Terminal", {720, 480}, GUI::WindowFlag_Resizable,
479479
GUI::WindowType::Basic);
480480
terminalWindow->OnPaint = OnPaint;
481481

System/LemonWM/Compositor.cpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,29 @@ void Compositor::Render() {
8686
} else {
8787
for (WMWindow* win : WM::Instance().m_windows) {
8888
if (win->IsDirtyAndClear()) {
89-
Invalidate(win->GetContentRect());
89+
// If the window is transparent, we will need to invalidate
90+
// any rects underneath the window
91+
92+
// If the window is occluded, we will need to invalidate any rects
93+
// above the clip
94+
95+
// Otherwise, just set the window rect as invalid
96+
// and move on
97+
98+
if(win->IsTransparent()) for(auto& r : m_windowClipRects) {
99+
if(r.win == win) {
100+
Invalidate(r.rect);
101+
}
102+
} else for(auto& r : m_windowClipRects) {
103+
if(r.win == win) {
104+
if(r.occluded) {
105+
Invalidate(r.rect);
106+
} else {
107+
r.invalid = true;
108+
}
109+
}
110+
}
111+
90112
}
91113
}
92114
}

0 commit comments

Comments
 (0)