summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Rumney <jasonr@gnu.org>2001-10-27 22:30:55 +0000
committerJason Rumney <jasonr@gnu.org>2001-10-27 22:30:55 +0000
commit65906840aeb3196b0a0bd97e6f65c63bc225e081 (patch)
treee0c15cc7fa24814095e65b6ed44587a7081c5a0a /src
parentabb15ebda6ca4e0666881173ae1db9df06cbb8a1 (diff)
downloademacs-65906840aeb3196b0a0bd97e6f65c63bc225e081.tar.gz
(w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
<WM_EMACS_DESTROY_CARET, WM_EMACS_TRACK_CARET>: Track cursor position using the system caret.
Diffstat (limited to 'src')
-rw-r--r--src/w32fns.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index a4ad1e49c20..55af56303eb 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -307,6 +307,12 @@ int image_cache_refcount, dpyinfo_refcount;
extern Lisp_Object Vw32_num_mouse_buttons;
extern Lisp_Object Vw32_recognize_altgr;
+extern HWND w32_system_caret_hwnd;
+extern int w32_system_caret_width;
+extern int w32_system_caret_height;
+extern int w32_system_caret_x;
+extern int w32_system_caret_y;
+
/* Error if we are not connected to MS-Windows. */
void
@@ -4785,6 +4791,12 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
unregister_hot_keys (hwnd);
button_state = 0;
ReleaseCapture ();
+ /* Relinquish the system caret. */
+ if (w32_system_caret_hwnd)
+ {
+ DestroyCaret ();
+ w32_system_caret_hwnd = NULL;
+ }
case WM_MOVE:
case WM_SIZE:
case WM_COMMAND:
@@ -4926,6 +4938,20 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
DragAcceptFiles ((HWND) wParam, FALSE);
return DestroyWindow ((HWND) wParam);
+ case WM_EMACS_DESTROY_CARET:
+ w32_system_caret_hwnd = NULL;
+ return DestroyCaret ();
+
+ case WM_EMACS_TRACK_CARET:
+ /* If there is currently no system caret, create one. */
+ if (w32_system_caret_hwnd == NULL)
+ {
+ w32_system_caret_hwnd = hwnd;
+ CreateCaret (hwnd, NULL, w32_system_caret_width,
+ w32_system_caret_height);
+ }
+ return SetCaretPos (w32_system_caret_x, w32_system_caret_y);
+
case WM_EMACS_TRACKPOPUPMENU:
{
UINT flags;