server.atom.XdndAware = XInternAtom(server.dsp, "XdndAware", False);
server.atom.XdndPosition = XInternAtom(server.dsp, "XdndPosition", False);
server.atom.XdndStatus = XInternAtom(server.dsp, "XdndStatus", False);
+
+ server.colormap = 0;
+ server.monitor = 0;
+ server.gc = 0;
}
XFree (xvi);
// check composite manager
- if (XGetSelectionOwner(server.dsp, server.atom._NET_WM_CM_S0) == None)
- real_transparency = 0;
- else
- real_transparency = 1;
+ server.composite_manager = XGetSelectionOwner(server.dsp, server.atom._NET_WM_CM_S0);
+ if (server.colormap)
+ XFreeColormap(server.dsp, server.colormap);
- if (visual && real_transparency) {
+ if (visual && server.composite_manager != None) {
+ XSetWindowAttributes attrs;
+ attrs.event_mask = StructureNotifyMask;
+ XChangeWindowAttributes (server.dsp, server.composite_manager, CWEventMask, &attrs);
+
+ real_transparency = 1;
server.depth = 32;
printf("real transparency on... depth: %d\n", server.depth);
server.colormap = XCreateColormap(server.dsp, server.root_win, visual, AllocNone);
server.visual = visual;
}
else {
+ real_transparency = 0;
server.depth = DefaultDepth(server.dsp, server.screen);
printf("real transparency off.... depth: %d\n", server.depth);
server.colormap = DefaultColormap(server.dsp, server.screen);
int main (int argc, char *argv[])
{
XEvent e;
+ XClientMessageEvent *ev;
fd_set fdset;
int x11_fd, i;
Panel *panel;
panel_refresh = 0;
// QUESTION: do we need this first refresh_systray, because we check refresh_systray once again later...
+ // ANSWER: yes, panel->temp_pmap is freeded in the loop.
+ // we change background to None to avoid tray icon using freeded pixmap.
if (refresh_systray) {
panel = (Panel*)systray.area.panel;
XSetWindowBackgroundPixmap (server.dsp, panel->main_win, None);
break;
case UnmapNotify:
case DestroyNotify:
+ if (e.xany.window == server.composite_manager) {
+ printf("Stop composite.\n");
+ //signal_pending = SIGUSR2;
+ server_init_visual();
+ break;
+ }
if (e.xany.window == g_tooltip.window || !systray.area.on_screen)
break;
for (it = systray.list_icons; it; it = g_slist_next(it)) {
break;
case ClientMessage:
+ ev = &e;
+ if (ev->data.l[1] == server.atom._NET_WM_CM_S0) {
+ if (ev->data.l[2] == None)
+ printf("Stop composite 2.\n");
+ else
+ printf("Start composite.\n");
+ server_init_visual();
+ //signal_pending = SIGUSR2;
+ }
if (!systray.area.on_screen) break;
if (e.xclient.message_type == server.atom._NET_SYSTEM_TRAY_OPCODE && e.xclient.format == 32 && e.xclient.window == net_sel_win) {
net_message(&e.xclient);