Skip to content

Commit

Permalink
Userland: Remove workarounds for LibIPC include order sensitivity
Browse files Browse the repository at this point in the history
  • Loading branch information
trflynn89 committed Nov 15, 2022
1 parent 05f4138 commit 4fd9e3a
Show file tree
Hide file tree
Showing 17 changed files with 11 additions and 46 deletions.
2 changes: 0 additions & 2 deletions Userland/Applications/Browser/Tab.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#include <LibGUI/Widget.h>
#include <LibGfx/ShareableBitmap.h>
#include <LibHTTP/Job.h>
#include <LibWeb/Cookie/Cookie.h>
#include <LibWeb/Cookie/ParsedCookie.h>
#include <LibWeb/Forward.h>

namespace WebView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "BackgroundSettingsWidget.h"
#include <AK/StringBuilder.h>
#include <Applications/DisplaySettings/BackgroundSettingsGML.h>
#include <LibConfig/Client.h>
#include <LibCore/ConfigFile.h>
#include <LibDesktop/Launcher.h>
#include <LibGUI/Application.h>
Expand All @@ -26,9 +27,6 @@
#include <LibGfx/Palette.h>
#include <LibGfx/SystemTheme.h>

// Including this after to avoid LibIPC errors
#include <LibConfig/Client.h>

