summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2022-08-25 14:03:49 -0400
committerAndreas Kling <kling@serenityos.org>2022-08-26 12:48:05 +0200
commitd815f659cc382656e11e9d28aeb4a2bbcf1e9f85 (patch)
tree830eebe6aee38c579eb2d4a04e5143154ff94b7b /Userland/Libraries/LibGUI
parent18b111b802751226559ac6e530fbede8104e47c1 (diff)
downloadserenity-d815f659cc382656e11e9d28aeb4a2bbcf1e9f85.zip
LibGUI+Taskbar+WindowServer: Prevent minimization when blocked
This was intentionally enabled with WindowModes as a new Taskbar convenience, but on second thought, it doesn't add up visually. Taskbar buttons show blockers' context menus when available, which is a bit confusing when the window isn't visible. The modeless window's disabled context menu options and inactive title bar also contradict the button. So, this patch reenables the restriction for now. Blocking modals you don't want to answer to immediately can still be tucked away on another workspace.
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r--Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.cpp4
-rw-r--r--Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.h2
-rw-r--r--Userland/Libraries/LibGUI/Event.h5
3 files changed, 7 insertions, 4 deletions
diff --git a/Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.cpp b/Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.cpp
index 1d1c6a7291..d6b0cd9148 100644
--- a/Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.cpp
+++ b/Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.cpp
@@ -19,11 +19,11 @@ ConnectionToWindowManagerServer& ConnectionToWindowManagerServer::the()
}
void ConnectionToWindowManagerServer::window_state_changed(i32 wm_id, i32 client_id, i32 window_id,
- u32 workspace_row, u32 workspace_column, bool is_active, bool is_minimized, bool is_frameless,
+ u32 workspace_row, u32 workspace_column, bool is_active, bool is_blocked, bool is_minimized, bool is_frameless,
i32 window_type, String const& title, Gfx::IntRect const& rect, Optional<i32> const& progress)
{
if (auto* window = Window::from_window_id(wm_id))
- Core::EventLoop::current().post_event(*window, make<WMWindowStateChangedEvent>(client_id, window_id, title, rect, workspace_row, workspace_column, is_active, static_cast<WindowType>(window_type), is_minimized, is_frameless, progress));
+ Core::EventLoop::current().post_event(*window, make<WMWindowStateChangedEvent>(client_id, window_id, title, rect, workspace_row, workspace_column, is_active, is_blocked, static_cast<WindowType>(window_type), is_minimized, is_frameless, progress));
}
void ConnectionToWindowManagerServer::applet_area_size_changed(i32 wm_id, Gfx::IntSize const& size)
diff --git a/Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.h b/Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.h
index 375efcad69..5721ecef00 100644
--- a/Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.h
+++ b/Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.h
@@ -28,7 +28,7 @@ private:
}
virtual void window_removed(i32, i32, i32) override;
- virtual void window_state_changed(i32, i32, i32, u32, u32, bool, bool, bool, i32, String const&, Gfx::IntRect const&, Optional<i32> const&) override;
+ virtual void window_state_changed(i32, i32, i32, u32, u32, bool, bool, bool, bool, i32, String const&, Gfx::IntRect const&, Optional<i32> const&) override;
virtual void window_icon_bitmap_changed(i32, i32, i32, Gfx::ShareableBitmap const&) override;
virtual void window_rect_changed(i32, i32, i32, Gfx::IntRect const&) override;
virtual void applet_area_size_changed(i32, Gfx::IntSize const&) override;
diff --git a/Userland/Libraries/LibGUI/Event.h b/Userland/Libraries/LibGUI/Event.h
index 6dea72cd17..a3366122ef 100644
--- a/Userland/Libraries/LibGUI/Event.h
+++ b/Userland/Libraries/LibGUI/Event.h
@@ -164,7 +164,7 @@ public:
class WMWindowStateChangedEvent : public WMEvent {
public:
- WMWindowStateChangedEvent(int client_id, int window_id, StringView title, Gfx::IntRect const& rect, unsigned workspace_row, unsigned workspace_column, bool is_active, WindowType window_type, bool is_minimized, bool is_frameless, Optional<int> progress)
+ WMWindowStateChangedEvent(int client_id, int window_id, StringView title, Gfx::IntRect const& rect, unsigned workspace_row, unsigned workspace_column, bool is_active, bool is_blocked, WindowType window_type, bool is_minimized, bool is_frameless, Optional<int> progress)
: WMEvent(Event::Type::WM_WindowStateChanged, client_id, window_id)
, m_title(title)
, m_rect(rect)
@@ -172,6 +172,7 @@ public:
, m_workspace_row(workspace_row)
, m_workspace_column(workspace_column)
, m_active(is_active)
+ , m_blocked(is_blocked)
, m_minimized(is_minimized)
, m_frameless(is_frameless)
, m_progress(progress)
@@ -181,6 +182,7 @@ public:
String const& title() const { return m_title; }
Gfx::IntRect const& rect() const { return m_rect; }
bool is_active() const { return m_active; }
+ bool is_blocked() const { return m_blocked; }
WindowType window_type() const { return m_window_type; }
bool is_minimized() const { return m_minimized; }
bool is_frameless() const { return m_frameless; }
@@ -195,6 +197,7 @@ private:
unsigned m_workspace_row;
unsigned m_workspace_column;
bool m_active;
+ bool m_blocked;
bool m_minimized;
bool m_frameless;
Optional<int> m_progress;