comparison src/frame-x.c @ 5128:7be849cb8828 ben-lisp-object

merge
author Ben Wing <ben@xemacs.org>
date Sun, 07 Mar 2010 02:09:59 -0600
parents a9c41067dd88 0ca81354c4c7
children 97eb4942aec8
comparison
equal deleted inserted replaced
5127:a9c41067dd88 5128:7be849cb8828
1 /* Functions for the X window system. 1 /* Functions for the X window system.
2 Copyright (C) 1989, 1992-5, 1997 Free Software Foundation, Inc. 2 Copyright (C) 1989, 1992-5, 1997 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1996, 2001, 2002, 2004, 2010 Ben Wing. 3 Copyright (C) 1995, 1996, 2001, 2002, 2004, 2010 Ben Wing.
4 Copyright (C) 2010 Didier Verna
4 5
5 This file is part of XEmacs. 6 This file is part of XEmacs.
6 7
7 XEmacs is free software; you can redistribute it and/or modify it 8 XEmacs is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 9 under the terms of the GNU General Public License as published by the
531 } 532 }
532 while (root != parent); 533 while (root != parent);
533 XGetWindowAttributes (d, w, &xwa); 534 XGetWindowAttributes (d, w, &xwa);
534 *x = xwa.x; 535 *x = xwa.x;
535 *y = xwa.y; 536 *y = xwa.y;
537 }
538
539 void x_get_frame_text_position (struct frame *f)
540 {
541 Display *dpy = DEVICE_X_DISPLAY (XDEVICE (FRAME_DEVICE (f)));
542 Window window = XtWindow (FRAME_X_TEXT_WIDGET (f));
543 Window root, child;
544 int x, y;
545 unsigned int width, height, border_width;
546 unsigned int depth;
547
548 XGetGeometry (dpy, window, &root, &x, &y, &width, &height, &border_width,
549 &depth);
550 XTranslateCoordinates (dpy, window, root, 0, 0, &x, &y, &child);
551
552 FRAME_X_X (f) = x;
553 FRAME_X_Y (f) = y;
536 } 554 }
537 555
538 #if 0 556 #if 0
539 static void 557 static void
540 x_smash_bastardly_shell_position (Widget shell) 558 x_smash_bastardly_shell_position (Widget shell)
1430 /* set the position of the frame's root window now. When the 1448 /* set the position of the frame's root window now. When the
1431 frame was created, the position was initialized to (0,0). */ 1449 frame was created, the position was initialized to (0,0). */
1432 { 1450 {
1433 struct window *win = XWINDOW (f->root_window); 1451 struct window *win = XWINDOW (f->root_window);
1434 1452
1435 WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f) 1453 WINDOW_LEFT (win) = FRAME_PANED_LEFT_EDGE (f);
1436 + FRAME_LEFT_GUTTER_BOUNDS (f); 1454 WINDOW_TOP (win) = FRAME_PANED_TOP_EDGE (f);
1437 WINDOW_TOP (win) = FRAME_TOP_BORDER_END (f)
1438 + FRAME_TOP_GUTTER_BOUNDS (f);
1439 1455
1440 if (!NILP (f->minibuffer_window)) 1456 if (!NILP (f->minibuffer_window))
1441 { 1457 {
1442 win = XWINDOW (f->minibuffer_window); 1458 win = XWINDOW (f->minibuffer_window);
1443 WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f) 1459 WINDOW_LEFT (win) = FRAME_PANED_LEFT_EDGE (f);
1444 + FRAME_LEFT_GUTTER_BOUNDS (f);
1445 } 1460 }
1446 } 1461 }
1447 1462
1448 #ifdef EXTERNAL_WIDGET 1463 #ifdef EXTERNAL_WIDGET
1449 /* If we're an external widget, then the size of the frame is predetermined 1464 /* If we're an external widget, then the size of the frame is predetermined
2115 } 2130 }
2116 2131
2117 static void 2132 static void
2118 x_init_frame_3 (struct frame *f) 2133 x_init_frame_3 (struct frame *f)
2119 { 2134 {
2120 /* Pop up the frame. */ 2135 /* #### NOTE: This whole business of splitting frame initialization into
2121 2136 #### different functions is somewhat messy. The latest one seems a good
2137 #### place to initialize the edit widget's position because we're sure
2138 #### that the frame is now relalized. -- dvl */
2139
2122 x_popup_frame (f); 2140 x_popup_frame (f);
2141 x_get_frame_text_position (f);
2123 } 2142 }
2124 2143
2125 static void 2144 static void
2126 x_mark_frame (struct frame *f) 2145 x_mark_frame (struct frame *f)
2127 { 2146 {