namespace DisplaySettings {

BackgroundSettingsWidget::BackgroundSettingsWidget(bool& background_settings_changed)
Expand Down
4 changes: 1 addition & 3 deletions Userland/Applications/KeyboardSettings/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
*/

#include "KeyboardSettingsWidget.h"
#include <LibConfig/Client.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/System.h>
#include <LibGUI/Application.h>
#include <LibGUI/SettingsWindow.h>
#include <LibMain/Main.h>

// Including this after to avoid LibIPC errors
#include <LibConfig/Client.h>

ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix proc exec"));
Expand Down
4 changes: 1 addition & 3 deletions Userland/Applications/SoundPlayer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
* SPDX-License-Identifier: BSD-2-Clause
*/

// FIXME: LibIPC Decoder and Encoder are sensitive to include order here
#include <LibImageDecoderClient/Client.h>

#include "AlbumCoverVisualizationWidget.h"
#include "BarsVisualizationWidget.h"
#include "Player.h"
Expand All @@ -24,6 +21,7 @@
#include <LibGUI/Menubar.h>
#include <LibGUI/Window.h>
#include <LibGfx/CharacterBitmap.h>
#include <LibImageDecoderClient/Client.h>
#include <LibMain/Main.h>

ErrorOr<int> serenity_main(Main::Arguments arguments)
Expand Down
4 changes: 1 addition & 3 deletions Userland/Applications/TerminalSettings/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
*/

#include "TerminalSettingsWidget.h"
#include <LibConfig/Client.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/System.h>
#include <LibGUI/Application.h>
#include <LibGUI/ConnectionToWindowServer.h>
#include <LibGUI/SettingsWindow.h>
#include <LibMain/Main.h>

// Including this after to avoid LibIPC errors
#include <LibConfig/Client.h>

ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
Expand Down
5 changes: 1 addition & 4 deletions Userland/Applications/ThemeEditor/MainWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@
#include <Applications/ThemeEditor/MetricPropertyGML.h>
#include <Applications/ThemeEditor/PathPropertyGML.h>
#include <Applications/ThemeEditor/ThemeEditorGML.h>
// FIXME: LibIPC Decoder and Encoder are sensitive to include order here
// clang-format off
#include <LibGUI/ConnectionToWindowServer.h>
// clang-format on
#include <LibFileSystemAccessClient/Client.h>
#include <LibGUI/ActionGroup.h>
#include <LibGUI/Application.h>
#include <LibGUI/BoxLayout.h>
#include <LibGUI/Button.h>
#include <LibGUI/ConnectionToWindowServer.h>
#include <LibGUI/FilePicker.h>
#include <LibGUI/Frame.h>
#include <LibGUI/GroupBox.h>
Expand Down
5 changes: 1 addition & 4 deletions Userland/Libraries/LibFileSystemAccessClient/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@
* SPDX-License-Identifier: BSD-2-Clause
*/

// FIXME: LibIPC Decoder and Encoder are sensitive to include order here
// clang-format off
#include <LibGUI/ConnectionToWindowServer.h>
// clang-format on
#include <AK/LexicalPath.h>
#include <LibCore/File.h>
#include <LibFileSystemAccessClient/Client.h>
#include <LibGUI/ConnectionToWindowServer.h>
#include <LibGUI/MessageBox.h>
#include <LibGUI/Window.h>

Expand Down
4 changes: 1 addition & 3 deletions Userland/Libraries/LibGUI/Desktop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@

#include <AK/Badge.h>
#include <AK/TemporaryChange.h>
#include <LibConfig/Client.h>
#include <LibGUI/ConnectionToWindowServer.h>
#include <LibGUI/Desktop.h>
#include <string.h>

// Including this after to avoid LibIPC errors
#include <LibConfig/Client.h>

namespace GUI {

Desktop& Desktop::the()
Expand Down
2 changes: 0 additions & 2 deletions Userland/Libraries/LibProtocol/RequestClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#pragma once

#include <AK/HashMap.h>
// Need to include this before RequestClientEndpoint.h as that one includes LibIPC/(De En)coder.h, which would bomb if included before this.
#include <LibCore/Proxy.h>
#include <LibIPC/ConnectionToServer.h>
#include <RequestServer/RequestClientEndpoint.h>
#include <RequestServer/RequestServerEndpoint.h>
Expand Down
1 change: 0 additions & 1 deletion Userland/Libraries/LibWebView/WebContentClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include <AK/HashMap.h>
#include <LibIPC/ConnectionToServer.h>
#include <LibWeb/Cookie/ParsedCookie.h>
#include <WebContent/WebContentClientEndpoint.h>
#include <WebContent/WebContentServerEndpoint.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
* SPDX-License-Identifier: BSD-2-Clause
*/

// FIXME: LibIPC Decoder and Encoder are sensitive to include order here
// clang-format off
#include <LibGUI/ConnectionToWindowServer.h>
// clang-format on
#include <AK/Debug.h>
#include <FileSystemAccessServer/ConnectionFromClient.h>
#include <LibCore/File.h>
#include <LibCore/IODevice.h>
#include <LibGUI/Application.h>
#include <LibGUI/ConnectionToWindowServer.h>
#include <LibGUI/FilePicker.h>
#include <LibGUI/MessageBox.h>

Expand Down
4 changes: 1 addition & 3 deletions Userland/Services/NotificationServer/ConnectionFromClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
#pragma once

#include <LibIPC/ConnectionFromClient.h>
#include <WindowServer/ScreenLayout.h>

// Must be included after WindowServer/ScreenLayout.h
#include <NotificationServer/NotificationClientEndpoint.h>
#include <NotificationServer/NotificationServerEndpoint.h>
#include <WindowServer/ScreenLayout.h>

namespace NotificationServer {

Expand Down
2 changes: 0 additions & 2 deletions Userland/Services/RequestServer/ConnectionFromClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#pragma once

#include <AK/HashMap.h>
// Need to include this before RequestClientEndpoint.h as that one includes LibIPC/(De En)coder.h, which would bomb if included before this.
#include <LibCore/Proxy.h>
#include <LibIPC/ConnectionFromClient.h>
#include <RequestServer/Forward.h>
#include <RequestServer/RequestClientEndpoint.h>
Expand Down
1 change: 0 additions & 1 deletion Userland/Services/WebContent/ConnectionFromClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <LibJS/Parser.h>
#include <LibJS/Runtime/ConsoleObject.h>
#include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/Cookie/ParsedCookie.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/Dump.h>
#include <LibWeb/HTML/BrowsingContext.h>
Expand Down
1 change: 0 additions & 1 deletion Userland/Services/WebContent/ConnectionFromClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <LibJS/Forward.h>
#include <LibJS/Heap/Handle.h>
#include <LibWeb/CSS/PreferredColorScheme.h>
#include <LibWeb/Cookie/ParsedCookie.h>
#include <LibWeb/Forward.h>
#include <LibWeb/Loader/FileRequest.h>
#include <LibWeb/Platform/Timer.h>
Expand Down
3 changes: 0 additions & 3 deletions Userland/Services/WebContent/WebContentClient.ipc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
#include <LibWeb/Cookie/Cookie.h>
#include <LibWeb/Cookie/ParsedCookie.h>

// FIXME: This isn't used here, but the generated IPC fails to compile without this include.
#include <LibWeb/WebDriver/Response.h>

endpoint WebContentClient
{
did_start_loading(URL url) =|
Expand Down
6 changes: 2 additions & 4 deletions Userland/Services/WindowServer/ScreenLayout.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@

#include <AK/ScopeGuard.h>
#include <Kernel/API/Graphics.h>
#include <LibIPC/Decoder.h>
#include <LibIPC/Encoder.h>
#include <Services/WindowServer/ScreenLayout.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>

// Must be included after LibIPC/Forward.h
#include <LibIPC/Decoder.h>
#include <LibIPC/Encoder.h>

namespace WindowServer {

bool ScreenLayout::is_valid(String* error_msg) const
Expand Down

0 comments on commit 4fd9e3a

Please sign in to comment.