#include <config.h>
/* Need syssignal.h for various externs and definitions that may be required
- * by some configurations for calls to signal() later in this source file.
- */
+ by some configurations for calls to signal later in this source file. */
#include "syssignal.h"
#ifdef HAVE_X_WINDOWS
/* Make audible bell. */
#ifdef HAVE_X11
-#define XRINGBELL XBell(x_current_display, 0)
+#define XRINGBELL XBell (x_current_display, 0)
#else /* ! defined (HAVE_X11) */
-#define XRINGBELL XFeep(0);
+#define XRINGBELL XFeep (0);
#endif /* ! defined (HAVE_X11) */
XTring_bell ()
! GC_NILP (bar) || (bar = condemned,
condemned = Qnil,
! GC_NILP (bar));
- bar = XSCROLL_BAR(bar)->next)
+ bar = XSCROLL_BAR (bar)->next)
if (SCROLL_BAR_X_WINDOW (XSCROLL_BAR (bar)) == window_id)
return XSCROLL_BAR (bar);
}
Calling x_uncatch_errors resumes the normal error handling. */
-void x_catch_errors(), x_check_errors (), x_uncatch_errors ();
+void x_catch_errors (), x_check_errors (), x_uncatch_errors ();
void
x_catch_errors ()
XSetFont (x_current_display, f->display.x->cursor_gc,
f->display.x->font->fid);
- x_set_window_size (f, f->width, f->height);
+ x_set_window_size (f, 0, f->width, f->height);
}
{
f->display.x->font = temp;
if (FRAME_X_WINDOW (f) != 0)
- x_set_window_size (f, f->width, f->height);
+ x_set_window_size (f, 0, f->width, f->height);
return 0;
}
f->display.x->left_pos, f->display.x->top_pos);
#endif /* not USE_X_TOOLKIT */
#ifdef HAVE_X11
- x_wm_set_size_hint (f, 0, xoff, yoff);
+ x_wm_set_size_hint (f, 0, 1, xoff, yoff);
#endif /* ! defined (HAVE_X11) */
UNBLOCK_INPUT;
}
-/* Call this to change the size of frame F's x-window. */
+/* Call this to change the size of frame F's x-window.
+ If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity
+ for this size change and subsequent size changes.
+ Otherwise we leave the window gravity unchanged. */
-x_set_window_size (f, cols, rows)
+x_set_window_size (f, change_gravity, cols, rows)
struct frame *f;
+ int change_gravity;
int cols, rows;
{
int pixelwidth, pixelheight;
pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows);
#ifdef HAVE_X11
- x_wm_set_size_hint (f, 0, 0, 0);
+ x_wm_set_size_hint (f, 0, change_gravity, 0, 0);
#endif /* ! defined (HAVE_X11) */
XChangeWindowSize (FRAME_X_WINDOW (f), pixelwidth, pixelheight);
#ifdef HAVE_X11R4
+#ifdef USE_X_TOOLKIT
+ if (! XWithdrawWindow (x_current_display, XtWindow (f->display.x->widget),
+ DefaultScreen (x_current_display)))
+#else /* not USE_X_TOOLKIT */
if (! XWithdrawWindow (x_current_display, FRAME_X_WINDOW (f),
DefaultScreen (x_current_display)))
+#endif /* not USE_X_TOOLKIT */
{
UNBLOCK_INPUT_RESIGNAL;
error ("can't notify window manager of window withdrawal");
XEvent unmap;
unmap.xunmap.type = UnmapNotify;
+#ifdef USE_X_TOOLKIT
+ unmap.xunmap.window = XtWindow (f->display.x->widget);
+#else /* not USE_X_TOOLKIT */
unmap.xunmap.window = FRAME_X_WINDOW (f);
+#endif /* not USE_X_TOOLKIT */
unmap.xunmap.event = DefaultRootWindow (x_current_display);
unmap.xunmap.from_configure = False;
if (! XSendEvent (x_current_display,
}
/* Unmap the window ourselves. Cheeky! */
+#ifdef USE_X_TOOLKIT
+ XUnmapWindow (x_current_display, XtWindow (f->display.x->widget));
+#else /* not USE_X_TOOLKIT */
XUnmapWindow (x_current_display, FRAME_X_WINDOW (f));
-
+#endif /* not USE_X_TOOLKIT */
#else /* ! defined (HAVE_X11) */
XUnmapWindow (FRAME_X_WINDOW (f));
#ifdef USE_X_TOOLKIT
BLOCK_INPUT;
result = XIconifyWindow (x_current_display,
- XtWindow(f->display.x->widget),
+ XtWindow (f->display.x->widget),
DefaultScreen (x_current_display));
UNBLOCK_INPUT;
#ifdef HAVE_X11
+/* Record the gravity used previously, in case CHANGE_GRAVITY is 0. */
+static int previous_gravity;
+
/* SPEC_X and SPEC_Y are the specified positions.
- We look only at their sign, to decide the gravity. */
+ We look only at their sign, to decide the gravity.
+ If CHANGE_GRAVITY is 0, we ignore SPEC_X and SPEC_Y
+ and leave the gravity unchanged. */
-x_wm_set_size_hint (f, prompting, spec_x, spec_y)
+x_wm_set_size_hint (f, prompting, change_gravity, spec_x, spec_y)
struct frame *f;
long prompting;
+ int change_gravity;
int spec_x, spec_y;
{
XSizeHints size_hints;
#ifdef USE_X_TOOLKIT
- Window window = XtWindow(f->display.x->widget);
+ Window window = XtWindow (f->display.x->widget);
#else /* not USE_X_TOOLKIT */
Window window = FRAME_X_WINDOW (f);
#endif /* not USE_X_TOOLKIT */
size_hints.flags |= USSize;
}
#if defined (PWinGravity)
- switch (((spec_x < 0) << 1) + (spec_y < 0))
+ if (change_gravity)
{
- case 0:
- size_hints.win_gravity = NorthWestGravity;
- break;
- case 1:
- size_hints.win_gravity = NorthEastGravity;
- break;
- case 2:
- size_hints.win_gravity = SouthWestGravity;
- break;
- case 3:
- size_hints.win_gravity = SouthEastGravity;
- break;
+ switch (((spec_x < 0) << 1) + (spec_y < 0))
+ {
+ case 0:
+ size_hints.win_gravity = NorthWestGravity;
+ break;
+ case 1:
+ size_hints.win_gravity = NorthEastGravity;
+ break;
+ case 2:
+ size_hints.win_gravity = SouthWestGravity;
+ break;
+ case 3:
+ size_hints.win_gravity = SouthEastGravity;
+ break;
+ }
+ previous_gravity = size_hints.win_gravity;
}
+ else
+ size_hints.win_gravity = previous_gravity;
+
size_hints.flags |= PWinGravity;
#endif /* PWinGravity */
int state;
{
#ifdef USE_X_TOOLKIT
- Window window = XtWindow(f->display.x->widget);
+ Window window = XtWindow (f->display.x->widget);
#else /* not USE_X_TOOLKIT */
Window window = FRAME_X_WINDOW (f);
#endif /* not USE_X_TOOLKIT */
argv [2] = display_name;
argc = 3;
Xt_app_shell = XtAppInitialize (&Xt_app_con, "Emacs",
- emacs_options, XtNumber(emacs_options),
+ emacs_options, XtNumber (emacs_options),
&argc, argv,
NULL, NULL, 0);
XtFree (argv);