mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
Welcome: Add pledge and unveil
This commit is contained in:
parent
37daae1451
commit
7caa8b7531
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
Add a link
Reference in a new issue