static void PressApp (int button, int state, int x, int y) { (void) button; (void) state; (void) x; (void) y; if (BarShown) LeaveBar () ; else EnterApp () ; }
void AppManager::Init() { EnterApp(new MagicApp::Homepage, "Homepage"); }
extern void Events_Loop (void) { XEvent ev ; bool canShowBar = true ; while (true) { /* get some event to process */ if (HideBarDelayed) { if (! DANextEventOrTimeout (& ev, HideTimeout)) { /* timeout ! */ LeaveBar () ; continue ; /* restart waiting for an event */ } } else { XNextEvent (DADisplay, & ev) ; } /* event available, process it */ if (ev.type == EnterNotify) /* catch entering any wmmenu window */ { if (canShowBar) EnterApp () ; canShowBar = true ; } else if (ev.type == LeaveNotify) /* catch leaving any wmmenu window */ { /* when cursor goes from icon to dock tile */ /* take care to not show the bar back if it is already hidden */ if (ev.xany.window == DAWindow) canShowBar = BarShown ; LeaveApp () ; } else if (ev.xany.window == DAWindow) switch (ev.type) { case ReparentNotify : case ConfigureNotify : /* find new WMFrame and update bar position */ FindWMFrameAndBarPos () ; break ; default : DAProcessEvent (& ev) ; break ; } else if (ev.xany.window == ButtonBarWindow) switch (ev.type) { case ButtonRelease : InvokeBar (ev.xbutton.x, ev.xbutton.y) ; break ; case MotionNotify : if (HighlightImage != 0) /* try to avoid func call */ { ButtonBar_Highlight ( ev.xmotion.x/TileXSize, ev.xmotion.y/TileYSize) ; } break ; } else if (ev.xany.window == WMFrame && WMFrame != 0) switch (ev.type) { case DestroyNotify : case ConfigureNotify : /* find new WMFrame and update bar position */ FindWMFrameAndBarPos () ; break ; } } }