#include <stdlib.h>
+bool haiku_dnd_in_progress;
static void haiku_lisp_to_message (Lisp_Object, void *);
DEFUN ("haiku-selection-data", Fhaiku_selection_data, Shaiku_selection_data,
return !NILP (Vquit_flag);
}
+static void
+haiku_unwind_drag_message (void *message)
+{
+ BMessage_delete (message);
+ haiku_dnd_in_progress = false;
+}
+
DEFUN ("haiku-drag-message", Fhaiku_drag_message, Shaiku_drag_message,
2, 3, 0,
doc: /* Begin dragging MESSAGE from FRAME.
if (!FRAME_VISIBLE_P (f))
error ("Frame is invisible");
+ haiku_dnd_in_progress = true;
be_message = be_create_simple_message ();
- record_unwind_protect_ptr (BMessage_delete, be_message);
+ record_unwind_protect_ptr (haiku_unwind_drag_message, be_message);
haiku_lisp_to_message (message, be_message);
rc = be_drag_message (FRAME_HAIKU_VIEW (f), be_message,
!NILP (allow_same_frame),
uint8_t buffer[200];
};
-static bool any_help_event_p = false;
+static bool any_help_event_p;
char *
get_keysym_name (int keysym)
do_help = 1;
}
- need_flush = FRAME_DIRTY_P (f);
+ if (FRAME_DIRTY_P (f))
+ need_flush = 1;
break;
}
case BUTTON_UP: