/* We can't distinguish, from the event, whether the window
has become iconified or invisible. So assume, if it
was previously visible, than now it is iconified.
- We depend on x_make_frame_invisible to mark it invisible. */
+ But x_make_frame_invisible clears both
+ the visible flag and the iconified flag;
+ and that way, we know the window is not iconified now. */
if (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f))
- f->async_iconified = 1;
+ {
+ f->async_iconified = 1;
- bufp->kind = iconify_event;
- XSETFRAME (bufp->frame_or_window, f);
- bufp++;
- count++;
- numchars--;
+ bufp->kind = iconify_event;
+ XSETFRAME (bufp->frame_or_window, f);
+ bufp++;
+ count++;
+ numchars--;
+ }
}
goto OTHER;
{
int mask;
Lisp_Object type;
+ int starting_flags = f->output_data.x->size_hint_flags;
+ int original_top, original_left;
BLOCK_INPUT;
if (! FRAME_VISIBLE_P (f))
{
+ /* We test FRAME_GARBAGED_P here to make sure we don't
+ call x_set_offset a second time
+ if we get to x_make_frame_visible a second time
+ before the window gets really visible. */
+ if (! FRAME_ICONIFIED_P (f)
+ && ! f->output_data.x->asked_for_visible)
+ x_set_offset (f, f->output_data.x->left_pos, f->output_data.x->top_pos, 0);
+
+ f->output_data.x->asked_for_visible = 1;
+
if (! EQ (Vx_no_window_manager, Qt))
x_wm_set_window_state (f, NormalState);
#ifdef USE_X_TOOLKIT
{
Lisp_Object frame;
int count = input_signal_count;
- int orig_left = f->output_data.x->left_pos;
- int orig_top = f->output_data.x->top_pos;
+
+ original_left = f->output_data.x->left_pos;
+ original_top = f->output_data.x->top_pos;
/* This must come after we set COUNT. */
UNBLOCK_INPUT;
- /* We test asked_for_visible here to make sure we don't
- call x_set_offset a second time
- if we get to x_make_frame_visible a second time
- before the window gets really visible. */
- if (! FRAME_ICONIFIED_P (f)
- && ! f->output_data.x->asked_for_visible)
- x_set_offset (f, orig_left, orig_top, 0);
+ /* Arriving X events are processed here. */
+
+ /* Now move the window back to where it was "supposed to be". */
+
+ if (! (starting_flags & (XNegative | YNegative)))
+ {
+ BLOCK_INPUT;
- f->output_data.x->asked_for_visible = 1;
+#ifdef USE_X_TOOLKIT
+ XMoveWindow (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget),
+ original_left, original_top);
+#else /* not USE_X_TOOLKIT */
+ XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ original_left, original_top);
+#endif /* not USE_X_TOOLKIT */
+ UNBLOCK_INPUT;
+ }
XSETFRAME (frame, f);