Mercurial > emacs
comparison src/w32menu.c @ 80759:c3bd08b7c78d
(Fx_popup_menu, Fx_popup_dialog, w32_menu_show): Ensure mouse is not
grabbed after menu is finished.
author | Jason Rumney <jasonr@gnu.org> |
---|---|
date | Tue, 26 Aug 2008 14:23:25 +0000 |
parents | fc2bcd2a8aad |
children | ab6494b53df0 |
comparison
equal
deleted
inserted
replaced
80758:654843fddea6 | 80759:c3bd08b7c78d |
---|---|
810 } | 810 } |
811 | 811 |
812 if (NILP (position)) | 812 if (NILP (position)) |
813 { | 813 { |
814 discard_menu_items (); | 814 discard_menu_items (); |
815 FRAME_X_DISPLAY_INFO (f)->grabbed = 0; | |
815 UNGCPRO; | 816 UNGCPRO; |
816 return Qnil; | 817 return Qnil; |
817 } | 818 } |
818 | 819 |
819 #ifdef HAVE_MENUS | 820 #ifdef HAVE_MENUS |
823 a menu item. | 824 a menu item. |
824 */ | 825 */ |
825 if (current_popup_menu) | 826 if (current_popup_menu) |
826 { | 827 { |
827 discard_menu_items (); | 828 discard_menu_items (); |
829 FRAME_X_DISPLAY_INFO (f)->grabbed = 0; | |
828 UNGCPRO; | 830 UNGCPRO; |
829 return Qnil; | 831 return Qnil; |
830 } | 832 } |
831 | 833 |
832 /* Display them in a menu. */ | 834 /* Display them in a menu. */ |
835 selection = w32_menu_show (f, xpos, ypos, for_click, | 837 selection = w32_menu_show (f, xpos, ypos, for_click, |
836 keymaps, title, &error_name); | 838 keymaps, title, &error_name); |
837 UNBLOCK_INPUT; | 839 UNBLOCK_INPUT; |
838 | 840 |
839 discard_menu_items (); | 841 discard_menu_items (); |
842 FRAME_X_DISPLAY_INFO (f)->grabbed = 0; | |
840 | 843 |
841 #endif /* HAVE_MENUS */ | 844 #endif /* HAVE_MENUS */ |
842 | 845 |
843 UNGCPRO; | 846 UNGCPRO; |
844 | 847 |
957 BLOCK_INPUT; | 960 BLOCK_INPUT; |
958 selection = w32_dialog_show (f, 0, title, header, &error_name); | 961 selection = w32_dialog_show (f, 0, title, header, &error_name); |
959 UNBLOCK_INPUT; | 962 UNBLOCK_INPUT; |
960 | 963 |
961 discard_menu_items (); | 964 discard_menu_items (); |
965 FRAME_X_DISPLAY_INFO (f)->grabbed = 0; | |
962 | 966 |
963 if (error_name) error (error_name); | 967 if (error_name) error (error_name); |
964 return selection; | 968 return selection; |
965 } | 969 } |
966 #endif /* HAVE_DIALOGS */ | 970 #endif /* HAVE_DIALOGS */ |
1929 (WPARAM)menu, (LPARAM)&pos); | 1933 (WPARAM)menu, (LPARAM)&pos); |
1930 | 1934 |
1931 /* Clean up extraneous mouse events which might have been generated | 1935 /* Clean up extraneous mouse events which might have been generated |
1932 during the call. */ | 1936 during the call. */ |
1933 discard_mouse_events (); | 1937 discard_mouse_events (); |
1938 FRAME_X_DISPLAY_INFO (f)->grabbed = 0; | |
1934 | 1939 |
1935 /* Free the widget_value objects we used to specify the contents. */ | 1940 /* Free the widget_value objects we used to specify the contents. */ |
1936 free_menubar_widget_value_tree (first_wv); | 1941 free_menubar_widget_value_tree (first_wv); |
1937 | 1942 |
1938 DestroyMenu (menu); | 1943 DestroyMenu (menu); |