Newer
Older
XGetGeometry(disp, winwid->win, &root, &(rect[0]), &(rect[1]), (unsigned
int *)&(rect[2]), (unsigned int *)&(rect[3]), &bw, &bp);
XTranslateCoordinates(disp, winwid->win, root, 0, 0, &(rect[0]), &(rect[1]), &child);
/* update the window geometry (in case it's inaccurate) */
winwid->x = rect[0];
winwid->y = rect[1];
winwid->w = rect[2];
winwid->h = rect[3];
D_RETURN_(4);
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
void winwidget_show_menu(winwidget winwid)
{
int x, y, b;
unsigned int c;
Window r;
XQueryPointer(disp, winwid->win, &r, &r, &x, &y, &b, &b, &c);
if (winwid->type == WIN_TYPE_ABOUT) {
if (!menu_about_win)
feh_menu_init_about_win();
feh_menu_show_at_xy(menu_about_win, winwid, x, y);
} else if (winwid->type == WIN_TYPE_SINGLE) {
if (!menu_single_win)
feh_menu_init_single_win();
feh_menu_show_at_xy(menu_single_win, winwid, x, y);
} else if (winwid->type == WIN_TYPE_THUMBNAIL) {
if (!menu_thumbnail_win)
feh_menu_init_thumbnail_win();
feh_menu_show_at_xy(menu_thumbnail_win, winwid, x, y);
} else if (winwid->type == WIN_TYPE_THUMBNAIL_VIEWER) {
if (!menu_single_win)
feh_menu_init_thumbnail_viewer();
feh_menu_show_at_xy(menu_thumbnail_viewer, winwid, x, y);
} else {
if (!menu_main)
feh_menu_init_main();
feh_menu_show_at_xy(menu_main, winwid, x, y);
}