+#endif
+ /* We just reset the size and position of the minibuffer, to its old
+ value, which needn't be valid. So we do some magic to see which value
+ to actually take. Then we set it.
+
+ The magic:
+ We take the old value if is in the same units but differs from the
+ current value.
+
+ #### Now we get more cases correct then ever before, but
+ are we treating all? For instance what if the frames minibuf window
+ is no longer the same one?
+ */
+ target_minibuf_height = previous_minibuf_height;
+ if (converted_minibuf_height &&
+ (converted_minibuf_height * config->minibuf_height) > 0 &&
+ (converted_minibuf_height != config->minibuf_height))
+ {
+ target_minibuf_height = config->minibuf_height < 0 ?
+ - (config->minibuf_height * real_font_height) :
+ config->minibuf_height;
+ target_minibuf_height =
+ max(target_minibuf_height,real_font_height);
+ }
+ if (previous_minibuf_height)
+ {
+ XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top
+ = previous_minibuf_top -
+ (target_minibuf_height - previous_minibuf_height);
+ set_window_pixheight (FRAME_MINIBUF_WINDOW (f),
+ target_minibuf_height, 0);
+ set_window_pixwidth (FRAME_MINIBUF_WINDOW (f),
+ previous_minibuf_width, 0);
+ }
+
+ /* This is a better way to deal with frame resizing, etc.
+ What we _actually_ want is for the old (just restored)
+ root window to fit
+ into the place of the new one. So we just do that. Simple! */
+ XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top = previous_pixel_top;
+ /* Note that this function also updates the subwindow
+ "pixel_top"s */
+ set_window_pixheight (FRAME_ROOT_WINDOW (f),
+ previous_pixel_height -
+ (target_minibuf_height - previous_minibuf_height), 0);
+ XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = previous_pixel_left;
+ /* Note that this function also updates the subwindow
+ "pixel_left"s */
+ set_window_pixwidth (FRAME_ROOT_WINDOW (f), previous_pixel_width, 0);