panel: show logout dialog in a thread (temporary)
This commit is contained in:
parent
62128bd1aa
commit
a174aa1b66
16
apps/panel.c
16
apps/panel.c
@ -19,6 +19,7 @@
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <dirent.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/wait.h>
|
||||
@ -832,14 +833,21 @@ static void redraw_alttab(void) {
|
||||
yutani_flip(yctx, alttab);
|
||||
}
|
||||
|
||||
static void launch_application_menu(struct MenuEntry * self) {
|
||||
struct MenuEntry_Normal * _self = (void *)self;
|
||||
|
||||
if (!strcmp((char *)_self->action,"log-out")) {
|
||||
static pthread_t _waiter_thread;
|
||||
static void * logout_prompt_waiter(void * arg) {
|
||||
if (system("showdialog \"Log Out\" /usr/share/icons/48/exit.png \"Are you sure you want to log out?\"") == 0) {
|
||||
yutani_session_end(yctx);
|
||||
_continue = 0;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void launch_application_menu(struct MenuEntry * self) {
|
||||
struct MenuEntry_Normal * _self = (void *)self;
|
||||
|
||||
if (!strcmp((char *)_self->action,"log-out")) {
|
||||
/* Spin off a thread for this */
|
||||
pthread_create(&_waiter_thread, NULL, logout_prompt_waiter, NULL);
|
||||
} else {
|
||||
launch_application((char *)_self->action);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user