mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
WindowServer+LibGUI: Add a way to bring a window to the front.
GWindow::move_to_front() can now be used to move a window to the top of the window stack. We use this in Terminal to bring the settings window to the front if it already exists when it's requested, in case it's hiding behind something.
This commit is contained in:
@@ -329,6 +329,18 @@ void WSClientConnection::handle_request(const WSAPIAddMenuSeparatorRequest& requ
|
||||
post_message(response);
|
||||
}
|
||||
|
||||
void WSClientConnection::handle_request(const WSAPIMoveWindowToFrontRequest& request)
|
||||
{
|
||||
int window_id = request.window_id();
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
post_error("WSAPIMoveWindowToFrontRequest: Bad window ID");
|
||||
return;
|
||||
}
|
||||
auto& window = *(*it).value;
|
||||
WSWindowManager::the().move_to_front_and_make_active(window);
|
||||
}
|
||||
|
||||
void WSClientConnection::handle_request(const WSAPISetWindowOpacityRequest& request)
|
||||
{
|
||||
int window_id = request.window_id();
|
||||
@@ -786,6 +798,8 @@ void WSClientConnection::on_request(const WSAPIClientRequest& request)
|
||||
return handle_request(static_cast<const WSAPIDismissMenuRequest&>(request));
|
||||
case WSEvent::APISetWindowHasAlphaChannelRequest:
|
||||
return handle_request(static_cast<const WSAPISetWindowHasAlphaChannelRequest&>(request));
|
||||
case WSEvent::APIMoveWindowToFrontRequest:
|
||||
return handle_request(static_cast<const WSAPIMoveWindowToFrontRequest&>(request));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user