}
}
-void timer_change_notify(long next)
+void timer_change_notify(unsigned long next)
{
- long ticks = next - GETTICKCOUNT();
- if (ticks <= 0) ticks = 1; /* just in case */
+ unsigned long now = GETTICKCOUNT();
+ long ticks;
+ if (now - next < INT_MAX)
+ ticks = 0;
+ else
+ ticks = next - now;
KillTimer(hwnd, TIMING_TIMER_ID);
SetTimer(hwnd, TIMING_TIMER_ID, ticks, NULL);
timing_next_time = next;
switch (message) {
case WM_TIMER:
if ((UINT_PTR)wParam == TIMING_TIMER_ID) {
- long next;
+ unsigned long next;
KillTimer(hwnd, TIMING_TIMER_ID);
if (run_timers(timing_next_time, &next)) {
si.lpReserved2 = NULL;
CreateProcess(b, cl, NULL, NULL, inherit_handles,
NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi);
+ CloseHandle(pi.hProcess);
+ CloseHandle(pi.hThread);
if (filemap)
CloseHandle(filemap);
break;
case SB_THUMBPOSITION:
case SB_THUMBTRACK:
- term_scroll(term, 1, HIWORD(wParam));
+ /*
+ * Use GetScrollInfo instead of HIWORD(wParam) to get
+ * 32-bit scroll position.
+ */
+ {
+ SCROLLINFO si;
+
+ si.cbSize = sizeof(si);
+ si.fMask = SIF_TRACKPOS;
+ if (GetScrollInfo(hwnd, SB_VERT, &si) == 0)
+ si.nTrackPos = HIWORD(wParam);
+ term_scroll(term, 1, si.nTrackPos);
+ }
break;
}
break;
} else
break;
- if (send_raw_mouse && shift_pressed &&
- !(conf_get_int(conf, CONF_mouse_override))) {
+ if (send_raw_mouse &&
+ !(conf_get_int(conf, CONF_mouse_override) &&
+ shift_pressed)) {
/* Mouse wheel position is in screen coordinates for
* some reason */
POINT p;
* Timer for platforms where we must maintain window flashing manually
* (e.g., Win95).
*/
-static void flash_window_timer(void *ctx, long now)
+static void flash_window_timer(void *ctx, unsigned long now)
{
- if (flashing && now - next_flash >= 0) {
+ if (flashing && now == next_flash) {
flash_window(1);
}
}