+ panel = (Panel*)systray.area.panel;
+ if (refresh_systray && !panel->is_hidden) {
+ 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
+ FD_ZERO (&fdset);
+ FD_SET (x11_fd, &fdset);
+ update_next_timeout();
+ if (next_timeout.tv_sec >= 0 && next_timeout.tv_usec >= 0)
+ timeout = &next_timeout;
+ else
+ timeout = 0;
+
+ // Wait for X Event or a Timer
+ if (select(x11_fd+1, &fdset, 0, 0, timeout) > 0) {
+ while (XPending (server.dsp)) {
+ XNextEvent(server.dsp, &e);
+
+ panel = get_panel(e.xany.window);
+ if (panel && panel_autohide) {
+ if (e.type == EnterNotify)
+ autohide_trigger_show(panel);
+ else if (e.type == LeaveNotify)
+ autohide_trigger_hide(panel);
+ if (panel->is_hidden)
+ continue; // discard further processing of this event because the panel is not visible yet
+ }
+
+ switch (e.type) {
+ case ButtonPress:
+ tooltip_hide(0);
+ event_button_press (&e);
+ break;
+
+ case ButtonRelease:
+ event_button_release(&e);
+ break;
+
+ case MotionNotify: {
+ if (!g_tooltip.enabled) break;
+ Panel* panel = get_panel(e.xmotion.window);
+ Area* area = click_area(panel, e.xmotion.x, e.xmotion.y);
+ if (area->_get_tooltip_text)
+ tooltip_trigger_show(area, panel, e.xmotion.x_root, e.xmotion.y_root);
+ else
+ tooltip_trigger_hide();
+ break;
+ }