From 5b2e1226247a50cc23bd281de3d9d2038f8fa17b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 7 May 2019 17:10:46 +0200 Subject: WindowServer: Don't launch a terminal when clicking system menu separators. The menu item for launching a terminal was sharing ID's with the separators. --- Servers/WindowServer/WSWindowManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Servers') diff --git a/Servers/WindowServer/WSWindowManager.cpp b/Servers/WindowServer/WSWindowManager.cpp index e3728c29cf..957015f359 100644 --- a/Servers/WindowServer/WSWindowManager.cpp +++ b/Servers/WindowServer/WSWindowManager.cpp @@ -95,8 +95,8 @@ WSWindowManager::WSWindowManager() { byte system_menu_name[] = { 0xf8, 0 }; m_system_menu = make(nullptr, -1, String((const char*)system_menu_name)); - m_system_menu->add_item(make(*m_system_menu, 0, "Open Terminal...")); - m_system_menu->add_item(make(*m_system_menu, 1, "Open ProcessManager...")); + m_system_menu->add_item(make(*m_system_menu, 1, "Open Terminal...")); + m_system_menu->add_item(make(*m_system_menu, 2, "Open ProcessManager...")); m_system_menu->add_item(make(*m_system_menu, WSMenuItem::Separator)); m_system_menu->add_item(make(*m_system_menu, 100, "640x480")); m_system_menu->add_item(make(*m_system_menu, 101, "800x600")); @@ -107,14 +107,14 @@ WSWindowManager::WSWindowManager() m_system_menu->add_item(make(*m_system_menu, WSMenuItem::Separator)); m_system_menu->add_item(make(*m_system_menu, 200, "About...")); m_system_menu->on_item_activation = [this] (WSMenuItem& item) { - if (item.identifier() == 0) { + if (item.identifier() == 1) { if (fork() == 0) { execl("/bin/Terminal", "/bin/Terminal", nullptr); ASSERT_NOT_REACHED(); } return; } - if (item.identifier() == 1) { + if (item.identifier() == 2) { if (fork() == 0) { execl("/bin/ProcessManager", "/bin/ProcessManager", nullptr); ASSERT_NOT_REACHED(); -- cgit v1.2.3