1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 21:37:34 +00:00

WindowServer: Use the system theme for the fallback window background

When filling in some missing part of a window (typically happens during
interactive window resize) we now use the ColorRole::Background from
the system theme palette instead of expecting the clients to send us
the same information when creating windows.
This commit is contained in:
Andreas Kling 2019-12-27 13:27:02 +01:00
parent fd06164fa0
commit 159289af03
5 changed files with 2 additions and 9 deletions

View file

@ -65,7 +65,6 @@ void GWindow::show()
m_fullscreen,
m_show_titlebar,
m_opacity_when_windowless,
m_background_color,
m_base_size,
m_size_increment,
(i32)m_window_type,

View file

@ -397,7 +397,6 @@ OwnPtr<WindowServer::CreateWindowResponse> WSClientConnection::handle(const Wind
{
int window_id = m_next_window_id++;
auto window = WSWindow::construct(*this, (WSWindowType)message.type(), window_id, message.modal(), message.resizable(), message.fullscreen());
window->set_background_color(message.background_color());
window->set_has_alpha_channel(message.has_alpha_channel());
window->set_title(message.title());
if (!message.fullscreen())

View file

@ -147,7 +147,7 @@ void WSCompositor::compose()
PainterStateSaver saver(*m_back_painter);
m_back_painter->add_clip_rect(dirty_rect);
if (!backing_store)
m_back_painter->fill_rect(dirty_rect, window.background_color());
m_back_painter->fill_rect(dirty_rect, wm.palette().window());
if (!window.is_fullscreen())
window.frame().paint(*m_back_painter);
if (!backing_store)
@ -197,7 +197,7 @@ void WSCompositor::compose()
m_back_painter->blit(dst, *backing_store, dirty_rect_in_backing_coordinates, window.opacity());
for (auto background_rect : window.rect().shatter(backing_rect))
m_back_painter->fill_rect(background_rect, window.background_color());
m_back_painter->fill_rect(background_rect, wm.palette().window());
}
return IterationDecision::Continue;
};

View file

@ -35,9 +35,6 @@ public:
unsigned wm_event_mask() const { return m_wm_event_mask; }
void set_wm_event_mask(unsigned mask) { m_wm_event_mask = mask; }
Color background_color() const { return m_background_color; }
void set_background_color(Color color) { m_background_color = color; }
bool is_minimized() const { return m_minimized; }
void set_minimized(bool);
@ -207,7 +204,6 @@ private:
NonnullRefPtr<GraphicsBitmap> m_icon;
RefPtr<WSCursor> m_override_cursor;
WSWindowFrame m_frame;
Color m_background_color { Color::WarmGray };
unsigned m_wm_event_mask { 0 };
DisjointRectSet m_pending_paint_rects;
Rect m_unmaximized_rect;

View file

@ -24,7 +24,6 @@ endpoint WindowServer = 2
bool fullscreen,
bool show_titlebar,
float opacity,
Color background_color,
Size base_size,
Size size_increment,
i32 type,