Exemplo n.º 1
0
void updateWindowMenu(void)
{
	Window			win;

	updateWindowCnt++;
	if(updateWindowCnt>=WINDOWREFRESH)
		updateWindowCnt=0;
	else
		return;

	if(windowListCnt>-1)
		resetMenus();

	getCurrentDesktop();

	if(windowDeskMenu!=NULL)
		{
			win=mainwind->rootWindow;
			windowDeskListCnt=0;
			while(win!=None)
				win=doTreeWalk(win,true);

			if(windowDeskListCnt>0)
				{
					windowDeskMenu->LFSTK_updateMenus(windowDeskList,windowDeskListCnt);
					windowDeskMenu->LFSTK_setActive(true);
				}
			else
				windowDeskMenu->LFSTK_setActive(false);
		}

	if(windowMenu!=NULL)
		{
			windowListCnt=0;
			win=mainwind->rootWindow;
			while(win!=None)
				win=doTreeWalk(win,false);
			windowMenu->LFSTK_updateMenus(windowList,windowListCnt);
		}
}
Exemplo n.º 2
0
int main(int argc, char *argv[]) {
	int current = getCurrentDesktop();
	int specified = getSpecifiedValue(argv, current);

    int wNum = getWindowsCountOfSpecifiedDesktop(specified + '0');

    char **arr = populateArray(specified + '0', wNum);
    char **commandsToExecute;

    printf("current: %d, specified: %d\n", current, specified);

    for(int i = 0; i < wNum; i++) {
    	printf("%s\n", arr[i]);
    	//printf("wmctrl -i -r %s -e 0,x,x,x,x\n", arr[i]);
    	//getXCommand("xwininfo -id %s | grep 'Absolute upper-left X:' | grep -Eo '(-?[0-9]+)'", arr[i]);
    	//printf("%d\n", getParameter("xwininfo -id %s | grep 'Absolute upper-left X:' | grep -Eo '(-?[0-9]+)'", arr[i]));
    	getParameters(arr[i]);
    }

    // int a = stringToInt("429");
    // printf("%d\n", a);
	// FILE *command = popen("wmctrl -d | wc -l", "r");
 //    printf("%d\n", countStringSize(command));
}