detect start/stop composite manager. and answer to question.
git-svn-id: http://tint2.googlecode.com/svn/trunk@359 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
18
src/tint.c
18
src/tint.c
@@ -636,6 +636,7 @@ void dnd_message(XClientMessageEvent *e)
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
XEvent e;
|
||||
XClientMessageEvent *ev;
|
||||
fd_set fdset;
|
||||
int x11_fd, i;
|
||||
Panel *panel;
|
||||
@@ -677,6 +678,8 @@ int main (int argc, char *argv[])
|
||||
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);
|
||||
@@ -781,6 +784,12 @@ int main (int argc, char *argv[])
|
||||
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)) {
|
||||
@@ -792,6 +801,15 @@ int main (int argc, char *argv[])
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user