void event_expose (XEvent *e)
{
- if (e->xany.window == g_tooltip.window)
- tooltip_update();
- else {
- Panel *panel;
- panel = get_panel(e->xany.window);
- if (!panel) return;
- // TODO : one panel_refresh per panel ?
- panel_refresh = 1;
- }
+ Panel *panel;
+ panel = get_panel(e->xany.window);
+ if (!panel) return;
+ // TODO : one panel_refresh per panel ?
+ panel_refresh = 1;
}
}
-void event_timer()
-{
-}
-
-
void dnd_message(XClientMessageEvent *e)
{
Panel *panel = get_panel(e->window);
sigemptyset(&empty_mask);
while (1) {
+ if (panel_refresh) {
+ panel_refresh = 0;
+
+ if (refresh_systray) {
+ panel = (Panel*)systray.area.panel;
+ XSetWindowBackgroundPixmap (server.dsp, panel->main_win, None);
+ }
+ for (i=0 ; i < nb_panel ; i++) {
+ panel = &panel1[i];
+
+ if (panel->temp_pmap) XFreePixmap(server.dsp, panel->temp_pmap);
+ panel->temp_pmap = XCreatePixmap(server.dsp, server.root_win, panel->area.width, panel->area.height, server.depth);
+
+ refresh(&panel->area);
+ XCopyArea(server.dsp, panel->temp_pmap, panel->main_win, server.gc, 0, 0, panel->area.width, panel->area.height, 0, 0);
+ }
+ XFlush (server.dsp);
+
+ if (refresh_systray) {
+ refresh_systray = 0;
+ panel = (Panel*)systray.area.panel;
+ // tint2 doen't draw systray icons. it just redraw background.
+ XSetWindowBackgroundPixmap (server.dsp, panel->main_win, panel->temp_pmap);
+ // force icon's refresh
+ refresh_systray_icon();
+ }
+ }
+
// thanks to AngryLlama for the timer
// Create a File Description Set containing x11_fd, and every timer_fd
FD_ZERO (&fdset);
event_expose(&e);
break;
+ case MapNotify:
+ if (e.xany.window == g_tooltip.window)
+ tooltip_update();
+ break;
+
+
case PropertyNotify:
event_property_notify(&e);
break;
break;
case UnmapNotify:
case DestroyNotify:
- if (!systray.area.on_screen)
+ if (e.xany.window == g_tooltip.window || !systray.area.on_screen)
break;
for (it = systray.list_icons; it; it = g_slist_next(it)) {
if (((TrayWindow*)it->data)->id == e.xany.window) {
cleanup ();
return 0;
}
-
- if (panel_refresh) {
- panel_refresh = 0;
-
- if (refresh_systray) {
- panel = (Panel*)systray.area.panel;
- XSetWindowBackgroundPixmap (server.dsp, panel->main_win, None);
- }
- for (i=0 ; i < nb_panel ; i++) {
- panel = &panel1[i];
-
- if (panel->temp_pmap) XFreePixmap(server.dsp, panel->temp_pmap);
- panel->temp_pmap = XCreatePixmap(server.dsp, server.root_win, panel->area.width, panel->area.height, server.depth);
-
- refresh(&panel->area);
- XCopyArea(server.dsp, panel->temp_pmap, panel->main_win, server.gc, 0, 0, panel->area.width, panel->area.height, 0, 0);
- }
- XFlush (server.dsp);
-
- if (refresh_systray) {
- refresh_systray = 0;
- panel = (Panel*)systray.area.panel;
- // tint2 doen't draw systray icons. it just redraw background.
- XSetWindowBackgroundPixmap (server.dsp, panel->main_win, panel->temp_pmap);
- // force icon's refresh
- refresh_systray_icon();
- }
- }
}
}
XSetWindowAttributes attr;
attr.override_redirect = True;
- attr.event_mask = ExposureMask;
+ attr.event_mask = StructureNotifyMask;
if (g_tooltip.window) XDestroyWindow(server.dsp, g_tooltip.window);
g_tooltip.window = XCreateWindow(server.dsp, server.root_win, 0, 0, 100, 20, 0, server.depth, InputOutput, CopyFromParent, CWOverrideRedirect|CWEventMask, &attr);
}
void tooltip_show()
{
+ stop_timeouts();
if (!g_tooltip.mapped) {
g_tooltip.mapped = True;
XMapWindow(server.dsp, g_tooltip.window);
- //tooltip_update();
+ XFlush(server.dsp);
}
}
return;
}
- //printf("tooltip_update\n");
+// printf("tooltip_update\n");
tooltip_update_geometry();
tooltip_adjust_geometry();
XMoveResizeWindow(server.dsp, g_tooltip.window, x, y, width, height);
void tooltip_hide()
{
+ stop_timeouts();
if (g_tooltip.mapped) {
g_tooltip.mapped = False;
XUnmapWindow(server.dsp, g_tooltip.window);
+ XFlush(server.dsp);
}
}