comparison src/w32fns.c @ 40385:b3dbd98f9b97

(w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret. <WM_EMACS_DESTROY_CARET, WM_EMACS_TRACK_CARET>: Track cursor position using the system caret.
author Jason Rumney <jasonr@gnu.org>
date Sat, 27 Oct 2001 22:30:55 +0000
parents 03eb905a4d8e
children 7fb50bbb61ad
comparison
equal deleted inserted replaced
40384:25e6d4bb5f7f 40385:b3dbd98f9b97
304 304
305 305
306 /* From w32term.c. */ 306 /* From w32term.c. */
307 extern Lisp_Object Vw32_num_mouse_buttons; 307 extern Lisp_Object Vw32_num_mouse_buttons;
308 extern Lisp_Object Vw32_recognize_altgr; 308 extern Lisp_Object Vw32_recognize_altgr;
309
310 extern HWND w32_system_caret_hwnd;
311 extern int w32_system_caret_width;
312 extern int w32_system_caret_height;
313 extern int w32_system_caret_x;
314 extern int w32_system_caret_y;
309 315
310 316
311 /* Error if we are not connected to MS-Windows. */ 317 /* Error if we are not connected to MS-Windows. */
312 void 318 void
313 check_w32 () 319 check_w32 ()
4783 goto command; 4789 goto command;
4784 case WM_KILLFOCUS: 4790 case WM_KILLFOCUS:
4785 unregister_hot_keys (hwnd); 4791 unregister_hot_keys (hwnd);
4786 button_state = 0; 4792 button_state = 0;
4787 ReleaseCapture (); 4793 ReleaseCapture ();
4794 /* Relinquish the system caret. */
4795 if (w32_system_caret_hwnd)
4796 {
4797 DestroyCaret ();
4798 w32_system_caret_hwnd = NULL;
4799 }
4788 case WM_MOVE: 4800 case WM_MOVE:
4789 case WM_SIZE: 4801 case WM_SIZE:
4790 case WM_COMMAND: 4802 case WM_COMMAND:
4791 command: 4803 command:
4792 wmsg.dwModifiers = w32_get_modifiers (); 4804 wmsg.dwModifiers = w32_get_modifiers ();
4923 } 4935 }
4924 4936
4925 case WM_EMACS_DESTROYWINDOW: 4937 case WM_EMACS_DESTROYWINDOW:
4926 DragAcceptFiles ((HWND) wParam, FALSE); 4938 DragAcceptFiles ((HWND) wParam, FALSE);
4927 return DestroyWindow ((HWND) wParam); 4939 return DestroyWindow ((HWND) wParam);
4940
4941 case WM_EMACS_DESTROY_CARET:
4942 w32_system_caret_hwnd = NULL;
4943 return DestroyCaret ();
4944
4945 case WM_EMACS_TRACK_CARET:
4946 /* If there is currently no system caret, create one. */
4947 if (w32_system_caret_hwnd == NULL)
4948 {
4949 w32_system_caret_hwnd = hwnd;
4950 CreateCaret (hwnd, NULL, w32_system_caret_width,
4951 w32_system_caret_height);
4952 }
4953 return SetCaretPos (w32_system_caret_x, w32_system_caret_y);
4928 4954
4929 case WM_EMACS_TRACKPOPUPMENU: 4955 case WM_EMACS_TRACKPOPUPMENU:
4930 { 4956 {
4931 UINT flags; 4957 UINT flags;
4932 POINT *pos; 4958 POINT *pos;