Skip to content

Commit

Permalink
MenuApplets: Use pledge()
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Jan 11, 2020
1 parent 457c7d9 commit 7b6b1ba
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions MenuApplets/Audio/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,18 @@ class AudioWidget final : public GWidget {

int main(int argc, char** argv)
{
if (pledge("stdio shared_buffer rpath unix cpath fattr", nullptr) < 0) {
perror("pledge");
return 1;
}

GApplication app(argc, argv);

if (pledge("stdio shared_buffer rpath unix", nullptr) < 0) {
perror("pledge");
return 1;
}

auto window = GWindow::construct();
window->set_has_alpha_channel(true);
window->set_window_type(GWindowType::MenuApplet);
Expand Down
11 changes: 11 additions & 0 deletions MenuApplets/CPUGraph/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <LibGUI/GPainter.h>
#include <LibGUI/GWidget.h>
#include <LibGUI/GWindow.h>
#include <stdio.h>

class GraphWidget final : public GWidget {
C_OBJECT(GraphWidget)
Expand Down Expand Up @@ -71,8 +72,18 @@ class GraphWidget final : public GWidget {

int main(int argc, char** argv)
{
if (pledge("stdio shared_buffer rpath unix cpath fattr", nullptr) < 0) {
perror("pledge");
return 1;
}

GApplication app(argc, argv);

if (pledge("stdio shared_buffer rpath unix", nullptr) < 0) {
perror("pledge");
return 1;
}

auto window = GWindow::construct();
window->set_window_type(GWindowType::MenuApplet);
window->resize(30, 16);
Expand Down
11 changes: 11 additions & 0 deletions MenuApplets/Clock/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <LibGUI/GPainter.h>
#include <LibGUI/GWidget.h>
#include <LibGUI/GWindow.h>
#include <stdio.h>
#include <time.h>

class ClockWidget final : public GWidget {
Expand Down Expand Up @@ -63,8 +64,18 @@ class ClockWidget final : public GWidget {

int main(int argc, char** argv)
{
if (pledge("stdio shared_buffer rpath unix cpath fattr", nullptr) < 0) {
perror("pledge");
return 1;
}

GApplication app(argc, argv);

if (pledge("stdio shared_buffer rpath unix", nullptr) < 0) {
perror("pledge");
return 1;
}

auto window = GWindow::construct();
window->set_window_type(GWindowType::MenuApplet);

Expand Down

0 comments on commit 7b6b1ba

Please sign in to comment.