summaryrefslogtreecommitdiff
path: root/src/decorator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/decorator.cpp')
-rw-r--r--src/decorator.cpp84
1 files changed, 83 insertions, 1 deletions
diff --git a/src/decorator.cpp b/src/decorator.cpp
index 8da5808..535684e 100644
--- a/src/decorator.cpp
+++ b/src/decorator.cpp
@@ -27,12 +27,14 @@
#include <qglobal.h>
+#include <dcopclient.h>
#include <kcmdlineargs.h>
#include <kconfig.h>
#include <kdebug.h>
#include <kglobal.h>
#include <kwinmodule.h>
#include <klocale.h>
+#include <kwin.h>
#include <qpoint.h>
@@ -106,7 +108,9 @@ m_kwinmodule (new KWinModule (this, KWinModule::INFO_ALL)), m_switcher (0)
{
// delete KGlobal::_locale;
// KGlobal::_locale = new KLocale( "kwin" , NULL );
- KGlobal::locale()->insertCatalogue("kwin");
+// KGlobal::locale()->insertCatalogue("aquamarine");
+ KGlobal::locale()->insertCatalogue("kdelibs");
+ KGlobal::locale()->setActiveCatalogue("aquamarine");
ready = false;
m_restart = false;
@@ -186,6 +190,12 @@ m_kwinmodule (new KWinModule (this, KWinModule::INFO_ALL)), m_switcher (0)
}
connect( this, SIGNAL(appearanceChanged()), SLOT(reconfigure()) );
+
+ (void) QApplication::desktop (); // trigger creation of desktop widget
+
+ // select for client messages
+ XSelectInput (qt_xdisplay(), qt_xrootwin (),
+ StructureNotifyMask | PropertyChangeMask);
}
Aquamarine::Decorator::~Decorator ()
@@ -362,6 +372,63 @@ Aquamarine::Decorator::x11EventFilter (XEvent * xevent)
client->updateCursor (QPoint (xme->x, xme->y));
break;
}
+ case ClientMessage:
+ if (xevent->xclient.message_type == Atoms::toolkitActionAtom)
+ {
+ long action;
+
+ action = xevent->xclient.data.l[0];
+ if ((Atom)action == Atoms::toolkitActionWindowMenuAtom)
+ {
+ if (m_windows.contains (xevent->xclient.window))
+ {
+ QPoint pos;
+
+ Aquamarine::Window * client = m_windows[xevent->xclient.window];
+
+ if (xevent->xclient.data.l[2])
+ {
+ pos = QPoint (xevent->xclient.data.l[3],
+ xevent->xclient.data.l[4]);
+ }
+ else
+ {
+ pos = client->geometry ().topLeft ();
+ }
+
+ client->showWindowMenu (pos);
+ }
+ }
+ else if ((Atom)action == Atoms::toolkitActionMainMenuAtom)
+ {
+ dcopClient ()->send ("kicker",
+ "kicker",
+ "showKMenu()",
+ QByteArray ());
+ }
+ else if ((Atom)action == Atoms::toolkitActionRunDialogAtom)
+ {
+ dcopClient ()->send ("kdesktop",
+ "KDesktopIface",
+ "popupExecuteCommand()",
+ QByteArray ());
+ }
+ else if ((Atom)action == Atoms::toolkitActionForceQuitDialogAtom)
+ {
+ if (m_windows.contains (xevent->xclient.window))
+ {
+ Time timestamp = xevent->xclient.data.l[1];
+
+ Aquamarine::Window * client = m_windows[xevent->xclient.window];
+
+ if (xevent->xclient.data.l[2])
+ client->showKillProcessDialog (timestamp);
+ else
+ client->hideKillProcessDialog ();
+ }
+ }
+ }
+ break;
default:
break;
}
@@ -484,6 +551,21 @@ Aquamarine::Decorator::slotWindowAdded (WId id)
}
}
+ KWin::WindowInfo wInfo = KWin::windowInfo (id, NET::WMWindowType, 0);
+
+ switch (wInfo.windowType (~0)) {
+ case NET::Normal:
+ case NET::Dialog:
+ case NET::Toolbar:
+ case NET::Menu:
+ case NET::Utility:
+ case NET::Splash:
+ /* decorate these window types */
+ break;
+ default:
+ return;
+ }
+
if (frame)
{
if (!m_windows.contains (id))