示例#1
0
文件: root.c 项目: GustavoMOG/JWM
/** Show a root menu. */
int ShowRootMenu(int index, int x, int y) {

   if(!rootMenu[index]) {
      return 0;
   }

   PatchRootMenu(rootMenu[index]);
   ShowMenu(rootMenu[index], RunRootCommand, x, y);
   UnpatchRootMenu(rootMenu[index]);

   return 1;

}
示例#2
0
文件: root.c 项目: technosaurus/jwm
/** Remove temporary items from a root menu. */
void UnpatchRootMenu(Menu *menu) {

   MenuItem *item;

   for(item = menu->items; item; item = item->next) {
      if(item->action.type == MA_DESKTOP) {
         DestroyMenu(item->submenu);
         item->submenu = NULL;
      } else if(item->submenu) {
         UnpatchRootMenu(item->submenu);
      }
   }

}
示例#3
0
文件: root.c 项目: GustavoMOG/JWM
/** Determine the size of a root menu. */
void GetRootMenuSize(int index, int *width, int *height) {

   if(!rootMenu[index]) {
      *width = 0;
      *height = 0;
      return;
   }

   PatchRootMenu(rootMenu[index]);
   *width = rootMenu[index]->width;
   *height = rootMenu[index]->height;
   UnpatchRootMenu(rootMenu[index]);

}