Mercurial > dwindows
comparison os2/dw.c @ 2617:d17e3fb76bde
dw_menu_popup() should also set handle NULL and add safety checks if missing.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 23 Jul 2021 19:42:06 +0000 |
parents | ac51cbdcfbe5 |
children | d19652f760d7 |
comparison
equal
deleted
inserted
replaced
2616:a256caa5034c | 2617:d17e3fb76bde |
---|---|
6292 void API dw_menu_popup(HMENUI *menu, HWND parent, int x, int y) | 6292 void API dw_menu_popup(HMENUI *menu, HWND parent, int x, int y) |
6293 { | 6293 { |
6294 if(menu) | 6294 if(menu) |
6295 { | 6295 { |
6296 popup = parent; | 6296 popup = parent; |
6297 dw_window_set_data(*menu, "_dw_popup", (void *)1); | 6297 dw_window_set_data(*menu, "_dw_popup", DW_INT_TO_POINTER(1)); |
6298 WinPopupMenu(HWND_DESKTOP, parent, *menu, x, dw_screen_height() - y, 0, PU_KEYBOARD | PU_MOUSEBUTTON1 | PU_VCONSTRAIN | PU_HCONSTRAIN); | 6298 WinPopupMenu(HWND_DESKTOP, parent, *menu, x, dw_screen_height() - y, 0, PU_KEYBOARD | PU_MOUSEBUTTON1 | PU_VCONSTRAIN | PU_HCONSTRAIN); |
6299 *menu = 0; | |
6299 } | 6300 } |
6300 } | 6301 } |
6301 | 6302 |
6302 /* | 6303 /* |
6303 * Returns the current X and Y coordinates of the mouse pointer. | 6304 * Returns the current X and Y coordinates of the mouse pointer. |