diff --git a/CMakeLists.txt b/CMakeLists.txt index d041bed3eb..e386e88aa8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,7 +118,6 @@ set(kwin_KDEINIT_SRCS group.cpp bridge.cpp manage.cpp - notifications.cpp overlaywindow.cpp activation.cpp useractions.cpp diff --git a/activation.cpp b/activation.cpp index ef877953a4..d7b6608f08 100644 --- a/activation.cpp +++ b/activation.cpp @@ -40,7 +40,6 @@ along with this program. If not, see . #include #include -#include "notifications.h" #include "atoms.h" #include "group.h" #include "rules.h" diff --git a/client.cpp b/client.cpp index 06f6e36ad0..c9dcc22091 100644 --- a/client.cpp +++ b/client.cpp @@ -52,7 +52,6 @@ along with this program. If not, see . #include "focuschain.h" #include "workspace.h" #include "atoms.h" -#include "notifications.h" #include "rules.h" #include "shadow.h" #include "deleted.h" diff --git a/composite.cpp b/composite.cpp index 0cb8c9f3ee..f7d22fb017 100644 --- a/composite.cpp +++ b/composite.cpp @@ -50,6 +50,7 @@ along with this program. If not, see . #include #include #include +#include #include #include diff --git a/geometry.cpp b/geometry.cpp index 465cbe346e..419106ee78 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -37,7 +37,6 @@ along with this program. If not, see . #include #include "placement.h" -#include "notifications.h" #include "geometrytip.h" #include "rules.h" #include "screens.h" diff --git a/manage.cpp b/manage.cpp index ccfd774464..bef376503c 100644 --- a/manage.cpp +++ b/manage.cpp @@ -31,7 +31,6 @@ along with this program. If not, see . #include "activities.h" #endif #include "cursor.h" -#include "notifications.h" #include #include "rules.h" #include "group.h" diff --git a/notifications.cpp b/notifications.cpp deleted file mode 100644 index a8964d2e8e..0000000000 --- a/notifications.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 1999, 2000 Matthias Ettrich -Copyright (C) 2003 Lubos Lunak - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ - -#include "notifications.h" -#include - -#include "client.h" - -namespace KWin -{ - -static bool forgetIt = false; -QList< Notify::EventData > Notify::pending_events; - -bool Notify::raise(Event e, const QString& message, Client* c) -{ - if (forgetIt) - return false; // no connection was possible, don't try each time - - QString event; - KNotification::NotificationFlags flags = KNotification::CloseOnTimeout; - switch(e) { - case CompositingSuspendedDbus: - event = "compositingsuspendeddbus"; - break; - default: - break; - } - if (event.isNull()) - return false; - -// There may be a deadlock if KNotify event is sent while KWin has X grabbed. -// If KNotify is not running, KLauncher may do X requests (startup notification, whatever) -// that will block it. And KNotifyClient waits for the launch to succeed, which means -// KLauncher waits for X and KWin waits for KLauncher. So postpone events in such case. - if (grabbedXServer()) { - EventData data; - data.event = event; - data.message = message; - data.window = c ? c->window() : 0; - data.flags = flags; - pending_events.append(data); - return true; - } - - - return KNotification::event(event, message, QPixmap(), NULL /* TODO c ? c->window() : 0*/, flags); -} - -void Notify::sendPendingEvents() -{ - while (!pending_events.isEmpty()) { - EventData data = pending_events.first(); - pending_events.pop_front(); - if (!forgetIt) - KNotification::event(data.event, data.message, QPixmap(), NULL /* TODO data.window*/, data.flags); - } -} - -} // namespace diff --git a/notifications.h b/notifications.h deleted file mode 100644 index 0bd2a6f484..0000000000 --- a/notifications.h +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 1999, 2000 Matthias Ettrich -Copyright (C) 2003 Lubos Lunak - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ - -#ifndef KWIN_NOTIFICATIONS_H -#define KWIN_NOTIFICATIONS_H - -#include -#include -#include -#include - -namespace KWin -{ - -class Client; - -class Notify -{ -public: - - enum Event { - CompositingSuspendedDbus - }; - - static bool raise(Event, const QString& message = QString(), Client* c = NULL); - static void sendPendingEvents(); -private: - struct EventData { - QString event; - QString message; - long window; - KNotification::NotificationFlags flags; - }; - static QList< EventData > pending_events; -}; - -} // namespace - -#endif diff --git a/utils.cpp b/utils.cpp index 36626ba36f..b3c092d7a2 100644 --- a/utils.cpp +++ b/utils.cpp @@ -50,7 +50,6 @@ along with this program. If not, see . #include "atoms.h" #include "cursor.h" -#include "notifications.h" #include "workspace.h" #endif @@ -286,7 +285,6 @@ void ungrabXServer() if (--server_grab_count == 0) { XUngrabServer(display()); XFlush(display()); - Notify::sendPendingEvents(); } } diff --git a/workspace.cpp b/workspace.cpp index 1f1920b032..687fc593a2 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -55,7 +55,6 @@ along with this program. If not, see . #include "cursor.h" #include "killwindow.h" #include "placement.h" -#include "notifications.h" #include "outline.h" #include "group.h" #include "rules.h"