mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +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:
parent
fd06164fa0
commit
159289af03
5 changed files with 2 additions and 9 deletions
|
@ -65,7 +65,6 @@ void GWindow::show()
|
||||||
m_fullscreen,
|
m_fullscreen,
|
||||||
m_show_titlebar,
|
m_show_titlebar,
|
||||||
m_opacity_when_windowless,
|
m_opacity_when_windowless,
|
||||||
m_background_color,
|
|
||||||
m_base_size,
|
m_base_size,
|
||||||
m_size_increment,
|
m_size_increment,
|
||||||
(i32)m_window_type,
|
(i32)m_window_type,
|
||||||
|
|
|
@ -397,7 +397,6 @@ OwnPtr<WindowServer::CreateWindowResponse> WSClientConnection::handle(const Wind
|
||||||
{
|
{
|
||||||
int window_id = m_next_window_id++;
|
int window_id = m_next_window_id++;
|
||||||
auto window = WSWindow::construct(*this, (WSWindowType)message.type(), window_id, message.modal(), message.resizable(), message.fullscreen());
|
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_has_alpha_channel(message.has_alpha_channel());
|
||||||
window->set_title(message.title());
|
window->set_title(message.title());
|
||||||
if (!message.fullscreen())
|
if (!message.fullscreen())
|
||||||
|
|
|
@ -147,7 +147,7 @@ void WSCompositor::compose()
|
||||||
PainterStateSaver saver(*m_back_painter);
|
PainterStateSaver saver(*m_back_painter);
|
||||||
m_back_painter->add_clip_rect(dirty_rect);
|
m_back_painter->add_clip_rect(dirty_rect);
|
||||||
if (!backing_store)
|
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())
|
if (!window.is_fullscreen())
|
||||||
window.frame().paint(*m_back_painter);
|
window.frame().paint(*m_back_painter);
|
||||||
if (!backing_store)
|
if (!backing_store)
|
||||||
|
@ -197,7 +197,7 @@ void WSCompositor::compose()
|
||||||
|
|
||||||
m_back_painter->blit(dst, *backing_store, dirty_rect_in_backing_coordinates, window.opacity());
|
m_back_painter->blit(dst, *backing_store, dirty_rect_in_backing_coordinates, window.opacity());
|
||||||
for (auto background_rect : window.rect().shatter(backing_rect))
|
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;
|
return IterationDecision::Continue;
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,9 +35,6 @@ public:
|
||||||
unsigned wm_event_mask() const { return m_wm_event_mask; }
|
unsigned wm_event_mask() const { return m_wm_event_mask; }
|
||||||
void set_wm_event_mask(unsigned mask) { m_wm_event_mask = 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; }
|
bool is_minimized() const { return m_minimized; }
|
||||||
void set_minimized(bool);
|
void set_minimized(bool);
|
||||||
|
|
||||||
|
@ -207,7 +204,6 @@ private:
|
||||||
NonnullRefPtr<GraphicsBitmap> m_icon;
|
NonnullRefPtr<GraphicsBitmap> m_icon;
|
||||||
RefPtr<WSCursor> m_override_cursor;
|
RefPtr<WSCursor> m_override_cursor;
|
||||||
WSWindowFrame m_frame;
|
WSWindowFrame m_frame;
|
||||||
Color m_background_color { Color::WarmGray };
|
|
||||||
unsigned m_wm_event_mask { 0 };
|
unsigned m_wm_event_mask { 0 };
|
||||||
DisjointRectSet m_pending_paint_rects;
|
DisjointRectSet m_pending_paint_rects;
|
||||||
Rect m_unmaximized_rect;
|
Rect m_unmaximized_rect;
|
||||||
|
|
|
@ -24,7 +24,6 @@ endpoint WindowServer = 2
|
||||||
bool fullscreen,
|
bool fullscreen,
|
||||||
bool show_titlebar,
|
bool show_titlebar,
|
||||||
float opacity,
|
float opacity,
|
||||||
Color background_color,
|
|
||||||
Size base_size,
|
Size base_size,
|
||||||
Size size_increment,
|
Size size_increment,
|
||||||
i32 type,
|
i32 type,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue