فهرست منبع

WindowServer+LibGUI: Remove unused Window::show_titlebar() flag

Nobody was using this flag, so let's stop maintaining it. It's easy to
add it back if we ever want the behavior.
Andreas Kling 5 سال پیش
والد
کامیت
bb7eb3e104

+ 0 - 1
Libraries/LibGUI/Window.cpp

@@ -100,7 +100,6 @@ void Window::show()
         m_minimizable,
         m_resizable,
         m_fullscreen,
-        m_show_titlebar,
         m_opacity_when_windowless,
         m_base_size,
         m_size_increment,

+ 0 - 4
Libraries/LibGUI/Window.h

@@ -78,9 +78,6 @@ public:
     String title() const;
     void set_title(const StringView&);
 
-    bool show_titlebar() const { return m_show_titlebar; };
-    void set_show_titlebar(bool show) { m_show_titlebar = show; };
-
     Color background_color() const { return m_background_color; }
     void set_background_color(Color color) { m_background_color = color; }
 
@@ -222,7 +219,6 @@ private:
     bool m_resizable { true };
     bool m_minimizable { true };
     bool m_fullscreen { false };
-    bool m_show_titlebar { true };
     bool m_layout_pending { false };
     bool m_visible_for_timer_purposes { true };
     bool m_visible { false };

+ 0 - 1
Servers/WindowServer/ClientConnection.cpp

@@ -485,7 +485,6 @@ OwnPtr<Messages::WindowServer::CreateWindowResponse> ClientConnection::handle(co
         window->set_rect(WindowManager::the().desktop_rect());
         window->recalculate_rect();
     }
-    window->set_show_titlebar(message.show_titlebar());
     window->set_opacity(message.opacity());
     window->set_size_increment(message.size_increment());
     window->set_base_size(message.base_size());

+ 0 - 4
Servers/WindowServer/Window.h

@@ -97,9 +97,6 @@ public:
     bool is_occluded() const { return m_occluded; }
     void set_occluded(bool);
 
-    bool show_titlebar() const { return m_show_titlebar; }
-    void set_show_titlebar(bool show) { m_show_titlebar = show; }
-
     bool is_movable() const
     {
         return m_type == WindowType::Normal;
@@ -262,7 +259,6 @@ private:
     WindowTileType m_tiled { WindowTileType::None };
     Gfx::Rect m_untiled_rect;
     bool m_occluded { false };
-    bool m_show_titlebar { true };
     RefPtr<Gfx::Bitmap> m_backing_store;
     RefPtr<Gfx::Bitmap> m_last_backing_store;
     int m_window_id { -1 };

+ 2 - 6
Servers/WindowServer/WindowFrame.cpp

@@ -220,9 +220,6 @@ void WindowFrame::paint_normal_frame(Gfx::Painter& painter)
 
     Gfx::StylePainter::paint_window_frame(painter, outer_rect, palette);
 
-    if (!window.show_titlebar())
-        return;
-
     auto titlebar_rect = title_bar_rect();
     auto titlebar_icon_rect = title_bar_icon_rect();
     auto titlebar_inner_rect = title_bar_text_rect();
@@ -278,15 +275,14 @@ void WindowFrame::paint(Gfx::Painter& painter)
 static Gfx::Rect frame_rect_for_window(Window& window, const Gfx::Rect& rect)
 {
     auto type = window.type();
-    auto offset = !window.show_titlebar() ? (window_titlebar_height + 1) : 0;
 
     switch (type) {
     case WindowType::Normal:
         return {
             rect.x() - 4,
-            rect.y() - window_titlebar_height - 6 + offset,
+            rect.y() - window_titlebar_height - 6,
             rect.width() + 8,
-            rect.height() + 10 + window_titlebar_height - offset
+            rect.height() + 10 + window_titlebar_height
         };
     case WindowType::Notification:
         return {

+ 0 - 1
Servers/WindowServer/WindowServer.ipc

@@ -36,7 +36,6 @@ endpoint WindowServer = 2
         bool minimizable,
         bool resizable,
         bool fullscreen,
-        bool show_titlebar,
         float opacity,
         Gfx::Size base_size,
         Gfx::Size size_increment,