[kwin-wayland] Add signal handler also to main_wayland

REVIEW: 119760
This commit is contained in:
Martin Gräßlin 2014-08-13 13:13:44 +02:00
parent 65c17d32cc
commit 12c8facc34

View file

@ -39,6 +39,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace KWin
{
static void sighandler(int)
{
QApplication::exit();
}
//************************************
// ApplicationWayland
//************************************
@ -207,6 +212,13 @@ KWIN_EXPORT int kdemain(int argc, char * argv[])
// TODO: ensure it's not xcb once we support the Wayland QPA
setenv("QT_QPA_PLATFORM", "xcb", true);
if (signal(SIGTERM, KWin::sighandler) == SIG_IGN)
signal(SIGTERM, SIG_IGN);
if (signal(SIGINT, KWin::sighandler) == SIG_IGN)
signal(SIGINT, SIG_IGN);
if (signal(SIGHUP, KWin::sighandler) == SIG_IGN)
signal(SIGHUP, SIG_IGN);
KWin::ApplicationWayland a(argc, argv);
a.setupTranslator();