summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-11-11 13:11:31 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-11-11 13:13:08 +0100
commitdd2900eda05b7ca6c9fc0c7f1840acdf795cf1b3 (patch)
treee218c9a1bbb7cef9a845681d418ffec9f5ba8802
parent26f41c7ecbb01b752273103b3d73f29976682dd8 (diff)
downloadserenity-dd2900eda05b7ca6c9fc0c7f1840acdf795cf1b3.zip
Launcher: Remove the Launcher app, and all hacks in support of it
The Launcher's functionality has been replaced by the app shortcuts in the system menu. There were various window management hacks to ensure that the launcher stayed below all other windows while also being movable, etc.
-rw-r--r--Applications/Launcher/Makefile8
-rw-r--r--Applications/Launcher/main.cpp94
-rw-r--r--Base/home/anon/Launcher.ini46
-rwxr-xr-xKernel/build-root-filesystem.sh1
-rwxr-xr-xKernel/makeall.sh1
-rw-r--r--Libraries/LibGUI/GWindowType.h1
-rw-r--r--Servers/WindowServer/WSAPITypes.h1
-rw-r--r--Servers/WindowServer/WSClientConnection.cpp3
-rw-r--r--Servers/WindowServer/WSWindow.cpp2
-rw-r--r--Servers/WindowServer/WSWindow.h2
-rw-r--r--Servers/WindowServer/WSWindowManager.h6
-rw-r--r--Servers/WindowServer/WSWindowType.h1
12 files changed, 2 insertions, 164 deletions
diff --git a/Applications/Launcher/Makefile b/Applications/Launcher/Makefile
deleted file mode 100644
index 58d00627ee..0000000000
--- a/Applications/Launcher/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-include ../../Makefile.common
-
-OBJS = \
- main.o
-
-APP = Launcher
-
-include ../Makefile.common
diff --git a/Applications/Launcher/main.cpp b/Applications/Launcher/main.cpp
deleted file mode 100644
index 251b8ee701..0000000000
--- a/Applications/Launcher/main.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-#include <LibCore/CConfigFile.h>
-#include <LibCore/CUserInfo.h>
-#include <LibGUI/GApplication.h>
-#include <LibGUI/GBoxLayout.h>
-#include <LibGUI/GButton.h>
-#include <LibGUI/GWidget.h>
-#include <LibGUI/GWindow.h>
-#include <LibDraw/GraphicsBitmap.h>
-#include <errno.h>
-#include <signal.h>
-#include <stdio.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-static RefPtr<GWindow> make_launcher_window();
-
-void handle_sigchld(int)
-{
- dbgprintf("Launcher(%d) Got SIGCHLD\n", getpid());
- int pid = waitpid(-1, nullptr, 0);
- dbgprintf("Launcher(%d) waitpid() returned %d\n", getpid(), pid);
- ASSERT(pid > 0);
-}
-
-int main(int argc, char** argv)
-{
- if (chdir(get_current_user_home_path().characters()) < 0)
- perror("chdir");
-
- GApplication app(argc, argv);
-
- signal(SIGCHLD, handle_sigchld);
-
- auto launcher_window = make_launcher_window();
- launcher_window->show();
-
- return app.exec();
-}
-
-class LauncherButton final : public GButton {
-public:
- LauncherButton(const String& name, const String& icon_path, const String& exec_path, GWidget* parent)
- : GButton(parent)
- , m_executable_path(exec_path)
- {
- set_tooltip(name);
- set_button_style(ButtonStyle::CoolBar);
- set_icon(GraphicsBitmap::load_from_file(icon_path));
- set_preferred_size(50, 50);
- set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed);
- on_click = [this](GButton&) {
- pid_t child_pid = fork();
- if (!child_pid) {
- int rc = execl(m_executable_path.characters(), m_executable_path.characters(), nullptr);
- if (rc < 0)
- perror("execl");
- }
- };
- }
- virtual ~LauncherButton() {}
-
-private:
- String m_executable_path;
-};
-
-RefPtr<GWindow> make_launcher_window()
-{
- auto config = CConfigFile::get_for_app("Launcher");
- auto vertical = config->read_bool_entry("Launcher", "Vertical", true);
-
- auto window = GWindow::construct();
- window->set_title("Launcher");
- int launcher_size = (config->groups().size() - 1) * 50;
- window->set_rect(50, 50, vertical ? 50 : launcher_size, vertical ? launcher_size : 50);
- window->set_show_titlebar(false);
- window->set_window_type(GWindowType::Launcher);
-
- auto widget = GWidget::construct();
- widget->set_fill_with_background_color(true);
- widget->set_layout(make<GBoxLayout>(vertical ? Orientation::Vertical : Orientation::Horizontal));
- widget->layout()->set_spacing(0);
- widget->layout()->set_margins({ 5, 0, 5, 0 });
- window->set_main_widget(widget);
-
- for (auto& group : config->groups()) {
- if (group != "Launcher")
- new LauncherButton(config->read_entry(group, "Name", group),
- config->read_entry(group, "Icon", ""),
- config->read_entry(group, "Path", ""),
- widget);
- }
-
- return window;
-}
diff --git a/Base/home/anon/Launcher.ini b/Base/home/anon/Launcher.ini
deleted file mode 100644
index c57fd34ec0..0000000000
--- a/Base/home/anon/Launcher.ini
+++ /dev/null
@@ -1,46 +0,0 @@
-[Launcher]
-Vertical=1
-
-[Terminal]
-Path=/bin/Terminal
-Icon=/res/icons/32x32/app-terminal.png
-
-[TextEditor]
-Path=/bin/TextEditor
-Icon=/res/icons/32x32/app-texteditor.png
-
-[VisualBuilder]
-Path=/bin/VisualBuilder
-Icon=/res/icons/32x32/app-visual-builder.png
-
-[IRCClient]
-Path=/bin/IRCClient
-Icon=/res/icons/32x32/app-irc-client.png
-
-[FileManager]
-Path=/bin/FileManager
-Icon=/res/icons/32x32/filetype-folder.png
-
-[Minesweeper]
-Path=/bin/Minesweeper
-Icon=/res/icons/32x32/app-minesweeper.png
-
-[Snake]
-Path=/bin/Snake
-Icon=/res/icons/32x32/app-snake.png
-
-[SystemMonitor]
-Path=/bin/SystemMonitor
-Icon=/res/icons/32x32/app-system-monitor.png
-
-[PaintBrush]
-Path=/bin/PaintBrush
-Icon=/res/icons/32x32/app-paintbrush.png
-
-[Piano]
-Path=/bin/Piano
-Icon=/res/icons/32x32/app-piano.png
-
-[ChanViewer]
-Path=/bin/ChanViewer
-Icon=/res/icons/32x32/app-chanviewer.png
diff --git a/Kernel/build-root-filesystem.sh b/Kernel/build-root-filesystem.sh
index 6c42abed54..b8f6e8081a 100755
--- a/Kernel/build-root-filesystem.sh
+++ b/Kernel/build-root-filesystem.sh
@@ -76,7 +76,6 @@ cp ../Applications/Downloader/Downloader mnt/bin/Downloader
cp ../Applications/FileManager/FileManager mnt/bin/FileManager
cp ../Applications/FontEditor/FontEditor mnt/bin/FontEditor
cp ../Applications/IRCClient/IRCClient mnt/bin/IRCClient
-cp ../Applications/Launcher/Launcher mnt/bin/Launcher
cp ../Applications/SystemMonitor/SystemMonitor mnt/bin/SystemMonitor
cp ../Applications/Taskbar/Taskbar mnt/bin/Taskbar
cp ../Applications/Terminal/Terminal mnt/bin/Terminal
diff --git a/Kernel/makeall.sh b/Kernel/makeall.sh
index 69c4cf8b35..5e40c72608 100755
--- a/Kernel/makeall.sh
+++ b/Kernel/makeall.sh
@@ -48,7 +48,6 @@ build_targets="$build_targets ../Applications/Downloader"
build_targets="$build_targets ../Applications/FileManager"
build_targets="$build_targets ../Applications/FontEditor"
build_targets="$build_targets ../Applications/IRCClient"
-build_targets="$build_targets ../Applications/Launcher"
build_targets="$build_targets ../Applications/PaintBrush"
build_targets="$build_targets ../Applications/Piano"
build_targets="$build_targets ../Applications/QuickShow"
diff --git a/Libraries/LibGUI/GWindowType.h b/Libraries/LibGUI/GWindowType.h
index 04985b230d..0bdb3d46d3 100644
--- a/Libraries/LibGUI/GWindowType.h
+++ b/Libraries/LibGUI/GWindowType.h
@@ -9,5 +9,4 @@ enum class GWindowType {
Taskbar,
Tooltip,
Menubar,
- Launcher,
};
diff --git a/Servers/WindowServer/WSAPITypes.h b/Servers/WindowServer/WSAPITypes.h
index bdb14ebf84..75597fcaf1 100644
--- a/Servers/WindowServer/WSAPITypes.h
+++ b/Servers/WindowServer/WSAPITypes.h
@@ -28,7 +28,6 @@ enum WSAPI_WindowType {
Taskbar,
Tooltip,
Menubar,
- Launcher,
};
struct WSAPI_WindowBackingStoreInfo {
diff --git a/Servers/WindowServer/WSClientConnection.cpp b/Servers/WindowServer/WSClientConnection.cpp
index 0bdb24d1d8..fe0a28bc9e 100644
--- a/Servers/WindowServer/WSClientConnection.cpp
+++ b/Servers/WindowServer/WSClientConnection.cpp
@@ -215,9 +215,6 @@ bool WSClientConnection::handle_message(const WSAPI_ClientMessage& message, cons
case WSAPI_WindowType::Menubar:
ws_window_type = WSWindowType::Menubar;
break;
- case WSAPI_WindowType::Launcher:
- ws_window_type = WSWindowType::Launcher;
- break;
case WSAPI_WindowType::Invalid:
default:
dbgprintf("Unknown WSAPI_WindowType: %d\n", message.window.type);
diff --git a/Servers/WindowServer/WSWindow.cpp b/Servers/WindowServer/WSWindow.cpp
index a15232fbd1..debd983f83 100644
--- a/Servers/WindowServer/WSWindow.cpp
+++ b/Servers/WindowServer/WSWindow.cpp
@@ -140,8 +140,6 @@ static WSAPI_WindowType to_api(WSWindowType ws_type)
return WSAPI_WindowType::Tooltip;
case WSWindowType::Menubar:
return WSAPI_WindowType::Menubar;
- case WSWindowType::Launcher:
- return WSAPI_WindowType::Launcher;
default:
ASSERT_NOT_REACHED();
}
diff --git a/Servers/WindowServer/WSWindow.h b/Servers/WindowServer/WSWindow.h
index 9ed46b07d4..a77aba5d1c 100644
--- a/Servers/WindowServer/WSWindow.h
+++ b/Servers/WindowServer/WSWindow.h
@@ -45,7 +45,7 @@ public:
bool is_movable() const
{
- return m_type == WSWindowType::Normal || m_type == WSWindowType::Launcher;
+ return m_type == WSWindowType::Normal;
}
WSWindowFrame& frame() { return m_frame; }
diff --git a/Servers/WindowServer/WSWindowManager.h b/Servers/WindowServer/WSWindowManager.h
index e7d86a1102..64063a8907 100644
--- a/Servers/WindowServer/WSWindowManager.h
+++ b/Servers/WindowServer/WSWindowManager.h
@@ -299,8 +299,6 @@ IterationDecision WSWindowManager::for_each_visible_window_of_type_from_back_to_
template<typename Callback>
IterationDecision WSWindowManager::for_each_visible_window_from_back_to_front(Callback callback)
{
- if (for_each_visible_window_of_type_from_back_to_front(WSWindowType::Launcher, callback) == IterationDecision::Break)
- return IterationDecision::Break;
if (for_each_visible_window_of_type_from_back_to_front(WSWindowType::Normal, callback) == IterationDecision::Break)
return IterationDecision::Break;
if (for_each_visible_window_of_type_from_back_to_front(WSWindowType::Taskbar, callback) == IterationDecision::Break)
@@ -350,9 +348,7 @@ IterationDecision WSWindowManager::for_each_visible_window_from_front_to_back(Ca
return IterationDecision::Break;
if (for_each_visible_window_of_type_from_front_to_back(WSWindowType::Tooltip, callback) == IterationDecision::Break)
return IterationDecision::Break;
- if (for_each_visible_window_of_type_from_front_to_back(WSWindowType::Normal, callback) == IterationDecision::Break)
- return IterationDecision::Break;
- return for_each_visible_window_of_type_from_front_to_back(WSWindowType::Launcher, callback);
+ return for_each_visible_window_of_type_from_front_to_back(WSWindowType::Normal, callback);
}
template<typename Callback>
diff --git a/Servers/WindowServer/WSWindowType.h b/Servers/WindowServer/WSWindowType.h
index 8080d41774..2d853a014c 100644
--- a/Servers/WindowServer/WSWindowType.h
+++ b/Servers/WindowServer/WSWindowType.h
@@ -9,5 +9,4 @@ enum class WSWindowType {
Taskbar,
Tooltip,
Menubar,
- Launcher,
};