mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
Taskbar: chdir to home directory before launching apps
This commit is contained in:
parent
e2b7e7c390
commit
c18f12bb96
Notes:
sideshowbarker
2024-07-19 08:15:55 +09:00
Author: https://github.com/itamar8910
Commit: c18f12bb96
Pull-request: https://github.com/SerenityOS/serenity/pull/1477
Reviewed-by: https://github.com/bugaevc
1 changed files with 5 additions and 0 deletions
|
@ -28,6 +28,7 @@
|
|||
#include "TaskbarButton.h"
|
||||
#include <AK/SharedBuffer.h>
|
||||
#include <LibCore/ConfigFile.h>
|
||||
#include <LibCore/UserInfo.h>
|
||||
#include <LibGUI/BoxLayout.h>
|
||||
#include <LibGUI/Button.h>
|
||||
#include <LibGUI/Desktop.h>
|
||||
|
@ -105,6 +106,10 @@ void TaskbarWindow::create_quick_launch_bar()
|
|||
if (pid < 0) {
|
||||
perror("fork");
|
||||
} else if (pid == 0) {
|
||||
if (chdir(get_current_user_home_path().characters()) < 0) {
|
||||
perror("chdir");
|
||||
exit(1);
|
||||
}
|
||||
execl(app_executable.characters(), app_executable.characters(), nullptr);
|
||||
perror("execl");
|
||||
ASSERT_NOT_REACHED();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue