mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Added shutdown dbus signal that will be broadcasted when EDE starts to shut down
so apps (but not X11 related) could quit nicely. Primarly intended for services, like emountd
This commit is contained in:
parent
555433bfeb
commit
7032f57bb8
@ -21,6 +21,8 @@
|
||||
#include <edelib/MessageBox.h>
|
||||
#include <edelib/Nls.h>
|
||||
#include <edelib/Run.h>
|
||||
#include <edelib/EdbusMessage.h>
|
||||
#include <edelib/EdbusConnection.h>
|
||||
|
||||
#include "EvokeService.h"
|
||||
#include "Splash.h"
|
||||
@ -30,6 +32,9 @@
|
||||
|
||||
EDELIB_NS_USING(Config)
|
||||
EDELIB_NS_USING(Resource)
|
||||
EDELIB_NS_USING(EdbusMessage)
|
||||
EDELIB_NS_USING(EdbusConnection)
|
||||
EDELIB_NS_USING(EDBUS_SESSION)
|
||||
EDELIB_NS_USING(RES_SYS_ONLY)
|
||||
EDELIB_NS_USING(file_exists)
|
||||
EDELIB_NS_USING(file_remove)
|
||||
@ -61,6 +66,16 @@ static int get_int_property_value(Atom at) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void send_dbus_ede_quit(void) {
|
||||
EdbusConnection c;
|
||||
E_RETURN_IF_FAIL(c.connect(EDBUS_SESSION));
|
||||
|
||||
EdbusMessage msg;
|
||||
msg.create_signal("/org/equinoxproject/Shutdown", "org.equinoxproject.Shutdown", "Shutdown");
|
||||
|
||||
c.send(msg);
|
||||
}
|
||||
|
||||
EvokeService::EvokeService() : lock_name(NULL), xsm(NULL), is_running(false) {
|
||||
/* TODO: or add setup_atoms() function */
|
||||
XA_EDE_EVOKE_SHUTDOWN_ALL = XInternAtom(fl_display, "_EDE_EVOKE_SHUTDOWN_ALL", False);
|
||||
@ -223,6 +238,7 @@ int EvokeService::handle(const XEvent* xev) {
|
||||
|
||||
int ret = logout_dialog_show(dw, dh, LOGOUT_OPT_SHUTDOWN | LOGOUT_OPT_RESTART);
|
||||
if(ret != -1) {
|
||||
send_dbus_ede_quit();
|
||||
x_shutdown();
|
||||
stop();
|
||||
}
|
||||
|
@ -10,9 +10,6 @@
|
||||
|
||||
SubDir TOP evoke ;
|
||||
|
||||
# use SIGHUP for now as default
|
||||
ObjectC++Flags evoke.cpp : -DUSE_SIGHUP ;
|
||||
|
||||
SOURCE = evoke.cpp
|
||||
EvokeService.cpp
|
||||
Splash.cpp
|
||||
@ -26,6 +23,12 @@ CONFIG = ede-settings.conf
|
||||
|
||||
#ObjectC++Flags $(SOURCE) : -DUSE_LOCAL_CONFIG ;
|
||||
|
||||
# use SIGHUP for now as default
|
||||
ObjectC++Flags evoke.cpp : -DUSE_SIGHUP ;
|
||||
|
||||
ObjectC++Flags EvokeService.cpp : $(EDELIB_DBUS_INCLUDE) ;
|
||||
LinkAgainstAsFirst evoke : $(EDELIB_DBUS_LIB) ;
|
||||
|
||||
EdeProgram evoke : $(SOURCE) ;
|
||||
ProgramBare ede-shutdown : ede-shutdown.cpp ;
|
||||
LinkAgainst ede-shutdown : -lX11 ;
|
||||
|
Loading…
Reference in New Issue
Block a user