Changeset 4032
- Timestamp:
- 2006年02月13日 03時25分50秒 (3 years ago)
- Files:
-
- trunk/src/mw32fns.c (modified) (5 diffs)
- trunk/src/mw32term.c (modified) (17 diffs)
- trunk/src/mw32term.h (modified) (2 diffs)
- trunk/src/xfaces.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/mw32fns.c
r4010 r4032 1691 1691 #endif /* IME_CONTROL */ 1692 1692 1693 static void1694 mw32m_new_focus_frame (struct mw32_display_info *dpyinfo, FRAME_PTR f)1695 {1696 HDC hdc1, hdc2;1697 FRAME_PTR fold = dpyinfo->mw32_highlight_frame;1698 1699 if (f)1700 {1701 hdc1 = GetDC (FRAME_MW32_WINDOW (f));1702 mw32_setup_default_hdc (hdc1);1703 f->output_data.mw32->hdc = hdc1;1704 }1705 else1706 hdc1 = INVALID_HANDLE_VALUE;1707 1708 if (fold)1709 {1710 hdc2 = GetDC (FRAME_MW32_WINDOW (fold));1711 mw32_setup_default_hdc (hdc2);1712 fold->output_data.mw32->hdc = hdc2;1713 }1714 else1715 hdc2 = INVALID_HANDLE_VALUE;1716 1717 mw32_new_focus_frame (dpyinfo, f);1718 1719 if (hdc1 != INVALID_HANDLE_VALUE)1720 {1721 f->output_data.mw32->hdc = INVALID_HANDLE_VALUE;1722 ReleaseDC (FRAME_MW32_WINDOW (f), hdc1);1723 }1724 if (hdc2 != INVALID_HANDLE_VALUE)1725 {1726 fold->output_data.mw32->hdc = INVALID_HANDLE_VALUE;1727 ReleaseDC (FRAME_MW32_WINDOW (fold), hdc2);1728 }1729 }1730 1731 1693 #ifndef W32_VER4 1732 1694 static HANDLE … … 2006 1968 case WM_SETFOCUS: 2007 1969 2008 mw32 m_new_focus_frame (dpyinfo, f);1970 mw32_new_focus_frame (dpyinfo, f); 2009 1971 2010 1972 /* This code is for switching selected-frame. In order to … … 2042 2004 2043 2005 if (f == FRAME_MW32_DISPLAY_INFO (f)->mw32_focus_frame) 2044 mw32 m_new_focus_frame (dpyinfo, NULL);2006 mw32_new_focus_frame (dpyinfo, NULL); 2045 2007 2046 2008 /* reset mouse face and help echo. */ … … 2961 2923 f->output_data.mw32->hdc = INVALID_HANDLE_VALUE; 2962 2924 f->output_data.mw32->hdc_nestlevel = 0; 2925 f->output_data.mw32->pending_clear_mouse_face = 0; 2963 2926 f->output_data.mw32->frame_moving_or_sizing = 0; 2964 2927 f->output_data.mw32->setcaret_event = CreateEvent (NULL, TRUE, FALSE, NULL); … … 4037 4000 f->output_data.mw32->hdc = INVALID_HANDLE_VALUE; 4038 4001 f->output_data.mw32->hdc_nestlevel = 0; 4002 f->output_data.mw32->pending_clear_mouse_face = 0; 4039 4003 InitializeCriticalSection (&(f->output_data.mw32->hdc_critsec)); 4040 4004 trunk/src/mw32term.c
r4023 r4032 668 668 } 669 669 670 if (*pcount > 1) 671 { 672 (*pcount)--; 673 return; 674 } 670 (*pcount)--; 671 if (*pcount > 0) 672 return; 675 673 676 674 MW32_UNBLOCK_CARET (f); … … 2824 2822 struct frame *frame) 2825 2823 { 2826 struct frame *old_focus = dpyinfo->mw32_focus_frame;2827 2828 2824 dpyinfo->mw32_focus_message_frame = frame; 2829 2825 … … 2833 2829 the correct value of x_focus_frame. */ 2834 2830 dpyinfo->mw32_focus_frame = frame; 2835 2836 #if 0 /* We shouldn't concern on lowering and raising the frame2837 because the system automatically operate them. */2838 if (old_focus && old_focus->auto_lower)2839 mw32_lower_frame (old_focus);2840 #endif2841 2842 #if 02843 selected_frame = frame;2844 XSETFRAME (XWINDOW (selected_frame->selected_window)->frame,2845 selected_frame);2846 Fselect_window (selected_frame->selected_window);2847 choose_minibuf_frame ();2848 #endif /* ! 0 */2849 2831 2850 2832 /* Only registering. */ … … 2883 2865 mw32_frame_rehighlight_1 (struct mw32_display_info *dpyinfo) 2884 2866 { 2885 struct frame *old_highlight = dpyinfo->mw32_highlight_frame;2886 2887 2867 if (dpyinfo->mw32_focus_frame) 2888 2868 { … … 2899 2879 else 2900 2880 dpyinfo->mw32_highlight_frame = 0; 2901 2902 if (dpyinfo->mw32_highlight_frame != old_highlight) 2903 { 2904 if (old_highlight) 2905 frame_unhighlight (old_highlight); 2906 if (dpyinfo->mw32_highlight_frame) 2907 frame_highlight (dpyinfo->mw32_highlight_frame); 2908 } 2909 } 2910 2881 } 2911 2882 2912 2883 … … 4273 4244 } 4274 4245 4246 4247 static void 4248 mw32_clear_mouse_face (struct frame *f) 4249 { 4250 struct mw32_display_info *dpyinfo = FRAME_MW32_DISPLAY_INFO (f); 4251 4252 EnterCriticalSection (&(f->output_data.mw32->hdc_critsec)); 4253 if (main_thread_hdc == INVALID_HANDLE_VALUE) 4254 { 4255 GET_FRAME_HDC (f); 4256 clear_mouse_face (dpyinfo); 4257 RELEASE_FRAME_HDC (f); 4258 f->output_data.mw32->pending_clear_mouse_face = FALSE; 4259 } 4260 else 4261 f->output_data.mw32->pending_clear_mouse_face = TRUE; 4262 /* Pending process will be donw in mw32_message_loop */ 4263 4264 LeaveCriticalSection (&(f->output_data.mw32->hdc_critsec)); 4265 4266 } 4267 4275 4268 int mw32_inhibit_hide_mouse = 0; 4276 4269 … … 4295 4288 { 4296 4289 dpyinfo->mouse_face_hidden = 0; 4297 WITH_MESSAGE_THREAD_HDC (f, clear_mouse_face (dpyinfo));4290 mw32_clear_mouse_face (f); 4298 4291 } 4299 4292 … … 4354 4347 { 4355 4348 dpyinfo->mouse_face_hidden = 0; 4356 WITH_MESSAGE_THREAD_HDC (f, clear_mouse_face (dpyinfo));4349 mw32_clear_mouse_face (f); 4357 4350 } 4358 4351 } … … 4401 4394 && INTEGERP (Vmouse_highlight)) 4402 4395 { 4403 WITH_MESSAGE_THREAD_HDC (f, clear_mouse_face (dpyinfo));4396 mw32_clear_mouse_face (f); 4404 4397 dpyinfo->mouse_face_hidden = 1; 4405 4398 } … … 4435 4428 { 4436 4429 dpyinfo->mouse_face_hidden = 0; 4437 WITH_MESSAGE_THREAD_HDC (f, clear_mouse_face (dpyinfo));4430 mw32_clear_mouse_face (f); 4438 4431 } 4439 4432 … … 4459 4452 { 4460 4453 dpyinfo->mouse_face_hidden = 0; 4461 WITH_MESSAGE_THREAD_HDC (f, clear_mouse_face (dpyinfo));4454 mw32_clear_mouse_face (f); 4462 4455 } 4463 4456 … … 4478 4471 if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)) 4479 4472 { 4480 WITH_MESSAGE_THREAD_HDC (f, clear_mouse_face (dpyinfo));4473 mw32_clear_mouse_face (f); 4481 4474 dpyinfo->mouse_face_hidden = 1; 4482 4475 } … … 4507 4500 if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)) 4508 4501 { 4509 WITH_MESSAGE_THREAD_HDC (f, clear_mouse_face (dpyinfo));4502 mw32_clear_mouse_face (f); 4510 4503 dpyinfo->mouse_face_hidden = 1; 4511 4504 } … … 4584 4577 4585 4578 if (f) 4586 show_or_hide_mouse_cursor (f, msg); 4579 { 4580 if (f->output_data.mw32->pending_clear_mouse_face) 4581 mw32_clear_mouse_face (f); 4582 show_or_hide_mouse_cursor (f, msg); 4583 } 4587 4584 4588 4585 if ((!f) && (!IS_EMACS_PRIVATE_MESSAGE (msg.message))) … … 4775 4772 4776 4773 case WM_NCMOUSEMOVE: 4777 WITH_MESSAGE_THREAD_HDC (f, clear_mouse_face (dpyinfo));4774 mw32_clear_mouse_face (f); 4778 4775 dpyinfo->mouse_face_mouse_frame = NULL; 4779 4776 last_mouse_motion_frame = Qnil; … … 4802 4799 /* If we move outside the frame, then we're 4803 4800 certainly no longer on any text in the frame. */ 4804 WITH_MESSAGE_THREAD_HDC (f, clear_mouse_face (dpyinfo));4801 mw32_clear_mouse_face (f); 4805 4802 dpyinfo->mouse_face_mouse_frame = 0; 4806 4803 last_mouse_motion_frame = Qnil; … … 4969 4966 */ 4970 4967 case WM_EMACS_CLEAR_MOUSE_FACE: 4971 WITH_MESSAGE_THREAD_HDC (f, clear_mouse_face (dpyinfo));4968 mw32_clear_mouse_face (f); 4972 4969 4973 4970 /* Generate a nil HELP_EVENT to cancel a help-echo. trunk/src/mw32term.h
r4023 r4032 390 390 /* Nesting level of hdc. */ 391 391 int hdc_nestlevel; 392 393 /* If there is pending clear_mouse_face. */ 394 int pending_clear_mouse_face; 392 395 393 396 /* Critical section to synchronize processces using hdc for this … … 603 606 } 604 607 605 606 #define WITH_MESSAGE_THREAD_HDC(f, proc) \607 {update_begin_hook (f);(proc);update_end_hook (f);}608 608 609 609 #define MW32_BLOCK_CARET(f) \ trunk/src/xfaces.c
r4020 r4032 5496 5496 current matrix still references freed faces. */ 5497 5497 BLOCK_INPUT; 5498 5498 #ifdef MEADOW 5499 GET_FRAME_HDC (f); 5500 #endif 5499 5501 for (i = 0; i < c->used; ++i) 5500 5502 { … … 5517 5519 } 5518 5520 5521 #ifdef MEADOW 5522 RELEASE_FRAME_HDC (f); 5523 #endif 5519 5524 UNBLOCK_INPUT; 5520 5525 }
