Переглянути джерело

WindowServer: Rename WSMessage* => WSEvent*.

Since I'm on a roll here, I'll just rename WSMessageFoo to WSEventFoo now
that these inherit from CEventFoo anyway.
Andreas Kling 6 роки тому
батько
коміт
94a5e08faf

+ 1 - 1
Servers/WindowServer/Makefile

@@ -10,7 +10,7 @@ SHAREDGRAPHICS_OBJS = \
     ../../SharedGraphics/PNGLoader.o
 
 WINDOWSERVER_OBJS = \
-    WSMessageLoop.o \
+    WSEventLoop.o \
     WSWindow.o \
     WSWindowManager.o \
     WSScreen.o \

+ 5 - 5
Servers/WindowServer/WSButton.cpp

@@ -1,5 +1,5 @@
 #include <WindowServer/WSButton.h>
-#include <WindowServer/WSMessage.h>
+#include <WindowServer/WSEvent.h>
 #include <WindowServer/WSWindowManager.h>
 #include <SharedGraphics/Painter.h>
 #include <SharedGraphics/StylePainter.h>
@@ -32,14 +32,14 @@ void WSButton::on_mouse_event(const WSMouseEvent& event)
 {
     auto& wm = WSWindowManager::the();
 
-    if (event.type() == WSMessage::MouseDown && event.button() == MouseButton::Left) {
+    if (event.type() == WSEvent::MouseDown && event.button() == MouseButton::Left) {
         m_pressed = true;
         wm.set_cursor_tracking_button(this);
         wm.invalidate(screen_rect());
         return;
     }
 
-    if (event.type() == WSMessage::MouseUp && event.button() == MouseButton::Left) {
+    if (event.type() == WSEvent::MouseUp && event.button() == MouseButton::Left) {
         WSWindowManager::the().set_cursor_tracking_button(nullptr);
         bool old_pressed = m_pressed;
         m_pressed = false;
@@ -52,7 +52,7 @@ void WSButton::on_mouse_event(const WSMouseEvent& event)
         return;
     }
 
-    if (event.type() == WSMessage::MouseMove) {
+    if (event.type() == WSEvent::MouseMove) {
         bool old_hovered = m_hovered;
         m_hovered = rect().contains(event.position());
         wm.set_hovered_button(m_hovered ? this : nullptr);
@@ -60,7 +60,7 @@ void WSButton::on_mouse_event(const WSMouseEvent& event)
             wm.invalidate(screen_rect());
     }
 
-    if (event.type() == WSMessage::MouseMove && event.buttons() & (unsigned)MouseButton::Left) {
+    if (event.type() == WSEvent::MouseMove && event.buttons() & (unsigned)MouseButton::Left) {
         bool old_pressed = m_pressed;
         m_pressed = m_hovered;
         if (old_pressed != m_pressed)

+ 1 - 1
Servers/WindowServer/WSCPUMonitor.cpp

@@ -1,5 +1,5 @@
 #include <WindowServer/WSCPUMonitor.h>
-#include <WindowServer/WSMessageLoop.h>
+#include <WindowServer/WSEventLoop.h>
 #include <WindowServer/WSWindowManager.h>
 #include <unistd.h>
 #include <stdio.h>

+ 33 - 33
Servers/WindowServer/WSClientConnection.cpp

@@ -1,5 +1,5 @@
 #include <WindowServer/WSClientConnection.h>
-#include <WindowServer/WSMessageLoop.h>
+#include <WindowServer/WSEventLoop.h>
 #include <WindowServer/WSMenuBar.h>
 #include <WindowServer/WSMenu.h>
 #include <WindowServer/WSMenuItem.h>
@@ -95,12 +95,12 @@ void WSClientConnection::notify_about_new_screen_rect(const Rect& rect)
 
 void WSClientConnection::event(CEvent& message)
 {
-    if (static_cast<WSMessage&>(message).is_client_request()) {
+    if (static_cast<WSEvent&>(message).is_client_request()) {
         on_request(static_cast<const WSAPIClientRequest&>(message));
         return;
     }
 
-    if (message.type() == WSMessage::WM_ClientDisconnected) {
+    if (message.type() == WSEvent::WM_ClientDisconnected) {
         int client_id = static_cast<const WSClientDisconnectedNotification&>(message).client_id();
         dbgprintf("WSClientConnection: Client disconnected: %d\n", client_id);
         delete this;
@@ -609,65 +609,65 @@ void WSClientConnection::handle_request(const WSWMAPISetActiveWindowRequest& req
 void WSClientConnection::on_request(const WSAPIClientRequest& request)
 {
     switch (request.type()) {
-    case WSMessage::APICreateMenubarRequest:
+    case WSEvent::APICreateMenubarRequest:
         return handle_request(static_cast<const WSAPICreateMenubarRequest&>(request));
-    case WSMessage::APIDestroyMenubarRequest:
+    case WSEvent::APIDestroyMenubarRequest:
         return handle_request(static_cast<const WSAPIDestroyMenubarRequest&>(request));
-    case WSMessage::APICreateMenuRequest:
+    case WSEvent::APICreateMenuRequest:
         return handle_request(static_cast<const WSAPICreateMenuRequest&>(request));
-    case WSMessage::APIDestroyMenuRequest:
+    case WSEvent::APIDestroyMenuRequest:
         return handle_request(static_cast<const WSAPIDestroyMenuRequest&>(request));
-    case WSMessage::APISetApplicationMenubarRequest:
+    case WSEvent::APISetApplicationMenubarRequest:
         return handle_request(static_cast<const WSAPISetApplicationMenubarRequest&>(request));
-    case WSMessage::APIAddMenuToMenubarRequest:
+    case WSEvent::APIAddMenuToMenubarRequest:
         return handle_request(static_cast<const WSAPIAddMenuToMenubarRequest&>(request));
-    case WSMessage::APIAddMenuItemRequest:
+    case WSEvent::APIAddMenuItemRequest:
         return handle_request(static_cast<const WSAPIAddMenuItemRequest&>(request));
-    case WSMessage::APIAddMenuSeparatorRequest:
+    case WSEvent::APIAddMenuSeparatorRequest:
         return handle_request(static_cast<const WSAPIAddMenuSeparatorRequest&>(request));
-    case WSMessage::APIUpdateMenuItemRequest:
+    case WSEvent::APIUpdateMenuItemRequest:
         return handle_request(static_cast<const WSAPIUpdateMenuItemRequest&>(request));
-    case WSMessage::APISetWindowTitleRequest:
+    case WSEvent::APISetWindowTitleRequest:
         return handle_request(static_cast<const WSAPISetWindowTitleRequest&>(request));
-    case WSMessage::APIGetWindowTitleRequest:
+    case WSEvent::APIGetWindowTitleRequest:
         return handle_request(static_cast<const WSAPIGetWindowTitleRequest&>(request));
-    case WSMessage::APISetWindowRectRequest:
+    case WSEvent::APISetWindowRectRequest:
         return handle_request(static_cast<const WSAPISetWindowRectRequest&>(request));
-    case WSMessage::APIGetWindowRectRequest:
+    case WSEvent::APIGetWindowRectRequest:
         return handle_request(static_cast<const WSAPIGetWindowRectRequest&>(request));
-    case WSMessage::APISetWindowIconRequest:
+    case WSEvent::APISetWindowIconRequest:
         return handle_request(static_cast<const WSAPISetWindowIconRequest&>(request));
-    case WSMessage::APISetClipboardContentsRequest:
+    case WSEvent::APISetClipboardContentsRequest:
         return handle_request(static_cast<const WSAPISetClipboardContentsRequest&>(request));
-    case WSMessage::APIGetClipboardContentsRequest:
+    case WSEvent::APIGetClipboardContentsRequest:
         return handle_request(static_cast<const WSAPIGetClipboardContentsRequest&>(request));
-    case WSMessage::APICreateWindowRequest:
+    case WSEvent::APICreateWindowRequest:
         return handle_request(static_cast<const WSAPICreateWindowRequest&>(request));
-    case WSMessage::APIDestroyWindowRequest:
+    case WSEvent::APIDestroyWindowRequest:
         return handle_request(static_cast<const WSAPIDestroyWindowRequest&>(request));
-    case WSMessage::APIInvalidateRectRequest:
+    case WSEvent::APIInvalidateRectRequest:
         return handle_request(static_cast<const WSAPIInvalidateRectRequest&>(request));
-    case WSMessage::APIDidFinishPaintingNotification:
+    case WSEvent::APIDidFinishPaintingNotification:
         return handle_request(static_cast<const WSAPIDidFinishPaintingNotification&>(request));
-    case WSMessage::APIGetWindowBackingStoreRequest:
+    case WSEvent::APIGetWindowBackingStoreRequest:
         return handle_request(static_cast<const WSAPIGetWindowBackingStoreRequest&>(request));
-    case WSMessage::APISetGlobalCursorTrackingRequest:
+    case WSEvent::APISetGlobalCursorTrackingRequest:
         return handle_request(static_cast<const WSAPISetGlobalCursorTrackingRequest&>(request));
-    case WSMessage::APISetWindowOpacityRequest:
+    case WSEvent::APISetWindowOpacityRequest:
         return handle_request(static_cast<const WSAPISetWindowOpacityRequest&>(request));
-    case WSMessage::APISetWindowBackingStoreRequest:
+    case WSEvent::APISetWindowBackingStoreRequest:
         return handle_request(static_cast<const WSAPISetWindowBackingStoreRequest&>(request));
-    case WSMessage::APISetWallpaperRequest:
+    case WSEvent::APISetWallpaperRequest:
         return handle_request(static_cast<const WSAPISetWallpaperRequest&>(request));
-    case WSMessage::APIGetWallpaperRequest:
+    case WSEvent::APIGetWallpaperRequest:
         return handle_request(static_cast<const WSAPIGetWallpaperRequest&>(request));
-    case WSMessage::APISetWindowOverrideCursorRequest:
+    case WSEvent::APISetWindowOverrideCursorRequest:
         return handle_request(static_cast<const WSAPISetWindowOverrideCursorRequest&>(request));
-    case WSMessage::WMAPISetActiveWindowRequest:
+    case WSEvent::WMAPISetActiveWindowRequest:
         return handle_request(static_cast<const WSWMAPISetActiveWindowRequest&>(request));
-    case WSMessage::APIPopupMenuRequest:
+    case WSEvent::APIPopupMenuRequest:
         return handle_request(static_cast<const WSAPIPopupMenuRequest&>(request));
-    case WSMessage::APIDismissMenuRequest:
+    case WSEvent::APIDismissMenuRequest:
         return handle_request(static_cast<const WSAPIDismissMenuRequest&>(request));
     default:
         break;

+ 1 - 1
Servers/WindowServer/WSClientConnection.h

@@ -6,7 +6,7 @@
 #include <AK/Function.h>
 #include <SharedGraphics/GraphicsBitmap.h>
 #include <LibCore/CObject.h>
-#include <WindowServer/WSMessage.h>
+#include <WindowServer/WSEvent.h>
 
 class WSWindow;
 class WSMenu;

+ 49 - 49
Servers/WindowServer/WSMessage.h → Servers/WindowServer/WSEvent.h

@@ -9,7 +9,7 @@
 #include <WindowServer/WSWindowType.h>
 #include <LibCore/CEvent.h>
 
-class WSMessage : public CEvent {
+class WSEvent : public CEvent {
 public:
     enum Type {
         Invalid = 2000,
@@ -64,19 +64,19 @@ public:
         __End_API_Client_Requests,
     };
 
-    WSMessage() { }
-    explicit WSMessage(Type type) : CEvent(type) { }
-    virtual ~WSMessage() { }
+    WSEvent() { }
+    explicit WSEvent(Type type) : CEvent(type) { }
+    virtual ~WSEvent() { }
 
     bool is_client_request() const { return type() > __Begin_API_Client_Requests && type() < __End_API_Client_Requests; }
     bool is_mouse_event() const { return type() == MouseMove || type() == MouseDown || type() == MouseUp; }
     bool is_key_event() const { return type() == KeyUp || type() == KeyDown; }
 };
 
-class WSClientDisconnectedNotification : public WSMessage {
+class WSClientDisconnectedNotification : public WSEvent {
 public:
     explicit WSClientDisconnectedNotification(int client_id)
-        : WSMessage(WM_ClientDisconnected)
+        : WSEvent(WM_ClientDisconnected)
         , m_client_id(client_id)
     {
     }
@@ -87,10 +87,10 @@ private:
     int m_client_id { 0 };
 };
 
-class WSAPIClientRequest : public WSMessage {
+class WSAPIClientRequest : public WSEvent {
 public:
     WSAPIClientRequest(Type type, int client_id)
-        : WSMessage(type)
+        : WSEvent(type)
         , m_client_id(client_id)
     {
     }
@@ -104,7 +104,7 @@ private:
 class WSWMAPISetActiveWindowRequest : public WSAPIClientRequest {
 public:
     WSWMAPISetActiveWindowRequest(int client_id, int target_client_id, int target_window_id)
-        : WSAPIClientRequest(WSMessage::WMAPISetActiveWindowRequest, client_id)
+        : WSAPIClientRequest(WSEvent::WMAPISetActiveWindowRequest, client_id)
         , m_target_client_id(target_client_id)
         , m_target_window_id(target_window_id)
     {
@@ -121,7 +121,7 @@ private:
 class WSAPISetGlobalCursorTrackingRequest : public WSAPIClientRequest {
 public:
     WSAPISetGlobalCursorTrackingRequest(int client_id, int window_id, bool value)
-        : WSAPIClientRequest(WSMessage::APISetGlobalCursorTrackingRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APISetGlobalCursorTrackingRequest, client_id)
         , m_window_id(window_id)
         , m_value(value)
     {
@@ -138,7 +138,7 @@ private:
 class WSAPICreateMenubarRequest : public WSAPIClientRequest {
 public:
     WSAPICreateMenubarRequest(int client_id)
-        : WSAPIClientRequest(WSMessage::APICreateMenubarRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APICreateMenubarRequest, client_id)
     {
     }
 };
@@ -146,7 +146,7 @@ public:
 class WSAPIDestroyMenubarRequest : public WSAPIClientRequest {
 public:
     WSAPIDestroyMenubarRequest(int client_id, int menubar_id)
-        : WSAPIClientRequest(WSMessage::APIDestroyMenubarRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APIDestroyMenubarRequest, client_id)
         , m_menubar_id(menubar_id)
     {
     }
@@ -160,7 +160,7 @@ private:
 class WSAPISetApplicationMenubarRequest : public WSAPIClientRequest {
 public:
     WSAPISetApplicationMenubarRequest(int client_id, int menubar_id)
-        : WSAPIClientRequest(WSMessage::APISetApplicationMenubarRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APISetApplicationMenubarRequest, client_id)
         , m_menubar_id(menubar_id)
     {
     }
@@ -174,7 +174,7 @@ private:
 class WSAPIAddMenuToMenubarRequest : public WSAPIClientRequest {
 public:
     WSAPIAddMenuToMenubarRequest(int client_id, int menubar_id, int menu_id)
-        : WSAPIClientRequest(WSMessage::APIAddMenuToMenubarRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APIAddMenuToMenubarRequest, client_id)
         , m_menubar_id(menubar_id)
         , m_menu_id(menu_id)
     {
@@ -191,7 +191,7 @@ private:
 class WSAPIPopupMenuRequest : public WSAPIClientRequest {
 public:
     WSAPIPopupMenuRequest(int client_id, int menu_id, const Point& position)
-        : WSAPIClientRequest(WSMessage::APIPopupMenuRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APIPopupMenuRequest, client_id)
         , m_menu_id(menu_id)
         , m_position(position)
     {
@@ -208,7 +208,7 @@ private:
 class WSAPIDismissMenuRequest : public WSAPIClientRequest {
 public:
     WSAPIDismissMenuRequest(int client_id, int menu_id)
-        : WSAPIClientRequest(WSMessage::APIDismissMenuRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APIDismissMenuRequest, client_id)
         , m_menu_id(menu_id)
     {
     }
@@ -222,7 +222,7 @@ private:
 class WSAPICreateMenuRequest : public WSAPIClientRequest {
 public:
     WSAPICreateMenuRequest(int client_id, const String& text)
-        : WSAPIClientRequest(WSMessage::APICreateMenuRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APICreateMenuRequest, client_id)
         , m_text(text)
     {
     }
@@ -236,7 +236,7 @@ private:
 class WSAPIDestroyMenuRequest : public WSAPIClientRequest {
 public:
     WSAPIDestroyMenuRequest(int client_id, int menu_id)
-        : WSAPIClientRequest(WSMessage::APIDestroyMenuRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APIDestroyMenuRequest, client_id)
         , m_menu_id(menu_id)
     {
     }
@@ -250,7 +250,7 @@ private:
 class WSAPIAddMenuItemRequest : public WSAPIClientRequest {
 public:
     WSAPIAddMenuItemRequest(int client_id, int menu_id, unsigned identifier, const String& text, const String& shortcut_text, bool enabled)
-        : WSAPIClientRequest(WSMessage::APIAddMenuItemRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APIAddMenuItemRequest, client_id)
         , m_menu_id(menu_id)
         , m_identifier(identifier)
         , m_text(text)
@@ -276,7 +276,7 @@ private:
 class WSAPIUpdateMenuItemRequest : public WSAPIClientRequest {
 public:
     WSAPIUpdateMenuItemRequest(int client_id, int menu_id, unsigned identifier, const String& text, const String& shortcut_text, bool enabled)
-        : WSAPIClientRequest(WSMessage::APIUpdateMenuItemRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APIUpdateMenuItemRequest, client_id)
         , m_menu_id(menu_id)
         , m_identifier(identifier)
         , m_text(text)
@@ -302,7 +302,7 @@ private:
 class WSAPIAddMenuSeparatorRequest : public WSAPIClientRequest {
 public:
     WSAPIAddMenuSeparatorRequest(int client_id, int menu_id)
-        : WSAPIClientRequest(WSMessage::APIAddMenuSeparatorRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APIAddMenuSeparatorRequest, client_id)
         , m_menu_id(menu_id)
     {
     }
@@ -316,7 +316,7 @@ private:
 class WSAPISetWindowOverrideCursorRequest final : public WSAPIClientRequest {
 public:
     explicit WSAPISetWindowOverrideCursorRequest(int client_id, int window_id, WSStandardCursor cursor)
-        : WSAPIClientRequest(WSMessage::APISetWindowOverrideCursorRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APISetWindowOverrideCursorRequest, client_id)
         , m_window_id(window_id)
         , m_cursor(cursor)
     {
@@ -333,7 +333,7 @@ private:
 class WSAPISetWallpaperRequest final : public WSAPIClientRequest {
 public:
     explicit WSAPISetWallpaperRequest(int client_id, String&& wallpaper)
-        : WSAPIClientRequest(WSMessage::APISetWallpaperRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APISetWallpaperRequest, client_id)
         , m_wallpaper(move(wallpaper))
     {
     }
@@ -347,7 +347,7 @@ private:
 class WSAPIGetWallpaperRequest final : public WSAPIClientRequest {
 public:
     explicit WSAPIGetWallpaperRequest(int client_id)
-        : WSAPIClientRequest(WSMessage::APIGetWallpaperRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APIGetWallpaperRequest, client_id)
     {
     }
 };
@@ -355,7 +355,7 @@ public:
 class WSAPISetWindowTitleRequest final : public WSAPIClientRequest {
 public:
     explicit WSAPISetWindowTitleRequest(int client_id, int window_id, String&& title)
-        : WSAPIClientRequest(WSMessage::APISetWindowTitleRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APISetWindowTitleRequest, client_id)
         , m_window_id(window_id)
         , m_title(move(title))
     {
@@ -372,7 +372,7 @@ private:
 class WSAPIGetWindowTitleRequest final : public WSAPIClientRequest {
 public:
     explicit WSAPIGetWindowTitleRequest(int client_id, int window_id)
-        : WSAPIClientRequest(WSMessage::APIGetWindowTitleRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APIGetWindowTitleRequest, client_id)
         , m_window_id(window_id)
     {
     }
@@ -386,7 +386,7 @@ private:
 class WSAPISetClipboardContentsRequest final : public WSAPIClientRequest {
 public:
     explicit WSAPISetClipboardContentsRequest(int client_id, int shared_buffer_id, int size)
-        : WSAPIClientRequest(WSMessage::APISetClipboardContentsRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APISetClipboardContentsRequest, client_id)
         , m_shared_buffer_id(shared_buffer_id)
         , m_size(size)
     {
@@ -403,7 +403,7 @@ private:
 class WSAPIGetClipboardContentsRequest final : public WSAPIClientRequest {
 public:
     explicit WSAPIGetClipboardContentsRequest(int client_id)
-        : WSAPIClientRequest(WSMessage::APIGetClipboardContentsRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APIGetClipboardContentsRequest, client_id)
     {
     }
 };
@@ -411,7 +411,7 @@ public:
 class WSAPISetWindowOpacityRequest final : public WSAPIClientRequest {
 public:
     explicit WSAPISetWindowOpacityRequest(int client_id, int window_id, float opacity)
-        : WSAPIClientRequest(WSMessage::APISetWindowOpacityRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APISetWindowOpacityRequest, client_id)
         , m_window_id(window_id)
         , m_opacity(opacity)
     {
@@ -428,7 +428,7 @@ private:
 class WSAPISetWindowBackingStoreRequest final : public WSAPIClientRequest {
 public:
     explicit WSAPISetWindowBackingStoreRequest(int client_id, int window_id, int shared_buffer_id, const Size& size, size_t bpp, size_t pitch, bool has_alpha_channel, bool flush_immediately)
-        : WSAPIClientRequest(WSMessage::APISetWindowBackingStoreRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APISetWindowBackingStoreRequest, client_id)
         , m_window_id(window_id)
         , m_shared_buffer_id(shared_buffer_id)
         , m_size(size)
@@ -460,7 +460,7 @@ private:
 class WSAPISetWindowRectRequest final : public WSAPIClientRequest {
 public:
     explicit WSAPISetWindowRectRequest(int client_id, int window_id, const Rect& rect)
-        : WSAPIClientRequest(WSMessage::APISetWindowRectRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APISetWindowRectRequest, client_id)
         , m_window_id(window_id)
         , m_rect(rect)
     {
@@ -477,7 +477,7 @@ private:
 class WSAPISetWindowIconRequest final : public WSAPIClientRequest {
 public:
     explicit WSAPISetWindowIconRequest(int client_id, int window_id, const String& icon_path)
-        : WSAPIClientRequest(WSMessage::APISetWindowIconRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APISetWindowIconRequest, client_id)
         , m_window_id(window_id)
         , m_icon_path(icon_path)
     {
@@ -494,7 +494,7 @@ private:
 class WSAPIGetWindowRectRequest final : public WSAPIClientRequest {
 public:
     explicit WSAPIGetWindowRectRequest(int client_id, int window_id)
-        : WSAPIClientRequest(WSMessage::APIGetWindowRectRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APIGetWindowRectRequest, client_id)
         , m_window_id(window_id)
     {
     }
@@ -508,7 +508,7 @@ private:
 class WSAPICreateWindowRequest : public WSAPIClientRequest {
 public:
     WSAPICreateWindowRequest(int client_id, const Rect& rect, const String& title, bool has_alpha_channel, bool modal, bool resizable, float opacity, const Size& base_size, const Size& size_increment, WSWindowType window_type, Color background_color)
-        : WSAPIClientRequest(WSMessage::APICreateWindowRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APICreateWindowRequest, client_id)
         , m_rect(rect)
         , m_title(title)
         , m_opacity(opacity)
@@ -549,7 +549,7 @@ private:
 class WSAPIDestroyWindowRequest : public WSAPIClientRequest {
 public:
     WSAPIDestroyWindowRequest(int client_id, int window_id)
-        : WSAPIClientRequest(WSMessage::APIDestroyWindowRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APIDestroyWindowRequest, client_id)
         , m_window_id(window_id)
     {
     }
@@ -563,7 +563,7 @@ private:
 class WSAPIInvalidateRectRequest final : public WSAPIClientRequest {
 public:
     explicit WSAPIInvalidateRectRequest(int client_id, int window_id, const Rect& rect)
-        : WSAPIClientRequest(WSMessage::APIInvalidateRectRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APIInvalidateRectRequest, client_id)
         , m_window_id(window_id)
         , m_rect(rect)
     {
@@ -580,7 +580,7 @@ private:
 class WSAPIGetWindowBackingStoreRequest final : public WSAPIClientRequest {
 public:
     explicit WSAPIGetWindowBackingStoreRequest(int client_id, int window_id)
-        : WSAPIClientRequest(WSMessage::APIGetWindowBackingStoreRequest, client_id)
+        : WSAPIClientRequest(WSEvent::APIGetWindowBackingStoreRequest, client_id)
         , m_window_id(window_id)
     {
     }
@@ -594,7 +594,7 @@ private:
 class WSAPIDidFinishPaintingNotification final : public WSAPIClientRequest {
 public:
     explicit WSAPIDidFinishPaintingNotification(int client_id, int window_id, const Rect& rect)
-        : WSAPIClientRequest(WSMessage::APIDidFinishPaintingNotification, client_id)
+        : WSAPIClientRequest(WSEvent::APIDidFinishPaintingNotification, client_id)
         , m_window_id(window_id)
         , m_rect(rect)
     {
@@ -615,10 +615,10 @@ enum class MouseButton : byte {
     Middle = 4,
 };
 
-class WSKeyEvent final : public WSMessage {
+class WSKeyEvent final : public WSEvent {
 public:
     WSKeyEvent(Type type, int key, char character, byte modifiers)
-        : WSMessage(type)
+        : WSEvent(type)
         , m_key(key)
         , m_character(character)
         , m_modifiers(modifiers)
@@ -634,17 +634,17 @@ public:
     char character() const { return m_character; }
 
 private:
-    friend class WSMessageLoop;
+    friend class WSEventLoop;
     friend class WSScreen;
     int m_key { 0 };
     char m_character { 0 };
     byte m_modifiers { 0 };
 };
 
-class WSMouseEvent final : public WSMessage {
+class WSMouseEvent final : public WSEvent {
 public:
     WSMouseEvent(Type type, const Point& position, unsigned buttons, MouseButton button, unsigned modifiers)
-        : WSMessage(type)
+        : WSEvent(type)
         , m_position(position)
         , m_buttons(buttons)
         , m_button(button)
@@ -668,10 +668,10 @@ private:
     unsigned m_modifiers { 0 };
 };
 
-class WSResizeEvent final : public WSMessage {
+class WSResizeEvent final : public WSEvent {
 public:
     WSResizeEvent(const Rect& old_rect, const Rect& rect)
-        : WSMessage(WSMessage::WindowResized)
+        : WSEvent(WSEvent::WindowResized)
         , m_old_rect(old_rect)
         , m_rect(rect)
     {
@@ -685,10 +685,10 @@ private:
     Rect m_rect;
 };
 
-class WSWMEvent : public WSMessage {
+class WSWMEvent : public WSEvent {
 public:
     WSWMEvent(Type type, int client_id, int window_id)
-        : WSMessage(type)
+        : WSEvent(type)
         , m_client_id(client_id)
         , m_window_id(window_id)
     {
@@ -705,7 +705,7 @@ private:
 class WSWMWindowRemovedEvent : public WSWMEvent {
 public:
     WSWMWindowRemovedEvent(int client_id, int window_id)
-        : WSWMEvent(WSMessage::WM_WindowRemoved, client_id, window_id)
+        : WSWMEvent(WSEvent::WM_WindowRemoved, client_id, window_id)
     {
     }
 };
@@ -713,7 +713,7 @@ public:
 class WSWMWindowStateChangedEvent : public WSWMEvent {
 public:
     WSWMWindowStateChangedEvent(int client_id, int window_id, const String& title, const Rect& rect, bool is_active, WSWindowType window_type, bool is_minimized, const String& icon_path)
-        : WSWMEvent(WSMessage::WM_WindowStateChanged, client_id, window_id)
+        : WSWMEvent(WSEvent::WM_WindowStateChanged, client_id, window_id)
         , m_title(title)
         , m_icon_path(icon_path)
         , m_rect(rect)

+ 13 - 13
Servers/WindowServer/WSMessageLoop.cpp → Servers/WindowServer/WSEventLoop.cpp

@@ -1,5 +1,5 @@
-#include <WindowServer/WSMessageLoop.h>
-#include <WindowServer/WSMessage.h>
+#include <WindowServer/WSEventLoop.h>
+#include <WindowServer/WSEvent.h>
 #include <LibCore/CObject.h>
 #include <WindowServer/WSWindowManager.h>
 #include <WindowServer/WSScreen.h>
@@ -19,7 +19,7 @@
 
 //#define WSMESSAGELOOP_DEBUG
 
-WSMessageLoop::WSMessageLoop()
+WSEventLoop::WSEventLoop()
 {
     m_keyboard_fd = open("/dev/keyboard", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
     m_mouse_fd = open("/dev/psaux", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
@@ -40,16 +40,16 @@ WSMessageLoop::WSMessageLoop()
     ASSERT(m_mouse_fd >= 0);
 }
 
-WSMessageLoop::~WSMessageLoop()
+WSEventLoop::~WSEventLoop()
 {
 }
 
-WSMessageLoop& WSMessageLoop::the()
+WSEventLoop& WSEventLoop::the()
 {
-    return static_cast<WSMessageLoop&>(CEventLoop::current());
+    return static_cast<WSEventLoop&>(CEventLoop::current());
 }
 
-void WSMessageLoop::drain_server()
+void WSEventLoop::drain_server()
 {
     sockaddr_un address;
     socklen_t address_size = sizeof(address);
@@ -61,7 +61,7 @@ void WSMessageLoop::drain_server()
     }
 }
 
-void WSMessageLoop::drain_mouse()
+void WSEventLoop::drain_mouse()
 {
     auto& screen = WSScreen::the();
     unsigned prev_buttons = screen.mouse_button_state();
@@ -89,7 +89,7 @@ void WSMessageLoop::drain_mouse()
         screen.on_receive_mouse_data(dx, dy, buttons);
 }
 
-void WSMessageLoop::drain_keyboard()
+void WSEventLoop::drain_keyboard()
 {
     auto& screen = WSScreen::the();
     for (;;) {
@@ -102,7 +102,7 @@ void WSMessageLoop::drain_keyboard()
     }
 }
 
-void WSMessageLoop::notify_client_disconnected(int client_id)
+void WSEventLoop::notify_client_disconnected(int client_id)
 {
     auto* client = WSClientConnection::from_client_id(client_id);
     if (!client)
@@ -128,7 +128,7 @@ static WSWindowType from_api(WSAPI_WindowType api_type)
     }
 }
 
-void WSMessageLoop::on_receive_from_client(int client_id, const WSAPI_ClientMessage& message)
+void WSEventLoop::on_receive_from_client(int client_id, const WSAPI_ClientMessage& message)
 {
     WSClientConnection& client = *WSClientConnection::from_client_id(client_id);
     switch (message.type) {
@@ -237,7 +237,7 @@ void WSMessageLoop::on_receive_from_client(int client_id, const WSAPI_ClientMess
     }
 }
 
-void WSMessageLoop::add_file_descriptors_for_select(fd_set& fds, int& max_fd_added)
+void WSEventLoop::add_file_descriptors_for_select(fd_set& fds, int& max_fd_added)
 {
     auto add_fd_to_set = [&max_fd_added] (int fd, auto& set) {
         FD_SET(fd, &set);
@@ -252,7 +252,7 @@ void WSMessageLoop::add_file_descriptors_for_select(fd_set& fds, int& max_fd_add
     });
 }
 
-void WSMessageLoop::process_file_descriptors_after_select(const fd_set& fds)
+void WSEventLoop::process_file_descriptors_after_select(const fd_set& fds)
 {
     if (FD_ISSET(m_server_fd, &fds))
         drain_server();

+ 5 - 5
Servers/WindowServer/WSMessageLoop.h → Servers/WindowServer/WSEventLoop.h

@@ -1,6 +1,6 @@
 #pragma once
 
-#include "WSMessage.h"
+#include "WSEvent.h"
 #include <AK/HashMap.h>
 #include <AK/OwnPtr.h>
 #include <AK/Vector.h>
@@ -12,12 +12,12 @@ class CObject;
 struct WSAPI_ClientMessage;
 struct WSAPI_ServerMessage;
 
-class WSMessageLoop : public CEventLoop {
+class WSEventLoop : public CEventLoop {
 public:
-    WSMessageLoop();
-    virtual ~WSMessageLoop() override;
+    WSEventLoop();
+    virtual ~WSEventLoop() override;
 
-    static WSMessageLoop& the();
+    static WSEventLoop& the();
 
     void on_receive_from_client(int client_id, const WSAPI_ClientMessage&);
     void notify_client_disconnected(int client_id);

+ 6 - 6
Servers/WindowServer/WSMenu.cpp

@@ -1,8 +1,8 @@
 #include "WSMenu.h"
 #include "WSMenuItem.h"
 #include "WSWindow.h"
-#include "WSMessage.h"
-#include "WSMessageLoop.h"
+#include "WSEvent.h"
+#include "WSEventLoop.h"
 #include "WSWindowManager.h"
 #include <WindowServer/WSAPITypes.h>
 #include <WindowServer/WSClientConnection.h>
@@ -110,11 +110,11 @@ void WSMenu::draw()
     }
 }
 
-void WSMenu::event(CEvent& message)
+void WSMenu::event(CEvent& event)
 {
     ASSERT(menu_window());
-    if (message.type() == WSMessage::MouseMove) {
-        auto* item = item_at(static_cast<const WSMouseEvent&>(message).position());
+    if (event.type() == WSEvent::MouseMove) {
+        auto* item = item_at(static_cast<const WSMouseEvent&>(event).position());
         if (!item || m_hovered_item == item)
             return;
         m_hovered_item = item;
@@ -122,7 +122,7 @@ void WSMenu::event(CEvent& message)
         return;
     }
 
-    if (message.type() == WSMessage::MouseUp) {
+    if (event.type() == WSEvent::MouseUp) {
         if (!m_hovered_item)
             return;
         if (m_hovered_item->is_enabled())

+ 1 - 1
Servers/WindowServer/WSMenu.h

@@ -9,7 +9,7 @@
 
 class WSClientConnection;
 class WSMenuBar;
-class WSMessage;
+class WSEvent;
 class WSWindow;
 class Font;
 

+ 8 - 8
Servers/WindowServer/WSScreen.cpp

@@ -1,6 +1,6 @@
 #include "WSScreen.h"
-#include "WSMessageLoop.h"
-#include "WSMessage.h"
+#include "WSEventLoop.h"
+#include "WSEvent.h"
 #include "WSWindowManager.h"
 #include <unistd.h>
 #include <fcntl.h>
@@ -69,15 +69,15 @@ void WSScreen::on_receive_mouse_data(int dx, int dy, unsigned buttons)
     auto post_mousedown_or_mouseup_if_needed = [&] (MouseButton button) {
         if (!(changed_buttons & (unsigned)button))
             return;
-        auto message = make<WSMouseEvent>(buttons & (unsigned)button ? WSMessage::MouseDown : WSMessage::MouseUp, m_cursor_location, buttons, button, m_modifiers);
-        WSMessageLoop::the().post_event(WSWindowManager::the(), move(message));
+        auto message = make<WSMouseEvent>(buttons & (unsigned)button ? WSEvent::MouseDown : WSEvent::MouseUp, m_cursor_location, buttons, button, m_modifiers);
+        WSEventLoop::the().post_event(WSWindowManager::the(), move(message));
     };
     post_mousedown_or_mouseup_if_needed(MouseButton::Left);
     post_mousedown_or_mouseup_if_needed(MouseButton::Right);
     post_mousedown_or_mouseup_if_needed(MouseButton::Middle);
     if (m_cursor_location != prev_location) {
-        auto message = make<WSMouseEvent>(WSMessage::MouseMove, m_cursor_location, buttons, MouseButton::None, m_modifiers);
-        WSMessageLoop::the().post_event(WSWindowManager::the(), move(message));
+        auto message = make<WSMouseEvent>(WSEvent::MouseMove, m_cursor_location, buttons, MouseButton::None, m_modifiers);
+        WSEventLoop::the().post_event(WSWindowManager::the(), move(message));
     }
     // NOTE: Invalidate the cursor if it moved, or if the left button changed state (for the cursor color inversion.)
     if (m_cursor_location != prev_location || changed_buttons & (unsigned)MouseButton::Left)
@@ -87,8 +87,8 @@ void WSScreen::on_receive_mouse_data(int dx, int dy, unsigned buttons)
 void WSScreen::on_receive_keyboard_data(KeyEvent kernel_event)
 {
     m_modifiers = kernel_event.modifiers();
-    auto message = make<WSKeyEvent>(kernel_event.is_press() ? WSMessage::KeyDown : WSMessage::KeyUp, kernel_event.key, kernel_event.character, kernel_event.modifiers());
-    WSMessageLoop::the().post_event(WSWindowManager::the(), move(message));
+    auto message = make<WSKeyEvent>(kernel_event.is_press() ? WSEvent::KeyDown : WSEvent::KeyUp, kernel_event.key, kernel_event.character, kernel_event.modifiers());
+    WSEventLoop::the().post_event(WSWindowManager::the(), move(message));
 }
 
 void WSScreen::set_y_offset(int offset)

+ 30 - 30
Servers/WindowServer/WSWindow.cpp

@@ -1,7 +1,7 @@
 #include "WSWindow.h"
 #include "WSWindowManager.h"
-#include "WSMessage.h"
-#include "WSMessageLoop.h"
+#include "WSEvent.h"
+#include "WSEventLoop.h"
 #include <WindowServer/WSAPITypes.h>
 #include <WindowServer/WSClientConnection.h>
 
@@ -89,9 +89,9 @@ void WSWindow::handle_mouse_event(const WSMouseEvent& event)
     server_message.window_id = window_id();
 
     switch (event.type()) {
-    case WSMessage::MouseMove: server_message.type = WSAPI_ServerMessage::Type::MouseMove; break;
-    case WSMessage::MouseDown: server_message.type = WSAPI_ServerMessage::Type::MouseDown; break;
-    case WSMessage::MouseUp: server_message.type = WSAPI_ServerMessage::Type::MouseUp; break;
+    case WSEvent::MouseMove: server_message.type = WSAPI_ServerMessage::Type::MouseMove; break;
+    case WSEvent::MouseDown: server_message.type = WSAPI_ServerMessage::Type::MouseDown; break;
+    case WSEvent::MouseUp: server_message.type = WSAPI_ServerMessage::Type::MouseUp; break;
     default: ASSERT_NOT_REACHED();
     }
 
@@ -130,10 +130,10 @@ void WSWindow::set_minimized(bool minimized)
     WSWindowManager::the().notify_minimization_state_changed(*this);
 }
 
-void WSWindow::event(CEvent& message)
+void WSWindow::event(CEvent& event)
 {
     if (m_internal_owner)
-        return m_internal_owner->event(message);
+        return m_internal_owner->event(event);
 
     if (is_blocked_by_modal_window())
         return;
@@ -141,51 +141,51 @@ void WSWindow::event(CEvent& message)
     WSAPI_ServerMessage server_message;
     server_message.window_id = window_id();
 
-    if (static_cast<WSMessage&>(message).is_mouse_event())
-        return handle_mouse_event(static_cast<const WSMouseEvent&>(message));
+    if (static_cast<WSEvent&>(event).is_mouse_event())
+        return handle_mouse_event(static_cast<const WSMouseEvent&>(event));
 
-    switch (message.type()) {
-    case WSMessage::WindowEntered:
+    switch (event.type()) {
+    case WSEvent::WindowEntered:
         server_message.type = WSAPI_ServerMessage::Type::WindowEntered;
         break;
-    case WSMessage::WindowLeft:
+    case WSEvent::WindowLeft:
         server_message.type = WSAPI_ServerMessage::Type::WindowLeft;
         break;
-    case WSMessage::KeyDown:
+    case WSEvent::KeyDown:
         server_message.type = WSAPI_ServerMessage::Type::KeyDown;
-        server_message.key.character = static_cast<const WSKeyEvent&>(message).character();
-        server_message.key.key = static_cast<const WSKeyEvent&>(message).key();
-        server_message.key.modifiers = static_cast<const WSKeyEvent&>(message).modifiers();
+        server_message.key.character = static_cast<const WSKeyEvent&>(event).character();
+        server_message.key.key = static_cast<const WSKeyEvent&>(event).key();
+        server_message.key.modifiers = static_cast<const WSKeyEvent&>(event).modifiers();
         break;
-    case WSMessage::KeyUp:
+    case WSEvent::KeyUp:
         server_message.type = WSAPI_ServerMessage::Type::KeyUp;
-        server_message.key.character = static_cast<const WSKeyEvent&>(message).character();
-        server_message.key.key = static_cast<const WSKeyEvent&>(message).key();
-        server_message.key.modifiers = static_cast<const WSKeyEvent&>(message).modifiers();
+        server_message.key.character = static_cast<const WSKeyEvent&>(event).character();
+        server_message.key.key = static_cast<const WSKeyEvent&>(event).key();
+        server_message.key.modifiers = static_cast<const WSKeyEvent&>(event).modifiers();
         break;
-    case WSMessage::WindowActivated:
+    case WSEvent::WindowActivated:
         server_message.type = WSAPI_ServerMessage::Type::WindowActivated;
         break;
-    case WSMessage::WindowDeactivated:
+    case WSEvent::WindowDeactivated:
         server_message.type = WSAPI_ServerMessage::Type::WindowDeactivated;
         break;
-    case WSMessage::WindowCloseRequest:
+    case WSEvent::WindowCloseRequest:
         server_message.type = WSAPI_ServerMessage::Type::WindowCloseRequest;
         break;
-    case WSMessage::WindowResized:
+    case WSEvent::WindowResized:
         server_message.type = WSAPI_ServerMessage::Type::WindowResized;
-        server_message.window.old_rect = static_cast<const WSResizeEvent&>(message).old_rect();
-        server_message.window.rect = static_cast<const WSResizeEvent&>(message).rect();
+        server_message.window.old_rect = static_cast<const WSResizeEvent&>(event).old_rect();
+        server_message.window.rect = static_cast<const WSResizeEvent&>(event).rect();
         break;
-    case WSMessage::WM_WindowRemoved: {
-        auto& removed_event = static_cast<const WSWMWindowRemovedEvent&>(message);
+    case WSEvent::WM_WindowRemoved: {
+        auto& removed_event = static_cast<const WSWMWindowRemovedEvent&>(event);
         server_message.type = WSAPI_ServerMessage::Type::WM_WindowRemoved;
         server_message.wm.client_id = removed_event.client_id();
         server_message.wm.window_id = removed_event.window_id();
         break;
     }
-    case WSMessage::WM_WindowStateChanged: {
-        auto& changed_event = static_cast<const WSWMWindowStateChangedEvent&>(message);
+    case WSEvent::WM_WindowStateChanged: {
+        auto& changed_event = static_cast<const WSWMWindowStateChangedEvent&>(event);
         server_message.type = WSAPI_ServerMessage::Type::WM_WindowStateChanged;
         server_message.wm.client_id = changed_event.client_id();
         server_message.wm.window_id = changed_event.window_id();

+ 5 - 5
Servers/WindowServer/WSWindowFrame.cpp

@@ -1,7 +1,7 @@
 #include <WindowServer/WSWindowFrame.h>
 #include <WindowServer/WSWindowManager.h>
 #include <WindowServer/WSWindow.h>
-#include <WindowServer/WSMessage.h>
+#include <WindowServer/WSEvent.h>
 #include <WindowServer/WSButton.h>
 #include <SharedGraphics/CharacterBitmap.h>
 #include <SharedGraphics/Painter.h>
@@ -53,7 +53,7 @@ WSWindowFrame::WSWindowFrame(WSWindow& window)
         s_minimize_button_bitmap = &CharacterBitmap::create_from_ascii(s_minimize_button_bitmap_data, s_minimize_button_bitmap_width, s_minimize_button_bitmap_height).leak_ref();
 
     m_buttons.append(make<WSButton>(*this, *s_close_button_bitmap, [this] {
-        WSMessage close_request(WSMessage::WindowCloseRequest);
+        WSEvent close_request(WSEvent::WindowCloseRequest);
         m_window.event(close_request);
     }));
 
@@ -243,19 +243,19 @@ void WSWindowFrame::on_mouse_event(const WSMouseEvent& event)
     if (title_bar_rect().contains(event.position())) {
         wm.clear_resize_candidate();
 
-        if (event.type() == WSMessage::MouseDown)
+        if (event.type() == WSEvent::MouseDown)
             wm.move_to_front_and_make_active(m_window);
 
         for (auto& button : m_buttons) {
             if (button->relative_rect().contains(event.position()))
                 return button->on_mouse_event(event.translated(-button->relative_rect().location()));
         }
-        if (event.type() == WSMessage::MouseDown && event.button() == MouseButton::Left)
+        if (event.type() == WSEvent::MouseDown && event.button() == MouseButton::Left)
             wm.start_window_drag(m_window, event.translated(rect().location()));
         return;
     }
 
-    if (event.type() == WSMessage::MouseMove && event.buttons() == 0) {
+    if (event.type() == WSEvent::MouseMove && event.buttons() == 0) {
         constexpr ResizeDirection direction_for_hot_area[3][3] = {
             { ResizeDirection::UpLeft, ResizeDirection::Up, ResizeDirection::UpRight },
             { ResizeDirection::Left, ResizeDirection::None, ResizeDirection::Right },

+ 27 - 27
Servers/WindowServer/WSWindowManager.cpp

@@ -1,7 +1,7 @@
 #include "WSWindowManager.h"
 #include "WSWindow.h"
 #include "WSScreen.h"
-#include "WSMessageLoop.h"
+#include "WSEventLoop.h"
 #include <SharedGraphics/Font.h>
 #include <SharedGraphics/Painter.h>
 #include <SharedGraphics/CharacterBitmap.h>
@@ -312,7 +312,7 @@ void WSWindowManager::remove_window(WSWindow& window)
 
     for_each_window_listening_to_wm_events([&window] (WSWindow& listener) {
         if (window.client())
-            WSMessageLoop::the().post_event(listener, make<WSWMWindowRemovedEvent>(window.client()->client_id(), window.window_id()));
+            WSEventLoop::the().post_event(listener, make<WSWMWindowRemovedEvent>(window.client()->client_id(), window.window_id()));
         return IterationDecision::Continue;
     });
 }
@@ -320,7 +320,7 @@ void WSWindowManager::remove_window(WSWindow& window)
 void WSWindowManager::tell_wm_listener_about_window(WSWindow& listener, WSWindow& window)
 {
     if (window.client())
-        WSMessageLoop::the().post_event(listener, make<WSWMWindowStateChangedEvent>(window.client()->client_id(), window.window_id(), window.title(), window.rect(), window.is_active(), window.type(), window.is_minimized(), window.icon_path()));
+        WSEventLoop::the().post_event(listener, make<WSWMWindowStateChangedEvent>(window.client()->client_id(), window.window_id(), window.title(), window.rect(), window.is_active(), window.type(), window.is_minimized(), window.icon_path()));
 }
 
 void WSWindowManager::tell_wm_listeners_window_state_changed(WSWindow& window)
@@ -458,7 +458,7 @@ bool WSWindowManager::process_ongoing_window_drag(const WSMouseEvent& event, WSW
 {
     if (!m_drag_window)
         return false;
-    if (event.type() == WSMessage::MouseUp && event.button() == MouseButton::Left) {
+    if (event.type() == WSEvent::MouseUp && event.button() == MouseButton::Left) {
 #ifdef DRAG_DEBUG
         printf("[WM] Finish dragging WSWindow{%p}\n", m_drag_window.ptr());
 #endif
@@ -466,7 +466,7 @@ bool WSWindowManager::process_ongoing_window_drag(const WSMouseEvent& event, WSW
         m_drag_window = nullptr;
         return true;
     }
-    if (event.type() == WSMessage::MouseMove) {
+    if (event.type() == WSEvent::MouseMove) {
         Point pos = m_drag_window_origin;
 #ifdef DRAG_DEBUG
         dbgprintf("[WM] Dragging [origin: %d,%d] now: %d,%d\n", m_drag_origin.x(), m_drag_origin.y(), event.x(), event.y());
@@ -483,18 +483,18 @@ bool WSWindowManager::process_ongoing_window_resize(const WSMouseEvent& event, W
     if (!m_resize_window)
         return false;
 
-    if (event.type() == WSMessage::MouseUp && event.button() == m_resizing_mouse_button) {
+    if (event.type() == WSEvent::MouseUp && event.button() == m_resizing_mouse_button) {
 #ifdef RESIZE_DEBUG
         printf("[WM] Finish resizing WSWindow{%p}\n", m_resize_window.ptr());
 #endif
-        WSMessageLoop::the().post_event(*m_resize_window, make<WSResizeEvent>(m_resize_window->rect(), m_resize_window->rect()));
+        WSEventLoop::the().post_event(*m_resize_window, make<WSResizeEvent>(m_resize_window->rect(), m_resize_window->rect()));
         invalidate(*m_resize_window);
         m_resize_window = nullptr;
         m_resizing_mouse_button = MouseButton::None;
         return true;
     }
 
-    if (event.type() != WSMessage::MouseMove)
+    if (event.type() != WSEvent::MouseMove)
         return false;
 
     auto old_rect = m_resize_window->rect();
@@ -569,7 +569,7 @@ bool WSWindowManager::process_ongoing_window_resize(const WSMouseEvent& event, W
               new_rect.to_string().characters());
 #endif
     m_resize_window->set_rect(new_rect);
-    WSMessageLoop::the().post_event(*m_resize_window, make<WSResizeEvent>(old_rect, new_rect));
+    WSEventLoop::the().post_event(*m_resize_window, make<WSResizeEvent>(old_rect, new_rect));
     return true;
 }
 
@@ -592,7 +592,7 @@ void WSWindowManager::process_mouse_event(const WSMouseEvent& event, WSWindow*&
         return m_cursor_tracking_button->on_mouse_event(event.translated(-m_cursor_tracking_button->screen_rect().location()));
 
     // This is quite hackish, but it's how the WSButton hover effect is implemented.
-    if (m_hovered_button && event.type() == WSMessage::MouseMove)
+    if (m_hovered_button && event.type() == WSEvent::MouseMove)
         m_hovered_button->on_mouse_event(event.translated(-m_hovered_button->screen_rect().location()));
 
     HashTable<WSWindow*> windows_who_received_mouse_event_due_to_cursor_tracking;
@@ -618,7 +618,7 @@ void WSWindowManager::process_mouse_event(const WSMouseEvent& event, WSWindow*&
         if (!event_is_inside_current_menu) {
             if (m_current_menu->hovered_item())
                 m_current_menu->clear_hovered_item();
-            if (event.type() == WSMessage::MouseDown || event.type() == WSMessage::MouseUp)
+            if (event.type() == WSEvent::MouseDown || event.type() == WSEvent::MouseUp)
                 close_current_menu();
         } else {
             event_window = &window;
@@ -641,18 +641,18 @@ void WSWindowManager::process_mouse_event(const WSMouseEvent& event, WSWindow*&
         // First check if we should initiate a drag or resize (Logo+LMB or Logo+RMB).
         // In those cases, the event is swallowed by the window manager.
         if (window.type() == WSWindowType::Normal) {
-            if (m_keyboard_modifiers == Mod_Logo && event.type() == WSMessage::MouseDown && event.button() == MouseButton::Left) {
+            if (m_keyboard_modifiers == Mod_Logo && event.type() == WSEvent::MouseDown && event.button() == MouseButton::Left) {
                 start_window_drag(window, event);
                 return IterationDecision::Abort;
             }
-            if (m_keyboard_modifiers == Mod_Logo && event.type() == WSMessage::MouseDown && event.button() == MouseButton::Right && !window.is_blocked_by_modal_window()) {
+            if (m_keyboard_modifiers == Mod_Logo && event.type() == WSEvent::MouseDown && event.button() == MouseButton::Right && !window.is_blocked_by_modal_window()) {
                 start_window_resize(window, event);
                 return IterationDecision::Abort;
             }
         }
         // Well okay, let's see if we're hitting the frame or the window inside the frame.
         if (window.rect().contains(event.position())) {
-            if (window.type() == WSWindowType::Normal && event.type() == WSMessage::MouseDown)
+            if (window.type() == WSWindowType::Normal && event.type() == WSEvent::MouseDown)
                 move_to_front_and_make_active(window);
             event_window = &window;
             if (!window.global_cursor_tracking() && !windows_who_received_mouse_event_due_to_cursor_tracking.contains(&window)) {
@@ -919,31 +919,31 @@ void WSWindowManager::draw_cursor()
     m_last_cursor_rect = cursor_rect;
 }
 
-void WSWindowManager::event(CEvent& message)
+void WSWindowManager::event(CEvent& event)
 {
-    if (static_cast<WSMessage&>(message).is_mouse_event()) {
+    if (static_cast<WSEvent&>(event).is_mouse_event()) {
         WSWindow* event_window = nullptr;
-        process_mouse_event(static_cast<const WSMouseEvent&>(message), event_window);
+        process_mouse_event(static_cast<const WSMouseEvent&>(event), event_window);
         set_hovered_window(event_window);
         return;
     }
 
-    if (static_cast<WSMessage&>(message).is_key_event()) {
-        auto& key_event = static_cast<const WSKeyEvent&>(message);
+    if (static_cast<WSEvent&>(event).is_key_event()) {
+        auto& key_event = static_cast<const WSKeyEvent&>(event);
         m_keyboard_modifiers = key_event.modifiers();
 
-        if (key_event.type() == WSMessage::KeyDown && key_event.modifiers() == Mod_Logo && key_event.key() == Key_Tab)
+        if (key_event.type() == WSEvent::KeyDown && key_event.modifiers() == Mod_Logo && key_event.key() == Key_Tab)
             m_switcher.show();
         if (m_switcher.is_visible()) {
             m_switcher.on_key_event(key_event);
             return;
         }
         if (m_active_window)
-            return m_active_window->event(message);
+            return m_active_window->event(event);
         return;
     }
 
-    if (message.type() == WSMessage::WM_DeferredCompose) {
+    if (event.type() == WSEvent::WM_DeferredCompose) {
         m_pending_compose_event = false;
         compose();
         return;
@@ -976,12 +976,12 @@ void WSWindowManager::set_active_window(WSWindow* window)
 
     auto* previously_active_window = m_active_window.ptr();
     if (previously_active_window) {
-        WSMessageLoop::the().post_event(*previously_active_window, make<WSMessage>(WSMessage::WindowDeactivated));
+        WSEventLoop::the().post_event(*previously_active_window, make<WSEvent>(WSEvent::WindowDeactivated));
         invalidate(*previously_active_window);
     }
     m_active_window = window->make_weak_ptr();
     if (m_active_window) {
-        WSMessageLoop::the().post_event(*m_active_window, make<WSMessage>(WSMessage::WindowActivated));
+        WSEventLoop::the().post_event(*m_active_window, make<WSEvent>(WSEvent::WindowActivated));
         invalidate(*m_active_window);
 
         auto* client = window->client();
@@ -999,12 +999,12 @@ void WSWindowManager::set_hovered_window(WSWindow* window)
         return;
 
     if (m_hovered_window)
-        WSMessageLoop::the().post_event(*m_hovered_window, make<WSMessage>(WSMessage::WindowLeft));
+        WSEventLoop::the().post_event(*m_hovered_window, make<WSEvent>(WSEvent::WindowLeft));
 
     m_hovered_window = window ? window->make_weak_ptr() : nullptr;
 
     if (m_hovered_window)
-        WSMessageLoop::the().post_event(*m_hovered_window, make<WSMessage>(WSMessage::WindowEntered));
+        WSEventLoop::the().post_event(*m_hovered_window, make<WSEvent>(WSEvent::WindowEntered));
 }
 
 void WSWindowManager::invalidate()
@@ -1028,7 +1028,7 @@ void WSWindowManager::invalidate(const Rect& a_rect, bool should_schedule_compos
     m_dirty_rects.add(rect);
 
     if (should_schedule_compose_event && !m_pending_compose_event) {
-        WSMessageLoop::the().post_event(*this, make<WSMessage>(WSMessage::WM_DeferredCompose));
+        WSEventLoop::the().post_event(*this, make<WSEvent>(WSEvent::WM_DeferredCompose));
         m_pending_compose_event = true;
     }
 }

+ 1 - 1
Servers/WindowServer/WSWindowManager.h

@@ -13,7 +13,7 @@
 #include <WindowServer/WSWindowType.h>
 #include <WindowServer/WSWindow.h>
 #include <WindowServer/WSCursor.h>
-#include <WindowServer/WSMessage.h>
+#include <WindowServer/WSEvent.h>
 #include <WindowServer/WSCPUMonitor.h>
 
 class WSAPIClientRequest;

+ 2 - 2
Servers/WindowServer/WSWindowSwitcher.cpp

@@ -1,6 +1,6 @@
 #include <WindowServer/WSWindowSwitcher.h>
 #include <WindowServer/WSWindowManager.h>
-#include <WindowServer/WSMessage.h>
+#include <WindowServer/WSEvent.h>
 #include <SharedGraphics/Font.h>
 
 WSWindowSwitcher::WSWindowSwitcher()
@@ -32,7 +32,7 @@ WSWindow* WSWindowSwitcher::selected_window()
 
 void WSWindowSwitcher::on_key_event(const WSKeyEvent& event)
 {
-    if (event.type() == WSMessage::KeyUp) {
+    if (event.type() == WSEvent::KeyUp) {
         if (event.key() == Key_Logo) {
             if (auto* window = selected_window())
                 WSWindowManager::the().move_to_front_and_make_active(*window);

+ 3 - 3
Servers/WindowServer/main.cpp

@@ -1,6 +1,6 @@
 #include <WindowServer/WSScreen.h>
 #include <WindowServer/WSWindowManager.h>
-#include <WindowServer/WSMessageLoop.h>
+#include <WindowServer/WSEventLoop.h>
 #include <signal.h>
 #include <stdio.h>
 
@@ -16,11 +16,11 @@ int main(int, char**)
         return 1;
     }
 
-    WSMessageLoop loop;
+    WSEventLoop loop;
     WSScreen screen(1024, 768);
     WSWindowManager window_manager;
 
     dbgprintf("Entering WindowServer main loop.\n");
-    WSMessageLoop::the().exec();
+    WSEventLoop::the().exec();
     ASSERT_NOT_REACHED();
 }