|
@@ -460,7 +460,7 @@ Window* ClientConnection::window_from_id(i32 window_id)
|
|
return it->value.ptr();
|
|
return it->value.ptr();
|
|
}
|
|
}
|
|
|
|
|
|
-Messages::WindowServer::CreateWindowResponse ClientConnection::create_window(Gfx::IntRect const& rect,
|
|
|
|
|
|
+void ClientConnection::create_window(i32 window_id, Gfx::IntRect const& rect,
|
|
bool auto_position, bool has_alpha_channel, bool modal, bool minimizable, bool resizable,
|
|
bool auto_position, bool has_alpha_channel, bool modal, bool minimizable, bool resizable,
|
|
bool fullscreen, bool frameless, bool accessory, float opacity, float alpha_hit_threshold,
|
|
bool fullscreen, bool frameless, bool accessory, float opacity, float alpha_hit_threshold,
|
|
Gfx::IntSize const& base_size, Gfx::IntSize const& size_increment, Gfx::IntSize const& minimum_size,
|
|
Gfx::IntSize const& base_size, Gfx::IntSize const& size_increment, Gfx::IntSize const& minimum_size,
|
|
@@ -471,16 +471,20 @@ Messages::WindowServer::CreateWindowResponse ClientConnection::create_window(Gfx
|
|
parent_window = window_from_id(parent_window_id);
|
|
parent_window = window_from_id(parent_window_id);
|
|
if (!parent_window) {
|
|
if (!parent_window) {
|
|
did_misbehave("CreateWindow with bad parent_window_id");
|
|
did_misbehave("CreateWindow with bad parent_window_id");
|
|
- return nullptr;
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if (type < 0 || type >= (i32)WindowType::_Count) {
|
|
if (type < 0 || type >= (i32)WindowType::_Count) {
|
|
did_misbehave("CreateWindow with a bad type");
|
|
did_misbehave("CreateWindow with a bad type");
|
|
- return nullptr;
|
|
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (m_windows.contains(window_id)) {
|
|
|
|
+ did_misbehave("CreateWindow with already-used window ID");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
|
|
|
|
- int window_id = m_next_window_id++;
|
|
|
|
auto window = Window::construct(*this, (WindowType)type, window_id, modal, minimizable, frameless, resizable, fullscreen, accessory, parent_window);
|
|
auto window = Window::construct(*this, (WindowType)type, window_id, modal, minimizable, frameless, resizable, fullscreen, accessory, parent_window);
|
|
|
|
|
|
window->set_has_alpha_channel(has_alpha_channel);
|
|
window->set_has_alpha_channel(has_alpha_channel);
|
|
@@ -513,7 +517,6 @@ Messages::WindowServer::CreateWindowResponse ClientConnection::create_window(Gfx
|
|
if (window->type() == WindowType::Applet)
|
|
if (window->type() == WindowType::Applet)
|
|
AppletManager::the().add_applet(*window);
|
|
AppletManager::the().add_applet(*window);
|
|
m_windows.set(window_id, move(window));
|
|
m_windows.set(window_id, move(window));
|
|
- return window_id;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
void ClientConnection::destroy_window(Window& window, Vector<i32>& destroyed_window_ids)
|
|
void ClientConnection::destroy_window(Window& window, Vector<i32>& destroyed_window_ids)
|