diff options
| author | Karl Heuer | 1996-07-12 00:25:27 +0000 |
|---|---|---|
| committer | Karl Heuer | 1996-07-12 00:25:27 +0000 |
| commit | a60856373a7a651fa860462891c3282fec80ad76 (patch) | |
| tree | 9883ce30ad42f590b40559322d00ef700bb70f5b /src | |
| parent | 210df3bf250c25836a55d8835bafd6d94ef1c553 (diff) | |
| download | emacs-a60856373a7a651fa860462891c3282fec80ad76.tar.gz emacs-a60856373a7a651fa860462891c3282fec80ad76.zip | |
(win32_wnd_proc): Handle WM_ERASEBKGND and
WM_PALETTECHANGED messages inline (as they should be).
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32fns.c | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 29ce4c70cd5..741b6c4da67 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -2932,25 +2932,41 @@ win32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 2932 | Win32Msg wmsg; | 2932 | Win32Msg wmsg; |
| 2933 | int windows_translate; | 2933 | int windows_translate; |
| 2934 | 2934 | ||
| 2935 | /* Note that it is okay to call x_window_to_frame, even though we are | ||
| 2936 | not running in the main lisp thread, because frame deletion | ||
| 2937 | requires the lisp thread to synchronize with this thread. Thus, if | ||
| 2938 | a frame struct is returned, it can be used without concern that the | ||
| 2939 | lisp thread might make it disappear while we are using it. | ||
| 2940 | |||
| 2941 | NB. Walking the frame list in this thread is safe (as long as | ||
| 2942 | writes of Lisp_Object slots are atomic, which they are on Windows). | ||
| 2943 | Although delete-frame can destructively modify the frame list while | ||
| 2944 | we are walking it, a garbage collection cannot occur until after | ||
| 2945 | delete-frame has synchronized with this thread. | ||
| 2946 | |||
| 2947 | It is also safe to use functions that make GDI calls, such as | ||
| 2948 | win32_clear_rect, because these functions must obtain a DC handle | ||
| 2949 | from the frame struct using get_frame_dc which is thread-aware. */ | ||
| 2950 | |||
| 2935 | switch (msg) | 2951 | switch (msg) |
| 2936 | { | 2952 | { |
| 2937 | case WM_ERASEBKGND: | 2953 | case WM_ERASEBKGND: |
| 2938 | /* This is (always?) generated by BeginPaint, so there is no gain | 2954 | f = x_window_to_frame (dpyinfo, hwnd); |
| 2939 | in forwarding this message to the main thread - it can simply | 2955 | if (f) |
| 2940 | erase the background before repainting. */ | 2956 | { |
| 2941 | #if 0 | 2957 | GetUpdateRect (hwnd, &wmsg.rect, FALSE); |
| 2942 | enter_crit (); | 2958 | win32_clear_rect (f, NULL, &wmsg.rect); |
| 2943 | GetUpdateRect (hwnd, &wmsg.rect, FALSE); | 2959 | } |
| 2944 | leave_crit (); | ||
| 2945 | my_post_msg (&wmsg, hwnd, msg, wParam, lParam); | ||
| 2946 | #endif | ||
| 2947 | return 1; | 2960 | return 1; |
| 2948 | case WM_PALETTECHANGED: | 2961 | case WM_PALETTECHANGED: |
| 2949 | /* ignore our own changes */ | 2962 | /* ignore our own changes */ |
| 2950 | if ((HWND)wParam != hwnd) | 2963 | if ((HWND)wParam != hwnd) |
| 2951 | { | 2964 | { |
| 2952 | /* simply notify main thread it may need to update frames */ | 2965 | f = x_window_to_frame (dpyinfo, hwnd); |
| 2953 | my_post_msg (&wmsg, hwnd, msg, wParam, lParam); | 2966 | if (f) |
| 2967 | /* get_frame_dc will realize our palette and force all | ||
| 2968 | frames to be redrawn if needed. */ | ||
| 2969 | release_frame_dc (f, get_frame_dc (f)); | ||
| 2954 | } | 2970 | } |
| 2955 | return 0; | 2971 | return 0; |
| 2956 | case WM_PAINT: | 2972 | case WM_PAINT: |