not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / kcontrol / randr / krandrapp.cpp
blob4d21c824d32f372d63f6ea5b4a944dd46b06d4da
1 /*
2 * Copyright (c) 2007 Gustavo Pichorim Boiko <gustavo.boiko@kdemail.net>
3 * Copyright (c) 2002,2003 Hamish Rodda <rodda@kde.org>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #include <kdebug.h>
22 #include <config-randr.h>
23 #include "krandrapp.h"
24 #include "krandrapp.moc"
26 #include "randrconfig.h"
27 #include "krandrtray.h"
29 #ifdef HAS_RANDR_1_2
30 #include "randrscreen.h"
31 #endif
32 #include "legacyrandrscreen.h"
33 #include <X11/Xlib.h>
35 KRandRApp::KRandRApp()
37 m_display = new RandRDisplay();
38 m_tray = new KRandRSystemTray(m_display);
40 m_tray->show();
41 m_tray->setObjectName("RANDRTray");
43 // do not close when the last window is closed:
44 // the system tray is not considered a window, so when the confirm dialog is
45 // closed, the application exits
46 setQuitOnLastWindowClosed(false);
49 bool KRandRApp::x11EventFilter(XEvent* e)
52 if (m_display->canHandle(e))
53 m_display->handleEvent(e);
55 return KApplication::x11EventFilter(e);