ソースを参照

LibGUI: Verify m_window_id is not-zero in set_maximized

Window::set_maximized requires non-zero window id to be a valid call,
i.e. calling Window::show beforehand. A verify statement before the
server call can help developers by hinting correct usage.
Aziz Berkay Yesilyurt 4 年 前
コミット
6f594b36f5
1 ファイル変更1 行追加0 行削除
  1. 1 0
      Userland/Libraries/LibGUI/Window.cpp

+ 1 - 0
Userland/Libraries/LibGUI/Window.cpp

@@ -948,6 +948,7 @@ bool Window::is_maximized() const
 
 void Window::set_maximized(bool maximized)
 {
+    VERIFY(m_window_id != 0);
     WindowServerConnection::the().async_set_maximized(m_window_id, maximized);
 }