+
+ if (EQ (get_frame_param (f, Qfullscreen), Qnil))
+ set_frame_param (f, Qfullscreen, Qmaximized);
+ else if (! EQ (get_frame_param (f, Qfullscreen), Qmaximized))
+ set_frame_param (f, Qmaximized, Qmaximized);
+
+ break;
+
+ case SIZE_RESTORED:
+ {
+ bool iconified = FRAME_ICONIFIED_P (f);
+
+ if (iconified)
+ SET_FRAME_VISIBLE (f, 1);
+ SET_FRAME_ICONIFIED (f, 0);
+
+ /* wait_reading_process_output will notice this
+ and update the frame's display structures. */
+ SET_FRAME_GARBAGED (f);
+
+ if (iconified)
+ {
+ /* Reset top and left positions of the Window
+ here since Windows sends a WM_MOVE message
+ BEFORE telling us the Window is minimized
+ when the Window is iconified, with 3000,3000
+ as the co-ords. */
+ x_real_positions (f, &f->left_pos, &f->top_pos);
+
+ inev.kind = DEICONIFY_EVENT;
+ XSETFRAME (inev.frame_or_window, f);
+ }
+ else if (! NILP (Vframe_list)
+ && ! NILP (XCDR (Vframe_list)))
+ /* Force a redisplay sooner or later
+ to update the frame titles
+ in case this is the second frame. */
+ record_asynch_buffer_change ();
+ }
+
+ if (EQ (get_frame_param (f, Qfullscreen), Qmaximized))
+ set_frame_param (f, Qfullscreen, Qnil);
+ else if (! EQ (get_frame_param (f, Qmaximized), Qnil))
+ set_frame_param (f, Qmaximized, Qnil);
+