Changeset 3898
- Timestamp:
- 10/12/05 00:52:53 (3 years ago)
- Files:
-
- trunk/src/ChangeLog.Meadow (modified) (1 diff)
- trunk/src/mw32term.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/ChangeLog.Meadow
r3895 r3898 1 2005-10-12 Kyotaro HORIGUCHI <horiguti@meadowy.org> 2 3 * mw32term.c (MW32_MOUSE_HIDE_TIMER_ID): New constant; 4 (show_or_hide_mouse_cursor): Use timer to perform hiding mouse 5 cursor by timeout. 6 Fixed ticket: 182 7 1 8 2005-10-05 Masayuki FUJII <boochang@m4.kcn.ne.jp> 2 9 trunk/src/mw32term.c
r3891 r3898 263 263 #define MW32GETMOUSEMODIFIER(dpyinfo, mouse) \ 264 264 (MW32GETMODIFIER (dpyinfo) | (mouse ? up_modifier : down_modifier)) 265 266 #define MW32_MOUSE_HIDE_TIMER_ID 1 265 267 266 268 static void mw32_clip_to_row P_ ((HDC, struct window *, … … 4130 4132 show_or_hide_mouse_cursor (struct mw32_display_info *dpyinfo, MSG msg) 4131 4133 { 4134 static unsigned int mouse_hide_timer = 0; 4135 4136 if (mw32_hide_mouse_timeout > 0 4137 && mouse_hide_timer == 0 4138 && dpyinfo->mouse_cursor_stat == 0) 4139 mouse_hide_timer = SetTimer (msg.hwnd, MW32_MOUSE_HIDE_TIMER_ID, 4140 mw32_hide_mouse_timeout, 4141 NULL); 4142 4132 4143 switch (msg.message) 4133 4144 { … … 4145 4156 } 4146 4157 } 4158 break; 4159 4160 case WM_TIMER: 4161 if (msg.wParam == mouse_hide_timer) 4162 { 4163 /* If we've had mouse motion after last SetTimer, extend timeout. */ 4164 if (msg.time - last_mouse_movement_time < mw32_hide_mouse_timeout 4165 && dpyinfo->mouse_cursor_stat == 0) 4166 { 4167 int extend_mills = 4168 mw32_hide_mouse_timeout - (msg.time - last_mouse_movement_time); 4169 4170 mouse_hide_timer = SetTimer (msg.hwnd, MW32_MOUSE_HIDE_TIMER_ID, 4171 extend_mills, NULL); 4172 } 4173 else 4174 { 4175 mouse_hide_timer = 0; 4176 4177 if (dpyinfo->mouse_cursor_stat == 0) 4178 { 4179 ShowCursor (FALSE); 4180 dpyinfo->mouse_cursor_stat = -1; 4181 } 4182 } 4183 } 4184 break; 4185 4186 case WM_MOUSELEAVE: 4187 if (mouse_hide_timer) 4188 { 4189 KillTimer (msg.hwnd, mouse_hide_timer); 4190 mouse_hide_timer = 0; 4191 } 4147 4192 break; 4148 4193 … … 4182 4227 } 4183 4228 break; 4184 }4185 4186 /* hide by timeout */4187 if (dpyinfo->mouse_cursor_stat == 04188 && XFASTINT (mw32_hide_mouse_timeout) > 04189 && msg.time - last_mouse_movement_time4190 > XFASTINT (mw32_hide_mouse_timeout))4191 {4192 ShowCursor (FALSE);4193 dpyinfo->mouse_cursor_stat = -1;4194 4229 } 4195 4230 }
