mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-08 12:40:49 -08:00
Minor fixes to Haiku DND support
* src/haiku_support.cc (MessageReceived): If source is remote, don't test window ID. (MouseMoved): Don't send mouse motion if dragging. (be_drag_message): Return true if quit-flag. * src/haiku_support.h: Update prototypes. * src/haikuselect.c (haiku_should_quit_drag): New function. (Fhaiku_drag_message): If rc is true, quit.
This commit is contained in:
parent
7cee796556
commit
efb76604c4
3 changed files with 30 additions and 10 deletions
|
|
@ -645,6 +645,7 @@ public:
|
|||
struct haiku_drag_and_drop_event rq;
|
||||
|
||||
if (msg->FindInt32 ("emacs:window_id", &windowid) == B_OK
|
||||
&& !msg->IsSourceRemote ()
|
||||
&& windowid == this->window_id)
|
||||
return;
|
||||
|
||||
|
|
@ -1449,7 +1450,7 @@ public:
|
|||
}
|
||||
|
||||
void
|
||||
MouseMoved (BPoint point, uint32 transit, const BMessage *msg)
|
||||
MouseMoved (BPoint point, uint32 transit, const BMessage *drag_msg)
|
||||
{
|
||||
struct haiku_mouse_motion_event rq;
|
||||
|
||||
|
|
@ -1459,6 +1460,9 @@ public:
|
|||
rq.window = this->Window ();
|
||||
rq.time = system_time ();
|
||||
|
||||
if (drag_msg && transit != B_EXITED_VIEW)
|
||||
return;
|
||||
|
||||
if (ToolTip ())
|
||||
ToolTip ()->SetMouseRelativeLocation (BPoint (-(point.x - tt_absl_pos.x),
|
||||
-(point.y - tt_absl_pos.y)));
|
||||
|
|
@ -3960,11 +3964,12 @@ be_drag_message_thread_entry (void *thread_data)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
be_drag_message (void *view, void *message,
|
||||
void (*block_input_function) (void),
|
||||
void (*unblock_input_function) (void),
|
||||
void (*process_pending_signals_function) (void))
|
||||
void (*process_pending_signals_function) (void),
|
||||
bool (*should_quit_function) (void))
|
||||
{
|
||||
EmacsView *vw = (EmacsView *) view;
|
||||
EmacsWindow *window = (EmacsWindow *) vw->Window ();
|
||||
|
|
@ -3995,7 +4000,7 @@ be_drag_message (void *view, void *message,
|
|||
unblock_input_function ();
|
||||
|
||||
if (infos[1].object < B_OK)
|
||||
return;
|
||||
return false;
|
||||
|
||||
block_input_function ();
|
||||
resume_thread (infos[1].object);
|
||||
|
|
@ -4017,8 +4022,11 @@ be_drag_message (void *view, void *message,
|
|||
if (infos[0].events & B_EVENT_READ)
|
||||
process_pending_signals_function ();
|
||||
|
||||
if (should_quit_function ())
|
||||
return true;
|
||||
|
||||
if (infos[1].events & B_EVENT_INVALID)
|
||||
return;
|
||||
return false;
|
||||
|
||||
infos[0].events = B_EVENT_READ;
|
||||
infos[1].events = B_EVENT_INVALID;
|
||||
|
|
|
|||
|
|
@ -945,11 +945,12 @@ extern "C"
|
|||
extern void
|
||||
BMessage_delete (void *message);
|
||||
|
||||
extern void
|
||||
extern bool
|
||||
be_drag_message (void *view, void *message,
|
||||
void (*block_input_function) (void),
|
||||
void (*unblock_input_function) (void),
|
||||
void (*process_pending_signals_function) (void));
|
||||
void (*process_pending_signals_function) (void),
|
||||
bool (*should_quit_function) (void));
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern void *
|
||||
|
|
|
|||
|
|
@ -506,6 +506,12 @@ haiku_lisp_to_message (Lisp_Object obj, void *message)
|
|||
CHECK_LIST_END (tem, obj);
|
||||
}
|
||||
|
||||
static bool
|
||||
haiku_should_quit_drag (void)
|
||||
{
|
||||
return !NILP (Vquit_flag);
|
||||
}
|
||||
|
||||
DEFUN ("haiku-drag-message", Fhaiku_drag_message, Shaiku_drag_message,
|
||||
2, 2, 0,
|
||||
doc: /* Begin dragging MESSAGE from FRAME.
|
||||
|
|
@ -530,6 +536,7 @@ drag will originate. */)
|
|||
specpdl_ref idx;
|
||||
void *be_message;
|
||||
struct frame *f;
|
||||
bool rc;
|
||||
|
||||
idx = SPECPDL_INDEX ();
|
||||
f = decode_window_system_frame (frame);
|
||||
|
|
@ -541,11 +548,15 @@ drag will originate. */)
|
|||
|
||||
record_unwind_protect_ptr (BMessage_delete, be_message);
|
||||
haiku_lisp_to_message (message, be_message);
|
||||
be_drag_message (FRAME_HAIKU_VIEW (f), be_message,
|
||||
block_input, unblock_input,
|
||||
process_pending_signals);
|
||||
rc = be_drag_message (FRAME_HAIKU_VIEW (f), be_message,
|
||||
block_input, unblock_input,
|
||||
process_pending_signals,
|
||||
haiku_should_quit_drag);
|
||||
FRAME_DISPLAY_INFO (f)->grabbed = 0;
|
||||
|
||||
if (rc)
|
||||
quit ();
|
||||
|
||||
return unbind_to (idx, Qnil);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue