12 #include "notifications.h"
13 #include <knotifyclient.h>
17 namespace KWinInternal
20 TQString Notify::eventToName( Event e )
44 event =
"on_all_desktops";
46 case NotOnAllDesktops:
47 event =
"not_on_all_desktops";
59 event =
"transdelete";
74 event =
"resizestart";
79 case DemandAttentionCurrent:
80 event =
"demandsattentioncurrent";
82 case DemandAttentionOther:
83 event =
"demandsattentionother";
86 if ((e > DesktopChange) && (e <= DesktopChange+20))
88 event = TQString(
"desktop%1").arg(e-DesktopChange);
95 static bool forgetIt = FALSE;
96 TQValueList< Notify::EventData > Notify::pending_events;
98 bool Notify::raise( Event e,
const TQString& message, Client* c )
103 TQString
event = eventToName( e );
111 if( grabbedXServer())
115 data.message = message;
116 data.window = c ? c->window() : 0;
117 pending_events.append( data );
121 forgetIt= !KNotifyClient::event( c ? c->window() : 0, event, message );
125 void Notify::sendPendingEvents()
127 while( !pending_events.isEmpty())
129 EventData data = pending_events.first();
130 pending_events.pop_front();
132 forgetIt= !KNotifyClient::event( data.window, data.event, data.message );
136 bool Notify::makeDemandAttention( Event e )
138 TQString
event = eventToName( e );
141 int rep = KNotifyClient::getPresentation( event );
143 rep = KNotifyClient::getDefaultPresentation( event );
144 return rep != -1 && ( rep & KNotifyClient::Taskbar );