comparison lwlib/xlwmenu.c @ 9033:3c36c72db2bb

*** empty log message ***
author Paul Reilly <pmr@pajato.com>
date Sat, 24 Sep 1994 00:12:06 +0000
parents 07d79cbdfbc9
children ac51b5072431
comparison
equal deleted inserted replaced
9032:d69f3bc2e845 9033:3c36c72db2bb
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs; see the file COPYING. If not, write to 17 Alongalong with GNU Emacs; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ 18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19 19
20 /* Created by devin@lucid.com */ 20 /* Created by devin@lucid.com */
21 21
22 #include <stdio.h> 22 #include <stdio.h>
23 23
24 #include <sys/types.h> 24 #include <sys/types.h>
25 #include <X11/Xos.h> 25 #include <X11/Xos.h>
26 #include <X11/IntrinsicP.h> 26 #include <X11/IntrinsicP.h>
27 #include <X11/ObjectP.h>
27 #include <X11/StringDefs.h> 28 #include <X11/StringDefs.h>
28 #include <X11/cursorfont.h> 29 #include <X11/cursorfont.h>
29 #include <X11/bitmaps/gray> 30 #include <X11/bitmaps/gray>
30 #include "xlwmenuP.h" 31 #include "xlwmenuP.h"
31 32
1381 1382
1382 if (mw->menu.popped_up) 1383 if (mw->menu.popped_up)
1383 { 1384 {
1384 mw->menu.popped_up = False; 1385 mw->menu.popped_up = False;
1385 XtUngrabPointer ((Widget)mw, ev->xmotion.time); 1386 XtUngrabPointer ((Widget)mw, ev->xmotion.time);
1386 if (XtIsShell (XtParent (mw))) 1387 if (XtIsShell (XtParent ((Widget) mw)))
1387 XtPopdown (XtParent (mw)); 1388 XtPopdown (XtParent ((Widget) mw));
1388 else 1389 else
1389 { 1390 {
1390 XtRemoveGrab ((Widget) mw); 1391 XtRemoveGrab ((Widget) mw);
1391 display_menu (mw, 0, False, NULL, NULL, NULL, NULL, NULL); 1392 display_menu (mw, 0, False, NULL, NULL, NULL, NULL, NULL);
1392 } 1393 }
1412 1413
1413 next_release_must_exit = 0; 1414 next_release_must_exit = 0;
1414 1415
1415 XtCallCallbackList ((Widget)mw, mw->menu.open, NULL); 1416 XtCallCallbackList ((Widget)mw, mw->menu.open, NULL);
1416 1417
1417 if (XtIsShell (XtParent (mw))) 1418 if (XtIsShell (XtParent ((Widget)mw)))
1418 size_menu (mw, 0); 1419 size_menu (mw, 0);
1419 1420
1420 w = mw->menu.windows [0].width; 1421 w = mw->menu.windows [0].width;
1421 h = mw->menu.windows [0].height; 1422 h = mw->menu.windows [0].height;
1422 1423
1430 y = borderwidth; 1431 y = borderwidth;
1431 if (y + h + 2 * borderwidth> HeightOfScreen (screen)) 1432 if (y + h + 2 * borderwidth> HeightOfScreen (screen))
1432 y = HeightOfScreen (screen) - h - 2 * borderwidth; 1433 y = HeightOfScreen (screen) - h - 2 * borderwidth;
1433 1434
1434 mw->menu.popped_up = True; 1435 mw->menu.popped_up = True;
1435 if (XtIsShell (XtParent (mw))) 1436 if (XtIsShell (XtParent ((Widget)mw)))
1436 { 1437 {
1437 XtConfigureWidget (XtParent (mw), x, y, w, h, 1438 XtConfigureWidget (XtParent ((Widget)mw), x, y, w, h,
1438 XtParent (mw)->core.border_width); 1439 XtParent ((Widget)mw)->core.border_width);
1439 XtPopup (XtParent (mw), XtGrabExclusive); 1440 XtPopup (XtParent ((Widget)mw), XtGrabExclusive);
1440 display_menu (mw, 0, False, NULL, NULL, NULL, NULL, NULL); 1441 display_menu (mw, 0, False, NULL, NULL, NULL, NULL, NULL);
1441 mw->menu.windows [0].x = x + borderwidth; 1442 mw->menu.windows [0].x = x + borderwidth;
1442 mw->menu.windows [0].y = y + borderwidth; 1443 mw->menu.windows [0].y = y + borderwidth;
1443 } 1444 }
1444 else 1445 else