X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=src%2Fevent-msw.c;h=e4e1be5c9ef510ad7989afc9f0ac817abe464645;hp=4745a6653a151f9857b547b05d459ae346a6ebda;hb=426fe636212336bb32a5e6f187c4d623709fa57d;hpb=02f4d2761a98c5cb9d5b423d2361160a5d8c9ee4 diff --git a/src/event-msw.c b/src/event-msw.c index 4745a66..e4e1be5 100644 --- a/src/event-msw.c +++ b/src/event-msw.c @@ -93,7 +93,7 @@ typedef unsigned int SOCKET; /* Timer ID used for button2 emulation */ #define BUTTON_2_TIMER_ID 1 -static Lisp_Object mswindows_find_frame (HWND hwnd); +Lisp_Object mswindows_find_frame (HWND hwnd); static Lisp_Object mswindows_find_console (HWND hwnd); static Lisp_Object mswindows_key_to_emacs_keysym (int mswindows_key, int mods, int extendedp); @@ -232,6 +232,7 @@ slurper_free_shared_data_maybe (struct ntpipe_slurp_stream_shared_data* s) CloseHandle (s->hev_thread); CloseHandle (s->hev_caller); CloseHandle (s->hev_unsleep); + CloseHandle (s->hpipe); s->inuse_p = 0; } } @@ -1610,6 +1611,8 @@ mswindows_wm_timer_callback (HWND hwnd, UINT umsg, UINT id_timer, DWORD dwtime) * depends on dnd support. */ #ifdef HAVE_DRAGNDROP +extern int mswindows_dde_enable; + HDDEDATA CALLBACK mswindows_dde_callback (UINT uType, UINT uFmt, HCONV hconv, HSZ hszTopic, HSZ hszItem, HDDEDATA hdata, @@ -1636,6 +1639,9 @@ mswindows_dde_callback (UINT uType, UINT uFmt, HCONV hconv, return (HDDEDATA)NULL; case XTYP_EXECUTE: + if (!mswindows_dde_enable) + return (HDDEDATA) DDE_FBUSY; + if (!DdeCmpStringHandles (hszTopic, mswindows_dde_topic_system)) { DWORD len = DdeGetData (hdata, NULL, 0, 0); @@ -1643,7 +1649,7 @@ mswindows_dde_callback (UINT uType, UINT uFmt, HCONV hconv, char *end; char *filename; struct gcpro gcpro1, gcpro2; - Lisp_Object l_dndlist = Qnil; + Lisp_Object l_dndlist = Qnil; Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); Lisp_Object frmcons, devcons, concons; Lisp_Event *event = XEVENT (emacs_event); @@ -2064,17 +2070,9 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam) struct frame *frame; struct mswindows_frame* msframe; - /* Not perfect but avoids crashes. There is potential for wierd - behavior here. */ - if (gc_in_progress) - { - mswindows_output_console_string ("Window procedure called during GC???????\n", 41); - /* Yes, this assert always triggers in a --debug XEmacs. But - --debug=no is default in the stable branches. - #### How about patch in <200106081225.IAA31075@gwyn.tux.org>? */ - assert (!gc_in_progress); - goto defproc; - } + /* If you hit this, rewrite the offending API call to occur after GC, + using register_post_gc_action(). */ + assert (!gc_in_progress); #ifdef DEBUG_XEMACS if (debug_mswindows_events) @@ -2830,7 +2828,8 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam) MAKEPOINTS (lParam))) { GCPRO2 (emacs_event, fobj); - mswindows_pump_outstanding_events (); /* Can GC */ + if (UNBOUNDP(mswindows_pump_outstanding_events ())) /* Can GC */ + SendMessage (hwnd, WM_CANCELMODE, 0, 0); UNGCPRO; } else @@ -3279,7 +3278,7 @@ mswindows_find_console (HWND hwnd) /* * Find the frame that matches the supplied mswindows window handle */ -static Lisp_Object +Lisp_Object mswindows_find_frame (HWND hwnd) { LONG l = GetWindowLong (hwnd, XWL_FRAMEOBJ); @@ -3781,7 +3780,9 @@ FROB (WM_NCHITTEST) FROB (WM_NCPAINT) FROB (WM_NCACTIVATE) FROB (WM_GETDLGCODE) +#ifdef WM_SYNCPAINT /* not in VC 5 */ FROB (WM_SYNCPAINT) +#endif /* WM_SYNCPAINT */ FROB (WM_NCMOUSEMOVE) FROB (WM_NCLBUTTONDOWN) FROB (WM_NCLBUTTONUP) @@ -3804,12 +3805,12 @@ FROB (WM_SYSCHAR) FROB (WM_SYSDEADCHAR) FROB (WM_KEYLAST) -#if(WINVER >= 0x0400) && !defined(CYGWIN) +#if(WINVER >= 0x0400) && defined (WM_IME_STARTCOMPOSITION) FROB (WM_IME_STARTCOMPOSITION) FROB (WM_IME_ENDCOMPOSITION) FROB (WM_IME_COMPOSITION) FROB (WM_IME_KEYLAST) -#endif /* WINVER >= 0x0400 */ +#endif /* WINVER >= 0x0400 && defined (WM_IME_STARTCOMPOSITION) */ FROB (WM_INITDIALOG) FROB (WM_COMMAND) @@ -3893,6 +3894,7 @@ FROB (WM_EXITSIZEMOVE) FROB (WM_DROPFILES) FROB (WM_MDIREFRESHMENU) +#ifdef WM_IME_SETCONTEXT /* not in Cygwin? */ #if(WINVER >= 0x0400) && !defined(CYGWIN) FROB (WM_IME_SETCONTEXT) @@ -3910,6 +3912,7 @@ FROB (WM_IME_KEYDOWN) FROB (WM_IME_KEYUP) #endif /* WINVER >= 0x0400 */ +#endif /* WM_IME_SETCONTEXT */ #if(_WIN32_WINNT >= 0x0400) FROB (WM_MOUSEHOVER)