diff options
author | Robin Burchell <robin+git@viroteck.net> | 2019-07-17 20:57:27 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-17 21:03:01 +0200 |
commit | 7a53096e8dd2a4d72903589ddc8d0855e41947b7 (patch) | |
tree | 11d9b6dd98c5bf18a8d394d243df4ce8e54b5518 /Libraries/LibGUI/GMenuBar.cpp | |
parent | 4adbddeb361069711cca305cfda01741c72342fe (diff) | |
download | serenity-7a53096e8dd2a4d72903589ddc8d0855e41947b7.zip |
LibGUI: Revert GWindowServerConnection to being a singleton
This was a mistake, of course. Nested event loops don't need (or want)
independent server connections.
We initialize the connection early in GEventLoop for e.g. users that
want to get the size of a GDesktop before the connection has been
established.
Bug noticed by Andreas, introduced by me ;-)
Diffstat (limited to 'Libraries/LibGUI/GMenuBar.cpp')
-rw-r--r-- | Libraries/LibGUI/GMenuBar.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Libraries/LibGUI/GMenuBar.cpp b/Libraries/LibGUI/GMenuBar.cpp index 0b8f688466..f57d9dc896 100644 --- a/Libraries/LibGUI/GMenuBar.cpp +++ b/Libraries/LibGUI/GMenuBar.cpp @@ -19,7 +19,7 @@ int GMenuBar::realize_menubar() { WSAPI_ClientMessage request; request.type = WSAPI_ClientMessage::Type::CreateMenubar; - WSAPI_ServerMessage response = GEventLoop::current().connection().sync_request(request, WSAPI_ServerMessage::Type::DidCreateMenubar); + WSAPI_ServerMessage response = GWindowServerConnection::the().sync_request(request, WSAPI_ServerMessage::Type::DidCreateMenubar); return response.menu.menubar_id; } @@ -30,7 +30,7 @@ void GMenuBar::unrealize_menubar() WSAPI_ClientMessage request; request.type = WSAPI_ClientMessage::Type::DestroyMenubar; request.menu.menubar_id = m_menubar_id; - GEventLoop::current().connection().sync_request(request, WSAPI_ServerMessage::Type::DidDestroyMenubar); + GWindowServerConnection::the().sync_request(request, WSAPI_ServerMessage::Type::DidDestroyMenubar); m_menubar_id = -1; } @@ -47,12 +47,12 @@ void GMenuBar::notify_added_to_application(Badge<GApplication>) request.type = WSAPI_ClientMessage::Type::AddMenuToMenubar; request.menu.menubar_id = m_menubar_id; request.menu.menu_id = menu_id; - GEventLoop::current().connection().sync_request(request, WSAPI_ServerMessage::Type::DidAddMenuToMenubar); + GWindowServerConnection::the().sync_request(request, WSAPI_ServerMessage::Type::DidAddMenuToMenubar); } WSAPI_ClientMessage request; request.type = WSAPI_ClientMessage::Type::SetApplicationMenubar; request.menu.menubar_id = m_menubar_id; - GEventLoop::current().connection().sync_request(request, WSAPI_ServerMessage::Type::DidSetApplicationMenubar); + GWindowServerConnection::the().sync_request(request, WSAPI_ServerMessage::Type::DidSetApplicationMenubar); } void GMenuBar::notify_removed_from_application(Badge<GApplication>) |