diff --git a/gui/wind/IPC.cpp b/gui/wind/IPC.cpp index b22af6fb..99f739cb 100644 --- a/gui/wind/IPC.cpp +++ b/gui/wind/IPC.cpp @@ -2,7 +2,7 @@ #include "Mouse.h" #include "Screen.h" #include -#include +#include #include #include #include @@ -35,9 +35,9 @@ static Result handle_create_window_message(Client& client) request.rect = request.rect.normalized(); - auto name = TRY_OR_IPC_ERROR(String::from_cstring("Window")); + auto name = TRY_OR_IPC_ERROR(RefString::from_cstring("Window")); - auto shm_path = TRY_OR_IPC_ERROR(String::format("/wind-shm-%d-%lu"_sv, client.conn->fd(), time(NULL))); + auto shm_path = TRY_OR_IPC_ERROR(RefString::format("/wind-shm-%d-%lu"_sv, client.conn->fd(), time(NULL))); auto* window = new (std::nothrow) Window(request.rect, move(name)); if (!window) @@ -88,7 +88,7 @@ static Result handle_set_window_title_message(Client& client) ui::SetWindowTitleRequest request; if (!TRY(client.conn->read_message(request))) return {}; - auto name = COPY_IPC_STRING(request.title); + auto name = TRY(RefString::from_string(COPY_IPC_STRING(request.title))); os::println("wind: SetWindowTitle(\"%s\") for window %d", name.chars(), request.window); diff --git a/gui/wind/Window.cpp b/gui/wind/Window.cpp index 12463057..ae5f6d57 100644 --- a/gui/wind/Window.cpp +++ b/gui/wind/Window.cpp @@ -22,7 +22,7 @@ void Window::focus() g_windows.append(this); } -Window::Window(ui::Rect r, String&& n) : surface(r), name(move(n)) +Window::Window(ui::Rect r, RefString&& n) : surface(r), name(move(n)) { auto font = ui::Font::default_font(); titlebar = ui::Rect { 0, 0, 0, 0 }; diff --git a/gui/wind/Window.h b/gui/wind/Window.h index 8b9aac92..67cd37ec 100644 --- a/gui/wind/Window.h +++ b/gui/wind/Window.h @@ -1,6 +1,6 @@ #pragma once #include -#include +#include #include #include #include @@ -13,14 +13,14 @@ struct Window : public LinkedListNode ui::Rect surface; ui::Rect titlebar; u32* pixels; - String name; - String shm_path; + RefString name; + RefString shm_path; bool dirty { false }; Client* client; int id; ui::WindowAttributes attributes { 0 }; - Window(ui::Rect, String&&); + Window(ui::Rect, RefString&&); ~Window(); void focus();