From bb7eb3e1040b619cbbb606e9423468d5d851a5b0 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 1 May 2020 23:19:00 +0200 Subject: 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. --- Libraries/LibGUI/Window.cpp | 1 - Libraries/LibGUI/Window.h | 4 ---- Servers/WindowServer/ClientConnection.cpp | 1 - Servers/WindowServer/Window.h | 4 ---- Servers/WindowServer/WindowFrame.cpp | 8 ++------ Servers/WindowServer/WindowServer.ipc | 1 - 6 files changed, 2 insertions(+), 17 deletions(-) diff --git a/Libraries/LibGUI/Window.cpp b/Libraries/LibGUI/Window.cpp index 60d80d938e..ca659bc073 100644 --- a/Libraries/LibGUI/Window.cpp +++ b/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, diff --git a/Libraries/LibGUI/Window.h b/Libraries/LibGUI/Window.h index 20f20eac71..c900e58425 100644 --- a/Libraries/LibGUI/Window.h +++ b/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 }; diff --git a/Servers/WindowServer/ClientConnection.cpp b/Servers/WindowServer/ClientConnection.cpp index 6b79c33bb5..0be46dad83 100644 --- a/Servers/WindowServer/ClientConnection.cpp +++ b/Servers/WindowServer/ClientConnection.cpp @@ -485,7 +485,6 @@ OwnPtr 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()); diff --git a/Servers/WindowServer/Window.h b/Servers/WindowServer/Window.h index b22c15410f..b6eb46eb93 100644 --- a/Servers/WindowServer/Window.h +++ b/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 m_backing_store; RefPtr m_last_backing_store; int m_window_id { -1 }; diff --git a/Servers/WindowServer/WindowFrame.cpp b/Servers/WindowServer/WindowFrame.cpp index 5face69eff..1106622e24 100644 --- a/Servers/WindowServer/WindowFrame.cpp +++ b/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 { diff --git a/Servers/WindowServer/WindowServer.ipc b/Servers/WindowServer/WindowServer.ipc index 34d9e8db6c..4ae930326d 100644 --- a/Servers/WindowServer/WindowServer.ipc +++ b/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, -- cgit v1.2.3