mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 10:12:25 -05:00
Welcome: Add pledge and unveil
This commit is contained in:
parent
37daae1451
commit
7caa8b7531
Notes:
sideshowbarker
2024-07-19 17:41:20 +09:00
Author: https://github.com/thatlittlegit Commit: https://github.com/SerenityOS/serenity/commit/7caa8b75311 Pull-request: https://github.com/SerenityOS/serenity/pull/1221 Reviewed-by: https://github.com/shannonbooth
1 changed files with 18 additions and 0 deletions
|
@ -34,6 +34,8 @@
|
|||
#include <LibGUI/StackWidget.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Font.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "BackgroundWidget.h"
|
||||
#include "TextWidget.h"
|
||||
|
@ -85,8 +87,24 @@ int main(int argc, char** argv)
|
|||
},
|
||||
};
|
||||
|
||||
if (pledge("stdio shared_buffer rpath unix cpath fattr", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
GUI::Application app(argc, argv);
|
||||
|
||||
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unveil("/res/fonts", "r") < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
unveil(nullptr, nullptr);
|
||||
|
||||
auto window = GUI::Window::construct();
|
||||
window->set_title("Welcome to Serenity");
|
||||
Gfx::Rect window_rect { 0, 0, 640, 360 };
|
||||
|
|
Loading…
Add table
Reference in a new issue