Make logout a lot more reliable and stable.
[ci skip]
This commit is contained in:
parent
08f6a66e6a
commit
d2fff11244
@ -97,12 +97,9 @@ int buffer_put(char c) {
|
||||
return 0;
|
||||
}
|
||||
input_buffer[input_collected] = c;
|
||||
if (input_buffer[input_collected] == '\n') {
|
||||
input_collected++;
|
||||
return 1;
|
||||
}
|
||||
input_collected++;
|
||||
if (input_collected == INPUT_SIZE) {
|
||||
input_buffer[input_collected] = '\0';
|
||||
if (input_collected == INPUT_SIZE - 1) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@ -140,6 +137,7 @@ int main (int argc, char ** argv) {
|
||||
/* Do something with a window */
|
||||
window_t * wina = window_create(0,0, width, height);
|
||||
assert(wina);
|
||||
window_reorder (wina, 0); /* Disables movement */
|
||||
ctx = init_graphics_window_double_buffer(wina);
|
||||
draw_gradient();
|
||||
flip(ctx);
|
||||
|
@ -18,13 +18,13 @@ int main(int argc, char * argv[]) {
|
||||
}
|
||||
int _terminal_pid = fork();
|
||||
if (!_terminal_pid) {
|
||||
char * args[] = {"/bin/terminal", NULL};
|
||||
char * args[] = {"/bin/terminal", "--kerne", NULL};
|
||||
execve(args[0], args, NULL);
|
||||
}
|
||||
|
||||
syscall_wait(_terminal_pid);
|
||||
|
||||
printf("Terminal has exited. Sending kill signals to %d and %d.\n", _wallpaper_pid, _panel_pid);
|
||||
printf("Terminal has exited. Sending INT signals to %d and %d.\n", _wallpaper_pid, _panel_pid);
|
||||
|
||||
syscall_send_signal(_wallpaper_pid, 2);
|
||||
syscall_send_signal(_panel_pid, 2);
|
||||
|
@ -173,6 +173,13 @@ void _loadVlgothic() {
|
||||
error = FT_Set_Pixel_Sizes(face_extra, FONT_SIZE, FONT_SIZE);
|
||||
}
|
||||
|
||||
volatile int _continue = 1;
|
||||
|
||||
void sig_int(int sig) {
|
||||
printf("Received shutdown signal in panel!\n");
|
||||
_continue = 0;
|
||||
}
|
||||
|
||||
int main (int argc, char ** argv) {
|
||||
setup_windowing();
|
||||
|
||||
@ -245,7 +252,9 @@ int main (int argc, char ** argv) {
|
||||
}
|
||||
o = 0;
|
||||
|
||||
while (1) {
|
||||
syscall_signal(2, sig_int);
|
||||
|
||||
while (_continue) {
|
||||
/* Redraw the background by memcpy (super speedy) */
|
||||
memcpy(ctx->backbuffer, buf, buf_size);
|
||||
syscall_gettimeofday(&now, NULL); //time(NULL);
|
||||
@ -262,7 +271,6 @@ int main (int argc, char ** argv) {
|
||||
}
|
||||
}
|
||||
|
||||
//window_destroy(window); // (will close on exit)
|
||||
teardown_windowing();
|
||||
|
||||
return 0;
|
||||
|
@ -25,6 +25,13 @@ int center_y(int y) {
|
||||
return (win_height - y) / 2;
|
||||
}
|
||||
|
||||
volatile int _continue = 1;
|
||||
|
||||
void sig_int(int sig) {
|
||||
printf("Received shutdown signal in wallpaper!\n");
|
||||
_continue = 0;
|
||||
}
|
||||
|
||||
int main (int argc, char ** argv) {
|
||||
setup_windowing();
|
||||
|
||||
@ -42,6 +49,8 @@ int main (int argc, char ** argv) {
|
||||
draw_fill(ctx, rgb(127,127,127));
|
||||
flip(ctx);
|
||||
|
||||
syscall_signal(2, sig_int);
|
||||
|
||||
sprites[0] = malloc(sizeof(sprite_t));
|
||||
if (load_sprite_png(sprites[0], "/usr/share/wallpaper.png")) {
|
||||
return 0;
|
||||
@ -50,7 +59,7 @@ int main (int argc, char ** argv) {
|
||||
|
||||
flip(ctx);
|
||||
|
||||
while (1) {
|
||||
while (_continue) {
|
||||
syscall_yield();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user