fixed background refresh on systray
git-svn-id: http://tint2.googlecode.com/svn/trunk@113 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
parent
cf51cbfec9
commit
e6c9996ba0
5 changed files with 40 additions and 19 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
2009-06-13
|
||||||
|
- fixed background refresh on systray
|
||||||
|
|
||||||
2009-06-09
|
2009-06-09
|
||||||
- fixed issue 98
|
- fixed issue 98
|
||||||
|
|
||||||
|
|
|
@ -803,7 +803,7 @@ void save_config ()
|
||||||
else if (panel_position & RIGHT) fputs(" right\n", fp);
|
else if (panel_position & RIGHT) fputs(" right\n", fp);
|
||||||
else fputs(" center\n", fp);
|
else fputs(" center\n", fp);
|
||||||
fprintf(fp, "panel_size = %d %d\n", (int)panel_config->initial_width, (int)panel_config->initial_height);
|
fprintf(fp, "panel_size = %d %d\n", (int)panel_config->initial_width, (int)panel_config->initial_height);
|
||||||
fprintf(fp, "panel_margin = %d %d\n", panel_config->marginx, panel_config->marginy);
|
fprintf(fp, "panel_margin = %d %d\n", panel_config->marginx, panel_config->marginy);
|
||||||
fprintf(fp, "panel_padding = %d %d %d\n", panel_config->area.paddingxlr, panel_config->area.paddingy, panel_config->area.paddingx);
|
fprintf(fp, "panel_padding = %d %d %d\n", panel_config->area.paddingxlr, panel_config->area.paddingy, panel_config->area.paddingx);
|
||||||
fprintf(fp, "font_shadow = %d\n", panel_config->g_task.font_shadow);
|
fprintf(fp, "font_shadow = %d\n", panel_config->g_task.font_shadow);
|
||||||
fputs("panel_background_id = 1\n", fp);
|
fputs("panel_background_id = 1\n", fp);
|
||||||
|
|
|
@ -355,7 +355,6 @@ void net_message(XClientMessageEvent *e)
|
||||||
Window id;
|
Window id;
|
||||||
|
|
||||||
opcode = e->data.l[1];
|
opcode = e->data.l[1];
|
||||||
|
|
||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
case SYSTEM_TRAY_REQUEST_DOCK:
|
case SYSTEM_TRAY_REQUEST_DOCK:
|
||||||
id = e->data.l[2];
|
id = e->data.l[2];
|
||||||
|
@ -363,24 +362,29 @@ void net_message(XClientMessageEvent *e)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SYSTEM_TRAY_BEGIN_MESSAGE:
|
case SYSTEM_TRAY_BEGIN_MESSAGE:
|
||||||
printf("message from dockapp\n");
|
|
||||||
id = e->window;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SYSTEM_TRAY_CANCEL_MESSAGE:
|
case SYSTEM_TRAY_CANCEL_MESSAGE:
|
||||||
printf("message cancelled\n");
|
// we don't show baloons messages.
|
||||||
id = e->window;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (opcode == server.atom._NET_SYSTEM_TRAY_MESSAGE_DATA) {
|
if (opcode == server.atom._NET_SYSTEM_TRAY_MESSAGE_DATA) {
|
||||||
printf("message from dockapp:\n %s\n", e->data.b);
|
printf("message from dockapp: %s\n", e->data.b);
|
||||||
id = e->window;
|
|
||||||
}
|
}
|
||||||
// unknown message type. not in the spec
|
else
|
||||||
|
printf("SYSTEM_TRAY : unknown message type\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void refresh_systray()
|
||||||
|
{
|
||||||
|
TrayWindow *traywin;
|
||||||
|
GSList *l;
|
||||||
|
for (l = systray.list_icons; l ; l = l->next) {
|
||||||
|
traywin = (TrayWindow*)l->data;
|
||||||
|
XClearArea(server.dsp, traywin->id, 0, 0, traywin->width, traywin->height, True);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ void draw_systray(void *obj, cairo_t *c, int active);
|
||||||
|
|
||||||
void resize_systray(void *obj);
|
void resize_systray(void *obj);
|
||||||
|
|
||||||
|
void refresh_systray();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
29
src/tint.c
29
src/tint.c
|
@ -351,11 +351,12 @@ void event_property_notify (XEvent *e)
|
||||||
}
|
}
|
||||||
panel_refresh = 1;
|
panel_refresh = 1;
|
||||||
}
|
}
|
||||||
// Wallpaper changed
|
|
||||||
else if (at == server.atom._XROOTPMAP_ID) {
|
else if (at == server.atom._XROOTPMAP_ID) {
|
||||||
|
// change Wallpaper
|
||||||
for (i=0 ; i < nb_panel ; i++) {
|
for (i=0 ; i < nb_panel ; i++) {
|
||||||
set_panel_background(&panel1[i]);
|
set_panel_background(&panel1[i]);
|
||||||
}
|
}
|
||||||
|
refresh_systray();
|
||||||
panel_refresh = 1;
|
panel_refresh = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -454,6 +455,8 @@ void event_expose (XEvent *e)
|
||||||
|
|
||||||
panel = get_panel(e->xany.window);
|
panel = get_panel(e->xany.window);
|
||||||
if (!panel) return;
|
if (!panel) return;
|
||||||
|
// TODO : one panel_refresh per panel ?
|
||||||
|
panel_refresh = 1;
|
||||||
/*
|
/*
|
||||||
if (systray.area.on_screen) {
|
if (systray.area.on_screen) {
|
||||||
// force trayer refresh
|
// force trayer refresh
|
||||||
|
@ -473,23 +476,30 @@ void event_expose (XEvent *e)
|
||||||
//x11_refresh_window(tray_data.dpy, ti->wid, ti->l.wnd_sz.x, ti->l.wnd_sz.y, True);
|
//x11_refresh_window(tray_data.dpy, ti->wid, ti->l.wnd_sz.x, ti->l.wnd_sz.y, True);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
panel_refresh = 1;
|
|
||||||
//XCopyArea (server.dsp, panel->temp_pmap, panel->main_win, server.gc, 0, 0, panel->area.width, panel->area.height, 0, 0);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void event_configure_notify (Window win)
|
void event_configure_notify (Window win)
|
||||||
{
|
{
|
||||||
|
// check 'win' move in systray
|
||||||
|
TrayWindow *traywin;
|
||||||
|
GSList *l;
|
||||||
|
for (l = systray.list_icons; l ; l = l->next) {
|
||||||
|
traywin = (TrayWindow*)l->data;
|
||||||
|
if (traywin->id == win) {
|
||||||
|
XMoveResizeWindow(server.dsp, traywin->id, traywin->x, traywin->y, traywin->width, traywin->height);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check 'win' move in another monitor
|
||||||
if (nb_panel == 1) return;
|
if (nb_panel == 1) return;
|
||||||
if (server.nb_monitor == 1) return;
|
if (server.nb_monitor == 1) return;
|
||||||
|
|
||||||
Task *tsk = task_get_task (win);
|
Task *tsk = task_get_task (win);
|
||||||
if (!tsk) return;
|
if (!tsk) return;
|
||||||
|
|
||||||
Panel *p = tsk->area.panel;
|
Panel *p = tsk->area.panel;
|
||||||
if (p->monitor != window_get_monitor (win)) {
|
if (p->monitor != window_get_monitor (win)) {
|
||||||
// task on another monitor
|
|
||||||
remove_task (tsk);
|
remove_task (tsk);
|
||||||
add_task (win);
|
add_task (win);
|
||||||
if (win == window_get_active ()) {
|
if (win == window_get_active ()) {
|
||||||
|
@ -602,9 +612,13 @@ load_config:
|
||||||
event_configure_notify (e.xconfigure.window);
|
event_configure_notify (e.xconfigure.window);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ReparentNotify:
|
||||||
|
if (e.xany.window == server.root_win) // reparented to us
|
||||||
|
break;
|
||||||
case UnmapNotify:
|
case UnmapNotify:
|
||||||
case DestroyNotify:
|
case DestroyNotify:
|
||||||
if (!systray.area.on_screen) break;
|
if (!systray.area.on_screen)
|
||||||
|
break;
|
||||||
for (it = systray.list_icons; it; it = g_slist_next(it)) {
|
for (it = systray.list_icons; it; it = g_slist_next(it)) {
|
||||||
if (((TrayWindow*)it->data)->id == e.xany.window) {
|
if (((TrayWindow*)it->data)->id == e.xany.window) {
|
||||||
remove_icon((TrayWindow*)it->data);
|
remove_icon((TrayWindow*)it->data);
|
||||||
|
@ -615,7 +629,6 @@ load_config:
|
||||||
|
|
||||||
case ClientMessage:
|
case ClientMessage:
|
||||||
if (!systray.area.on_screen) break;
|
if (!systray.area.on_screen) break;
|
||||||
//printf("ClientMessage\n");
|
|
||||||
if (e.xclient.message_type == server.atom._NET_SYSTEM_TRAY_OPCODE && e.xclient.format == 32 && e.xclient.window == net_sel_win) {
|
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);
|
net_message(&e.xclient);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue