comparison src/menubar-x.c @ 165:5a88923fcbfe r20-3b9

Import from CVS: tag r20-3b9
author cvs
date Mon, 13 Aug 2007 09:44:42 +0200
parents 0132846995bd
children 15872534500d
comparison
equal deleted inserted replaced
164:4e0740e5aab2 165:5a88923fcbfe
625 btn->window = XtWindow (daddy); 625 btn->window = XtWindow (daddy);
626 if (eev) 626 if (eev)
627 { 627 {
628 Position shellx, shelly, framex, framey; 628 Position shellx, shelly, framex, framey;
629 Widget shell = XtParent (daddy); 629 Widget shell = XtParent (daddy);
630 Arg al [2];
630 btn->time = eev->timestamp; 631 btn->time = eev->timestamp;
631 btn->button = eev->event.button.button; 632 btn->button = eev->event.button.button;
632 btn->root = RootWindowOfScreen (XtScreen (daddy)); 633 btn->root = RootWindowOfScreen (XtScreen (daddy));
633 btn->subwindow = (Window) NULL; 634 btn->subwindow = (Window) NULL;
634 btn->x = eev->event.button.x; 635 btn->x = eev->event.button.x;
635 btn->y = eev->event.button.y; 636 btn->y = eev->event.button.y;
636 XtVaGetValues (shell, XtNx, &shellx, XtNy, &shelly, NULL); 637 XtSetArg (al [0], XtNx, &shellx);
637 XtVaGetValues (daddy, XtNx, &framex, XtNy, &framey, NULL); 638 XtSetArg (al [1], XtNy, &shelly);
639 XtGetValues (shell, al, 2);
640 XtSetArg (al [0], XtNx, &framex);
641 XtSetArg (al [1], XtNy, &framey);
642 XtGetValues (daddy, al, 2);
638 btn->x_root = shellx + framex + btn->x; 643 btn->x_root = shellx + framex + btn->x;
639 btn->y_root = shelly + framey + btn->y;; 644 btn->y_root = shelly + framey + btn->y;;
640 btn->state = ButtonPressMask; /* all buttons pressed */ 645 btn->state = ButtonPressMask; /* all buttons pressed */
641 } 646 }
642 else 647 else
783 /* Note that new_num_top_widgets doesn't need to reflect the actual 788 /* Note that new_num_top_widgets doesn't need to reflect the actual
784 number of top widgets, but just the limit of FRAME_X_TOP_WIDGETS (f)[]. */ 789 number of top widgets, but just the limit of FRAME_X_TOP_WIDGETS (f)[]. */
785 FRAME_X_NUM_TOP_WIDGETS (f) = new_num_top_widgets; 790 FRAME_X_NUM_TOP_WIDGETS (f) = new_num_top_widgets;
786 { 791 {
787 /* We want to end up as close in size as possible to what we 792 /* We want to end up as close in size as possible to what we
788 were before. So, ask the EmacsManager what size it wants 793 were before. So, ask the EmacsManager what size it wants to be
789 to be (suggesting the current size), and resize it to that 794 (suggesting the current size), and resize it to that size. It
790 size. It in turn will call our query-geometry callback, 795 in turn will call our query-geometry callback, which will round
791 which will round the size to something that exactly fits 796 the size to something that exactly fits the text widget. */
792 the text widget. */
793 XtWidgetGeometry req, repl; 797 XtWidgetGeometry req, repl;
798 Arg al [2];
794 799
795 req.request_mode = CWWidth | CWHeight; 800 req.request_mode = CWWidth | CWHeight;
796 XtVaGetValues (container, 801 XtSetArg (al [0], XtNwidth, &req.width);
797 XtNwidth, &req.width, 802 XtSetArg (al [1], XtNheight, &req.height);
798 XtNheight, &req.height, 803 XtGetValues (container, al, 2);
799 NULL);
800 XtQueryGeometry (container, &req, &repl); 804 XtQueryGeometry (container, &req, &repl);
801 EmacsManagerChangeSize (container, repl.width, 805 EmacsManagerChangeSize (container, repl.width, repl.height);
802 repl.height);
803 /* The window size might not have changed but the text size 806 /* The window size might not have changed but the text size
804 did; thus, the base size might be incorrect. So update 807 did; thus, the base size might be incorrect. So update it. */
805 it. */
806 EmacsShellUpdateSizeHints (FRAME_X_SHELL_WIDGET (f)); 808 EmacsShellUpdateSizeHints (FRAME_X_SHELL_WIDGET (f));
807 } 809 }
808 810
809 #ifdef ENERGIZE 811 #ifdef ENERGIZE
810 /* Give back the focus to emacs if no psheets are displayed anymore */ 812 /* Give back the focus to emacs if no psheets are displayed anymore */