aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorFred Pierresteguy1994-02-07 18:25:41 +0000
committerFred Pierresteguy1994-02-07 18:25:41 +0000
commitbc20ebbfefebda647a3fc1533accc8b167fbfcf6 (patch)
tree118c75b3befac6ffd4a3e9b61f727bb5794279d8 /src/xterm.c
parent87429608c5d2ac48821f39f9747be53c9981d2ad (diff)
downloademacs-bc20ebbfefebda647a3fc1533accc8b167fbfcf6.tar.gz
emacs-bc20ebbfefebda647a3fc1533accc8b167fbfcf6.zip
(x_make_frame_invisible): Add USE_X_TOOLKIT conditional.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c92
1 files changed, 60 insertions, 32 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 4fef2abc72e..17d57f12a06 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -38,8 +38,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
38#include <config.h> 38#include <config.h>
39 39
40/* Need syssignal.h for various externs and definitions that may be required 40/* Need syssignal.h for various externs and definitions that may be required
41 * by some configurations for calls to signal() later in this source file. 41 by some configurations for calls to signal later in this source file. */
42 */
43#include "syssignal.h" 42#include "syssignal.h"
44 43
45#ifdef HAVE_X_WINDOWS 44#ifdef HAVE_X_WINDOWS
@@ -920,9 +919,9 @@ XTflash (f)
920/* Make audible bell. */ 919/* Make audible bell. */
921 920
922#ifdef HAVE_X11 921#ifdef HAVE_X11
923#define XRINGBELL XBell(x_current_display, 0) 922#define XRINGBELL XBell (x_current_display, 0)
924#else /* ! defined (HAVE_X11) */ 923#else /* ! defined (HAVE_X11) */
925#define XRINGBELL XFeep(0); 924#define XRINGBELL XFeep (0);
926#endif /* ! defined (HAVE_X11) */ 925#endif /* ! defined (HAVE_X11) */
927 926
928XTring_bell () 927XTring_bell ()
@@ -2002,7 +2001,7 @@ x_window_to_scroll_bar (window_id)
2002 ! GC_NILP (bar) || (bar = condemned, 2001 ! GC_NILP (bar) || (bar = condemned,
2003 condemned = Qnil, 2002 condemned = Qnil,
2004 ! GC_NILP (bar)); 2003 ! GC_NILP (bar));
2005 bar = XSCROLL_BAR(bar)->next) 2004 bar = XSCROLL_BAR (bar)->next)
2006 if (SCROLL_BAR_X_WINDOW (XSCROLL_BAR (bar)) == window_id) 2005 if (SCROLL_BAR_X_WINDOW (XSCROLL_BAR (bar)) == window_id)
2007 return XSCROLL_BAR (bar); 2006 return XSCROLL_BAR (bar);
2008 } 2007 }
@@ -4218,7 +4217,7 @@ x_error_catcher (display, error)
4218 4217
4219 Calling x_uncatch_errors resumes the normal error handling. */ 4218 Calling x_uncatch_errors resumes the normal error handling. */
4220 4219
4221void x_catch_errors(), x_check_errors (), x_uncatch_errors (); 4220void x_catch_errors (), x_check_errors (), x_uncatch_errors ();
4222 4221
4223void 4222void
4224x_catch_errors () 4223x_catch_errors ()
@@ -4404,7 +4403,7 @@ x_new_font (f, fontname)
4404 XSetFont (x_current_display, f->display.x->cursor_gc, 4403 XSetFont (x_current_display, f->display.x->cursor_gc,
4405 f->display.x->font->fid); 4404 f->display.x->font->fid);
4406 4405
4407 x_set_window_size (f, f->width, f->height); 4406 x_set_window_size (f, 0, f->width, f->height);
4408 } 4407 }
4409 4408
4410 { 4409 {
@@ -4436,7 +4435,7 @@ x_new_font (f, newname)
4436 f->display.x->font = temp; 4435 f->display.x->font = temp;
4437 4436
4438 if (FRAME_X_WINDOW (f) != 0) 4437 if (FRAME_X_WINDOW (f) != 0)
4439 x_set_window_size (f, f->width, f->height); 4438 x_set_window_size (f, 0, f->width, f->height);
4440 4439
4441 return 0; 4440 return 0;
4442} 4441}
@@ -4514,15 +4513,19 @@ x_set_offset (f, xoff, yoff)
4514 f->display.x->left_pos, f->display.x->top_pos); 4513 f->display.x->left_pos, f->display.x->top_pos);
4515#endif /* not USE_X_TOOLKIT */ 4514#endif /* not USE_X_TOOLKIT */
4516#ifdef HAVE_X11 4515#ifdef HAVE_X11
4517 x_wm_set_size_hint (f, 0, xoff, yoff); 4516 x_wm_set_size_hint (f, 0, 1, xoff, yoff);
4518#endif /* ! defined (HAVE_X11) */ 4517#endif /* ! defined (HAVE_X11) */
4519 UNBLOCK_INPUT; 4518 UNBLOCK_INPUT;
4520} 4519}
4521 4520
4522/* Call this to change the size of frame F's x-window. */ 4521/* Call this to change the size of frame F's x-window.
4522 If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity
4523 for this size change and subsequent size changes.
4524 Otherwise we leave the window gravity unchanged. */
4523 4525
4524x_set_window_size (f, cols, rows) 4526x_set_window_size (f, change_gravity, cols, rows)
4525 struct frame *f; 4527 struct frame *f;
4528 int change_gravity;
4526 int cols, rows; 4529 int cols, rows;
4527{ 4530{
4528 int pixelwidth, pixelheight; 4531 int pixelwidth, pixelheight;
@@ -4546,7 +4549,7 @@ x_set_window_size (f, cols, rows)
4546 pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); 4549 pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows);
4547 4550
4548#ifdef HAVE_X11 4551#ifdef HAVE_X11
4549 x_wm_set_size_hint (f, 0, 0, 0); 4552 x_wm_set_size_hint (f, 0, change_gravity, 0, 0);
4550#endif /* ! defined (HAVE_X11) */ 4553#endif /* ! defined (HAVE_X11) */
4551 XChangeWindowSize (FRAME_X_WINDOW (f), pixelwidth, pixelheight); 4554 XChangeWindowSize (FRAME_X_WINDOW (f), pixelwidth, pixelheight);
4552 4555
@@ -4749,8 +4752,13 @@ x_make_frame_invisible (f)
4749 4752
4750#ifdef HAVE_X11R4 4753#ifdef HAVE_X11R4
4751 4754
4755#ifdef USE_X_TOOLKIT
4756 if (! XWithdrawWindow (x_current_display, XtWindow (f->display.x->widget),
4757 DefaultScreen (x_current_display)))
4758#else /* not USE_X_TOOLKIT */
4752 if (! XWithdrawWindow (x_current_display, FRAME_X_WINDOW (f), 4759 if (! XWithdrawWindow (x_current_display, FRAME_X_WINDOW (f),
4753 DefaultScreen (x_current_display))) 4760 DefaultScreen (x_current_display)))
4761#endif /* not USE_X_TOOLKIT */
4754 { 4762 {
4755 UNBLOCK_INPUT_RESIGNAL; 4763 UNBLOCK_INPUT_RESIGNAL;
4756 error ("can't notify window manager of window withdrawal"); 4764 error ("can't notify window manager of window withdrawal");
@@ -4765,7 +4773,11 @@ x_make_frame_invisible (f)
4765 XEvent unmap; 4773 XEvent unmap;
4766 4774
4767 unmap.xunmap.type = UnmapNotify; 4775 unmap.xunmap.type = UnmapNotify;
4776#ifdef USE_X_TOOLKIT
4777 unmap.xunmap.window = XtWindow (f->display.x->widget);
4778#else /* not USE_X_TOOLKIT */
4768 unmap.xunmap.window = FRAME_X_WINDOW (f); 4779 unmap.xunmap.window = FRAME_X_WINDOW (f);
4780#endif /* not USE_X_TOOLKIT */
4769 unmap.xunmap.event = DefaultRootWindow (x_current_display); 4781 unmap.xunmap.event = DefaultRootWindow (x_current_display);
4770 unmap.xunmap.from_configure = False; 4782 unmap.xunmap.from_configure = False;
4771 if (! XSendEvent (x_current_display, 4783 if (! XSendEvent (x_current_display,
@@ -4780,8 +4792,11 @@ x_make_frame_invisible (f)
4780 } 4792 }
4781 4793
4782 /* Unmap the window ourselves. Cheeky! */ 4794 /* Unmap the window ourselves. Cheeky! */
4795#ifdef USE_X_TOOLKIT
4796 XUnmapWindow (x_current_display, XtWindow (f->display.x->widget));
4797#else /* not USE_X_TOOLKIT */
4783 XUnmapWindow (x_current_display, FRAME_X_WINDOW (f)); 4798 XUnmapWindow (x_current_display, FRAME_X_WINDOW (f));
4784 4799#endif /* not USE_X_TOOLKIT */
4785#else /* ! defined (HAVE_X11) */ 4800#else /* ! defined (HAVE_X11) */
4786 4801
4787 XUnmapWindow (FRAME_X_WINDOW (f)); 4802 XUnmapWindow (FRAME_X_WINDOW (f));
@@ -4814,7 +4829,7 @@ x_iconify_frame (f)
4814#ifdef USE_X_TOOLKIT 4829#ifdef USE_X_TOOLKIT
4815 BLOCK_INPUT; 4830 BLOCK_INPUT;
4816 result = XIconifyWindow (x_current_display, 4831 result = XIconifyWindow (x_current_display,
4817 XtWindow(f->display.x->widget), 4832 XtWindow (f->display.x->widget),
4818 DefaultScreen (x_current_display)); 4833 DefaultScreen (x_current_display));
4819 UNBLOCK_INPUT; 4834 UNBLOCK_INPUT;
4820 4835
@@ -4990,18 +5005,24 @@ mouse_event_pending_p ()
4990 5005
4991#ifdef HAVE_X11 5006#ifdef HAVE_X11
4992 5007
5008/* Record the gravity used previously, in case CHANGE_GRAVITY is 0. */
5009static int previous_gravity;
5010
4993/* SPEC_X and SPEC_Y are the specified positions. 5011/* SPEC_X and SPEC_Y are the specified positions.
4994 We look only at their sign, to decide the gravity. */ 5012 We look only at their sign, to decide the gravity.
5013 If CHANGE_GRAVITY is 0, we ignore SPEC_X and SPEC_Y
5014 and leave the gravity unchanged. */
4995 5015
4996x_wm_set_size_hint (f, prompting, spec_x, spec_y) 5016x_wm_set_size_hint (f, prompting, change_gravity, spec_x, spec_y)
4997 struct frame *f; 5017 struct frame *f;
4998 long prompting; 5018 long prompting;
5019 int change_gravity;
4999 int spec_x, spec_y; 5020 int spec_x, spec_y;
5000{ 5021{
5001 XSizeHints size_hints; 5022 XSizeHints size_hints;
5002 5023
5003#ifdef USE_X_TOOLKIT 5024#ifdef USE_X_TOOLKIT
5004 Window window = XtWindow(f->display.x->widget); 5025 Window window = XtWindow (f->display.x->widget);
5005#else /* not USE_X_TOOLKIT */ 5026#else /* not USE_X_TOOLKIT */
5006 Window window = FRAME_X_WINDOW (f); 5027 Window window = FRAME_X_WINDOW (f);
5007#endif /* not USE_X_TOOLKIT */ 5028#endif /* not USE_X_TOOLKIT */
@@ -5072,21 +5093,28 @@ x_wm_set_size_hint (f, prompting, spec_x, spec_y)
5072 size_hints.flags |= USSize; 5093 size_hints.flags |= USSize;
5073 } 5094 }
5074#if defined (PWinGravity) 5095#if defined (PWinGravity)
5075 switch (((spec_x < 0) << 1) + (spec_y < 0)) 5096 if (change_gravity)
5076 { 5097 {
5077 case 0: 5098 switch (((spec_x < 0) << 1) + (spec_y < 0))
5078 size_hints.win_gravity = NorthWestGravity; 5099 {
5079 break; 5100 case 0:
5080 case 1: 5101 size_hints.win_gravity = NorthWestGravity;
5081 size_hints.win_gravity = NorthEastGravity; 5102 break;
5082 break; 5103 case 1:
5083 case 2: 5104 size_hints.win_gravity = NorthEastGravity;
5084 size_hints.win_gravity = SouthWestGravity; 5105 break;
5085 break; 5106 case 2:
5086 case 3: 5107 size_hints.win_gravity = SouthWestGravity;
5087 size_hints.win_gravity = SouthEastGravity; 5108 break;
5088 break; 5109 case 3:
5110 size_hints.win_gravity = SouthEastGravity;
5111 break;
5112 }
5113 previous_gravity = size_hints.win_gravity;
5089 } 5114 }
5115 else
5116 size_hints.win_gravity = previous_gravity;
5117
5090 size_hints.flags |= PWinGravity; 5118 size_hints.flags |= PWinGravity;
5091#endif /* PWinGravity */ 5119#endif /* PWinGravity */
5092 5120
@@ -5103,7 +5131,7 @@ x_wm_set_window_state (f, state)
5103 int state; 5131 int state;
5104{ 5132{
5105#ifdef USE_X_TOOLKIT 5133#ifdef USE_X_TOOLKIT
5106 Window window = XtWindow(f->display.x->widget); 5134 Window window = XtWindow (f->display.x->widget);
5107#else /* not USE_X_TOOLKIT */ 5135#else /* not USE_X_TOOLKIT */
5108 Window window = FRAME_X_WINDOW (f); 5136 Window window = FRAME_X_WINDOW (f);
5109#endif /* not USE_X_TOOLKIT */ 5137#endif /* not USE_X_TOOLKIT */
@@ -5189,7 +5217,7 @@ x_term_init (display_name)
5189 argv [2] = display_name; 5217 argv [2] = display_name;
5190 argc = 3; 5218 argc = 3;
5191 Xt_app_shell = XtAppInitialize (&Xt_app_con, "Emacs", 5219 Xt_app_shell = XtAppInitialize (&Xt_app_con, "Emacs",
5192 emacs_options, XtNumber(emacs_options), 5220 emacs_options, XtNumber (emacs_options),
5193 &argc, argv, 5221 &argc, argv,
5194 NULL, NULL, 0); 5222 NULL, NULL, 0);
5195 XtFree (argv); 5223 XtFree (argv);