Просмотр исходного кода

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.
Andreas Kling 5 лет назад
Родитель
Сommit
159289af03

+ 0 - 1
Libraries/LibGUI/GWindow.cpp

@@ -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,

+ 0 - 1
Servers/WindowServer/WSClientConnection.cpp

@@ -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())

+ 2 - 2
Servers/WindowServer/WSCompositor.cpp

@@ -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;
     };

+ 0 - 4
Servers/WindowServer/WSWindow.h

@@ -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;

+ 0 - 1
Servers/WindowServer/WindowServer.ipc

@@ -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,