Commit 945c5bb1 authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

Followup to 2013-07-16T11:41:06Z!jan.h.d@swipnet.se.

* lisp/frame.el (blink-cursor-timer-function, blink-cursor-suspend):
  Add check for W32.
* src/keyboard.c (kbd_buffer_get_event):
* src/w32term.c (x_focus_changed): Port FOCUS_(IN|OUT)_EVENT changes to W32.
parent abd2f2a4
2013-07-18 Juanma Barranquero <lekktu@gmail.com>
* frame.el (blink-cursor-timer-function, blink-cursor-suspend):
Add check for W32 (followup to 2013-07-16T11:41:06Z!jan.h.d@swipnet.se).
2013-07-18 Michael Albinus <michael.albinus@gmx.de> 2013-07-18 Michael Albinus <michael.albinus@gmx.de>
* filenotify.el (file-notify--library): Renamed from * filenotify.el (file-notify--library): Renamed from
......
...@@ -1709,7 +1709,7 @@ command starts, by installing a pre-command hook." ...@@ -1709,7 +1709,7 @@ command starts, by installing a pre-command hook."
"Timer function of timer `blink-cursor-timer'." "Timer function of timer `blink-cursor-timer'."
(internal-show-cursor nil (not (internal-show-cursor-p))) (internal-show-cursor nil (not (internal-show-cursor-p)))
;; Each blink is two calls to this function. ;; Each blink is two calls to this function.
(when (memq window-system '(x ns)) (when (memq window-system '(x ns w32))
(setq blink-cursor-blinks-done (1+ blink-cursor-blinks-done)) (setq blink-cursor-blinks-done (1+ blink-cursor-blinks-done))
(when (and (> blink-cursor-blinks 0) (when (and (> blink-cursor-blinks 0)
(<= (* 2 blink-cursor-blinks) blink-cursor-blinks-done)) (<= (* 2 blink-cursor-blinks) blink-cursor-blinks-done))
...@@ -1729,11 +1729,11 @@ itself as a pre-command hook." ...@@ -1729,11 +1729,11 @@ itself as a pre-command hook."
(setq blink-cursor-timer nil))) (setq blink-cursor-timer nil)))
(defun blink-cursor-suspend () (defun blink-cursor-suspend ()
"Suspend cursor blinking on NS and X. "Suspend cursor blinking on NS, X and W32.
This is called when no frame has focus and timers can be suspended. This is called when no frame has focus and timers can be suspended.
Timers are restarted by `blink-cursor-check', which is called when a Timers are restarted by `blink-cursor-check', which is called when a
frame receives focus." frame receives focus."
(when (memq window-system '(x ns)) (when (memq window-system '(x ns w32))
(blink-cursor-end) (blink-cursor-end)
(when blink-cursor-idle-timer (when blink-cursor-idle-timer
(cancel-timer blink-cursor-idle-timer) (cancel-timer blink-cursor-idle-timer)
......
2013-07-18 Juanma Barranquero <lekktu@gmail.com>
* keyboard.c (kbd_buffer_get_event):
* w32term.c (x_focus_changed): Port FOCUS_(IN|OUT)_EVENT changes to W32.
Followup to 2013-07-16T11:41:06Z!jan.h.d@swipnet.se.
2013-07-18 Paul Eggert <eggert@cs.ucla.edu> 2013-07-18 Paul Eggert <eggert@cs.ucla.edu>
* filelock.c: Fix unlikely file descriptor leaks. * filelock.c: Fix unlikely file descriptor leaks.
......
...@@ -4066,7 +4066,7 @@ kbd_buffer_get_event (KBOARD **kbp, ...@@ -4066,7 +4066,7 @@ kbd_buffer_get_event (KBOARD **kbp,
} }
else if (event->kind == FOCUS_OUT_EVENT) else if (event->kind == FOCUS_OUT_EVENT)
{ {
#if defined(HAVE_NS) || defined (HAVE_X11) #if defined (HAVE_NS) || defined (HAVE_X11) || defined (WINDOWSNT)
#ifdef HAVE_NS #ifdef HAVE_NS
struct ns_display_info *di; struct ns_display_info *di;
...@@ -4076,11 +4076,11 @@ kbd_buffer_get_event (KBOARD **kbp, ...@@ -4076,11 +4076,11 @@ kbd_buffer_get_event (KBOARD **kbp,
Lisp_Object frame = event->frame_or_window; Lisp_Object frame = event->frame_or_window;
bool focused = false; bool focused = false;
for (di = x_display_list; di && ! focused; di = di->next) for (di = x_display_list; di && ! focused; di = FRAME_X_DISPLAY_INFO (di)->next)
focused = di->x_highlight_frame != 0; focused = FRAME_X_DISPLAY_INFO (di)->x_highlight_frame = 0;
if (! focused) obj = make_lispy_focus_out (frame); if (! focused) obj = make_lispy_focus_out (frame);
#endif /* HAVE_NS || HAVE_X11 */ #endif /* HAVE_NS || HAVE_X11 || WINDOWSNT */
kbd_fetch_ptr = event + 1; kbd_fetch_ptr = event + 1;
} }
......
...@@ -2912,9 +2912,15 @@ x_focus_changed (int type, int state, struct w32_display_info *dpyinfo, ...@@ -2912,9 +2912,15 @@ x_focus_changed (int type, int state, struct w32_display_info *dpyinfo,
&& CONSP (Vframe_list) && CONSP (Vframe_list)
&& !NILP (XCDR (Vframe_list))) && !NILP (XCDR (Vframe_list)))
{ {
bufp->kind = FOCUS_IN_EVENT; bufp->arg = Qt;
XSETFRAME (bufp->frame_or_window, frame);
} }
else
{
bufp->arg = Qnil;
}
bufp->kind = FOCUS_IN_EVENT;
XSETFRAME (bufp->frame_or_window, frame);
} }
frame->output_data.x->focus_state |= state; frame->output_data.x->focus_state |= state;
...@@ -2929,7 +2935,10 @@ x_focus_changed (int type, int state, struct w32_display_info *dpyinfo, ...@@ -2929,7 +2935,10 @@ x_focus_changed (int type, int state, struct w32_display_info *dpyinfo,
{ {
dpyinfo->w32_focus_event_frame = 0; dpyinfo->w32_focus_event_frame = 0;
x_new_focus_frame (dpyinfo, 0); x_new_focus_frame (dpyinfo, 0);
}
bufp->kind = FOCUS_OUT_EVENT;
XSETFRAME (bufp->frame_or_window, frame);
}
/* TODO: IME focus? */ /* TODO: IME focus? */
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment