forked from enlightenment/efl
ecore-win32: propagate WM_SIZE event
Summary: this is the event which informs an app of its current size also use the HWND from the msg pointer to avoid invalid access in the WM_SIZE event which passes different message data Reviewers: vtorri Reviewed By: vtorri Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D6033
This commit is contained in:
parent
78c2f1e659
commit
061d665e50
|
@ -253,7 +253,7 @@ _ecore_win32_window_procedure(HWND window,
|
|||
return TRUE;
|
||||
case WM_MOVING:
|
||||
INF("moving window message");
|
||||
_ecore_win32_event_handle_configure_notify(data);
|
||||
_ecore_win32_event_handle_configure_notify(data, EINA_FALSE);
|
||||
return TRUE;
|
||||
case WM_MOVE:
|
||||
INF("move window message");
|
||||
|
@ -261,10 +261,11 @@ _ecore_win32_window_procedure(HWND window,
|
|||
case WM_SIZING:
|
||||
INF("sizing window message");
|
||||
_ecore_win32_event_handle_resize(data);
|
||||
_ecore_win32_event_handle_configure_notify(data);
|
||||
_ecore_win32_event_handle_configure_notify(data, EINA_FALSE);
|
||||
return TRUE;
|
||||
case WM_SIZE:
|
||||
INF("size window message");
|
||||
_ecore_win32_event_handle_configure_notify(data, EINA_TRUE);
|
||||
return 0;
|
||||
/* case WM_WINDOWPOSCHANGING: */
|
||||
/* { */
|
||||
|
@ -273,11 +274,11 @@ _ecore_win32_window_procedure(HWND window,
|
|||
/* printf (" *** ecore message : WINDOWPOSCHANGING %ld %ld\n", */
|
||||
/* rect.right - rect.left, rect.bottom - rect.top); */
|
||||
/* } */
|
||||
/* _ecore_win32_event_handle_configure_notify(data); */
|
||||
/* _ecore_win32_event_handle_configure_notify(data, EINA_FALSE); */
|
||||
/* return 0; */
|
||||
case WM_WINDOWPOSCHANGED:
|
||||
INF("position changed window message");
|
||||
_ecore_win32_event_handle_configure_notify(data);
|
||||
_ecore_win32_event_handle_configure_notify(data, EINA_FALSE);
|
||||
_ecore_win32_event_handle_property_notify(data);
|
||||
_ecore_win32_event_handle_expose(data);
|
||||
return 0;
|
||||
|
|
|
@ -1847,7 +1847,7 @@ _ecore_win32_event_handle_unmap_notify(Ecore_Win32_Callback_Data *msg)
|
|||
}
|
||||
|
||||
void
|
||||
_ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg)
|
||||
_ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg, Eina_Bool wmsize)
|
||||
{
|
||||
WINDOWINFO wi;
|
||||
Ecore_Win32_Event_Window_Configure *e;
|
||||
|
@ -1860,14 +1860,15 @@ _ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg)
|
|||
|
||||
window_pos = (WINDOWPOS *)msg->data_param;
|
||||
wi.cbSize = sizeof(WINDOWINFO);
|
||||
if (!GetWindowInfo(window_pos->hwnd, &wi))
|
||||
if (!GetWindowInfo(msg->window, &wi))
|
||||
{
|
||||
free(e);
|
||||
return;
|
||||
}
|
||||
|
||||
e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
|
||||
e->abovewin = (void *)GetWindowLongPtr(window_pos->hwndInsertAfter, GWLP_USERDATA);
|
||||
if (!wmsize)
|
||||
e->abovewin = (void *)GetWindowLongPtr(window_pos->hwndInsertAfter, GWLP_USERDATA);
|
||||
e->x = wi.rcClient.left;
|
||||
e->y = wi.rcClient.top;
|
||||
e->width = wi.rcClient.right - wi.rcClient.left;
|
||||
|
|
|
@ -156,7 +156,7 @@ void _ecore_win32_event_handle_create_notify(Ecore_Win32_Callback_Data *msg);
|
|||
void _ecore_win32_event_handle_destroy_notify(Ecore_Win32_Callback_Data *msg);
|
||||
void _ecore_win32_event_handle_map_notify(Ecore_Win32_Callback_Data *msg);
|
||||
void _ecore_win32_event_handle_unmap_notify(Ecore_Win32_Callback_Data *msg);
|
||||
void _ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg);
|
||||
void _ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg, Eina_Bool wmsize);
|
||||
void _ecore_win32_event_handle_resize(Ecore_Win32_Callback_Data *msg);
|
||||
void _ecore_win32_event_handle_property_notify(Ecore_Win32_Callback_Data *msg);
|
||||
void _ecore_win32_event_handle_delete_request(Ecore_Win32_Callback_Data *msg);
|
||||
|
|
Loading…
Reference in New Issue