struct input_event *bufp;
{
struct frame *frame;
- int nr_events = 0;
frame = x_any_window_to_frame (dpyinfo, event->xany.window);
if (! frame)
f = x_top_window_to_frame (dpyinfo, event.xmap.window);
if (f)
{
- /* wait_reading_process_input will notice this and update
+ /* wait_reading_process_output will notice this and update
the frame's display structures.
If we where iconified, we should not set garbaged,
because that stops redrawing on Expose events. This looks
x_catch_errors_unwind (old_val)
Lisp_Object old_val;
{
- Lisp_Object first;
+ Lisp_Object first = XCAR (old_val);
+ Display *dpy = XSAVE_VALUE (first)->pointer;
- first = XCAR (old_val);
-
- XSync (XSAVE_VALUE (first)->pointer, False);
+ /* The display may have been closed before this function is called.
+ Check if it is still open before calling XSync. */
+ if (x_display_info_for_display (dpy) != 0)
+ XSync (dpy, False);
x_error_message_string = XCDR (old_val);
return Qnil;
x_calc_absolute_position (f)
struct frame *f;
{
- Window child;
int win_x = 0, win_y = 0;
int flags = f->size_hint_flags;
int screen_number = XScreenNumberOfScreen (dpyinfo->screen);
double pixels = DisplayHeight (dpyinfo->display, screen_number);
double mm = DisplayHeightMM (dpyinfo->display, screen_number);
- dpyinfo->resy = pixels * 25.4 / mm;
+ /* Mac OS X 10.3's Xserver sometimes reports 0.0mm. */
+ dpyinfo->resy = (mm < 1) ? 100 : pixels * 25.4 / mm;
pixels = DisplayWidth (dpyinfo->display, screen_number);
+ /* Mac OS X 10.3's Xserver sometimes reports 0.0mm. */
mm = DisplayWidthMM (dpyinfo->display, screen_number);
- dpyinfo->resx = pixels * 25.4 / mm;
+ dpyinfo->resx = (mm < 1) ? 100 : pixels * 25.4 / mm;
}
dpyinfo->Xatom_wm_protocols