26 #include <kiconloader.h>
28 #include <kwindowsystem.h>
29 #include <kmessagebox.h>
32 #include <q3dragobject.h>
34 #include <qstringlist.h>
46 while (m_Wins.isEmpty())
47 delete m_Wins.takeFirst();
53 return (
int) kwin_module->systemTrayWindows().size();
59 setPaletteBackgroundPixmap(pixmap);
60 for (emb = m_Wins.first(); emb != 0L; emb = m_Wins.next()) {
64 QPixmap bug = QPixmap(emb->size());
65 bitBlt(&bug, 0, 0, &pixmap, emb->parentWidget()->x() + emb->x(), emb->parentWidget()->y() + emb->y(), emb->width(), emb->height(), Qt::CopyROP,
false);
66 emb->setPaletteBackgroundPixmap(bug);
70 QPoint topPoint = mapToGlobal(QPoint(0, 0));
71 Window hack = XCreateSimpleWindow(qt_xdisplay(), winId(), 0, 0, width(), height(), 0, 0, 0);
72 XRaiseWindow(qt_xdisplay(), hack);
73 XMapWindow(qt_xdisplay(), hack);
74 XUnmapWindow(qt_xdisplay(), hack);
75 XDestroyWindow(qt_xdisplay(), hack);
80 bool existing =
false;
82 Display *display = qt_xdisplay();
83 no_of_systray_windows = 0;
85 kwin_module =
new KWinModule();
86 systemTrayWindows = kwin_module->systemTrayWindows();
87 Q3ValueList<WId>::ConstIterator end(systemTrayWindows.end());
88 for (Q3ValueList<WId>::ConstIterator it = systemTrayWindows.begin(); it != end; ++it) {
89 no_of_systray_windows++;
92 emb =
new QXEmbed(
this);
93 emb->setBackgroundMode(FixedPixmap);
95 emb->setAutoDelete(
false);
113 screenstr.setNum(qt_xscreen());
114 Q3CString trayatom =
"_NET_SYSTEM_TRAY_S" + screenstr;
116 net_system_tray_selection = XInternAtom(display, trayatom,
false);
117 net_system_tray_opcode = XInternAtom(display,
"_NET_SYSTEM_TRAY_OPCODE",
false);
120 XSetSelectionOwner(display,
121 net_system_tray_selection,
125 WId root = qt_xrootwin();
127 if (XGetSelectionOwner(display, net_system_tray_selection) == winId()) {
128 XClientMessageEvent xev;
130 xev.type = ClientMessage;
133 xev.message_type = XInternAtom(display,
"MANAGER",
false);
136 xev.data.l[0] = CurrentTime;
137 xev.data.l[1] = net_system_tray_selection;
138 xev.data.l[2] = winId();
142 XSendEvent(display, root,
false, StructureNotifyMask, (XEvent *)&xev);
150 emb = m_Wins.first();
151 while ((emb = m_Wins.current()) != 0L) {
152 WId wid = emb->embeddedWinId();
153 if ((wid == 0) || !kwin_module->systemTrayWindows().contains(wid))
169 int aa = width() / 24;
177 for (emb = m_Wins.first(); emb != 0L; emb = m_Wins.next()) {
197 no_of_systray_windows++;
200 emb =
new QXEmbed(
this);
202 emb->setAutoDelete(
false);
204 emb->setBackgroundMode(FixedPixmap);
217 no_of_systray_windows--;
224 return no_of_systray_windows;
227 #include "systemtray.moc"
Systemtray(QWidget *parent)
void systemTrayWindowAdded(WId w)
virtual void initSystray(void)
int getCurrentWindowCount()
void updateBackgroundPixmap(const QPixmap &)
void systemTrayWindowRemoved(WId w)