summaryrefslogtreecommitdiff
path: root/src/lib/ecore_win32
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-05-02 15:57:22 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-05-02 15:57:22 -0400
commit061d665e5029e22c7b8ae2d2abd7f022db01b952 (patch)
tree96e510d2b4f89b54246a6fd42793c6b8bd703b22 /src/lib/ecore_win32
parent78c2f1e659b12440cbf6c5f646924da4bf5160c1 (diff)
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
Diffstat (limited to 'src/lib/ecore_win32')
-rw-r--r--src/lib/ecore_win32/ecore_win32.c9
-rw-r--r--src/lib/ecore_win32/ecore_win32_event.c7
-rw-r--r--src/lib/ecore_win32/ecore_win32_private.h2
3 files changed, 10 insertions, 8 deletions
diff --git a/src/lib/ecore_win32/ecore_win32.c b/src/lib/ecore_win32/ecore_win32.c
index 3801015b8f..f217b22475 100644
--- a/src/lib/ecore_win32/ecore_win32.c
+++ b/src/lib/ecore_win32/ecore_win32.c
@@ -253,7 +253,7 @@ _ecore_win32_window_procedure(HWND window,
253 return TRUE; 253 return TRUE;
254 case WM_MOVING: 254 case WM_MOVING:
255 INF("moving window message"); 255 INF("moving window message");
256 _ecore_win32_event_handle_configure_notify(data); 256 _ecore_win32_event_handle_configure_notify(data, EINA_FALSE);
257 return TRUE; 257 return TRUE;
258 case WM_MOVE: 258 case WM_MOVE:
259 INF("move window message"); 259 INF("move window message");
@@ -261,10 +261,11 @@ _ecore_win32_window_procedure(HWND window,
261 case WM_SIZING: 261 case WM_SIZING:
262 INF("sizing window message"); 262 INF("sizing window message");
263 _ecore_win32_event_handle_resize(data); 263 _ecore_win32_event_handle_resize(data);
264 _ecore_win32_event_handle_configure_notify(data); 264 _ecore_win32_event_handle_configure_notify(data, EINA_FALSE);
265 return TRUE; 265 return TRUE;
266 case WM_SIZE: 266 case WM_SIZE:
267 INF("size window message"); 267 INF("size window message");
268 _ecore_win32_event_handle_configure_notify(data, EINA_TRUE);
268 return 0; 269 return 0;
269/* case WM_WINDOWPOSCHANGING: */ 270/* case WM_WINDOWPOSCHANGING: */
270/* { */ 271/* { */
@@ -273,11 +274,11 @@ _ecore_win32_window_procedure(HWND window,
273/* printf (" *** ecore message : WINDOWPOSCHANGING %ld %ld\n", */ 274/* printf (" *** ecore message : WINDOWPOSCHANGING %ld %ld\n", */
274/* rect.right - rect.left, rect.bottom - rect.top); */ 275/* rect.right - rect.left, rect.bottom - rect.top); */
275/* } */ 276/* } */
276/* _ecore_win32_event_handle_configure_notify(data); */ 277/* _ecore_win32_event_handle_configure_notify(data, EINA_FALSE); */
277/* return 0; */ 278/* return 0; */
278 case WM_WINDOWPOSCHANGED: 279 case WM_WINDOWPOSCHANGED:
279 INF("position changed window message"); 280 INF("position changed window message");
280 _ecore_win32_event_handle_configure_notify(data); 281 _ecore_win32_event_handle_configure_notify(data, EINA_FALSE);
281 _ecore_win32_event_handle_property_notify(data); 282 _ecore_win32_event_handle_property_notify(data);
282 _ecore_win32_event_handle_expose(data); 283 _ecore_win32_event_handle_expose(data);
283 return 0; 284 return 0;
diff --git a/src/lib/ecore_win32/ecore_win32_event.c b/src/lib/ecore_win32/ecore_win32_event.c
index e6ab091945..cf6b4492cc 100644
--- a/src/lib/ecore_win32/ecore_win32_event.c
+++ b/src/lib/ecore_win32/ecore_win32_event.c
@@ -1847,7 +1847,7 @@ _ecore_win32_event_handle_unmap_notify(Ecore_Win32_Callback_Data *msg)
1847} 1847}
1848 1848
1849void 1849void
1850_ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg) 1850_ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg, Eina_Bool wmsize)
1851{ 1851{
1852 WINDOWINFO wi; 1852 WINDOWINFO wi;
1853 Ecore_Win32_Event_Window_Configure *e; 1853 Ecore_Win32_Event_Window_Configure *e;
@@ -1860,14 +1860,15 @@ _ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg)
1860 1860
1861 window_pos = (WINDOWPOS *)msg->data_param; 1861 window_pos = (WINDOWPOS *)msg->data_param;
1862 wi.cbSize = sizeof(WINDOWINFO); 1862 wi.cbSize = sizeof(WINDOWINFO);
1863 if (!GetWindowInfo(window_pos->hwnd, &wi)) 1863 if (!GetWindowInfo(msg->window, &wi))
1864 { 1864 {
1865 free(e); 1865 free(e);
1866 return; 1866 return;
1867 } 1867 }
1868 1868
1869 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA); 1869 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
1870 e->abovewin = (void *)GetWindowLongPtr(window_pos->hwndInsertAfter, GWLP_USERDATA); 1870 if (!wmsize)
1871 e->abovewin = (void *)GetWindowLongPtr(window_pos->hwndInsertAfter, GWLP_USERDATA);
1871 e->x = wi.rcClient.left; 1872 e->x = wi.rcClient.left;
1872 e->y = wi.rcClient.top; 1873 e->y = wi.rcClient.top;
1873 e->width = wi.rcClient.right - wi.rcClient.left; 1874 e->width = wi.rcClient.right - wi.rcClient.left;
diff --git a/src/lib/ecore_win32/ecore_win32_private.h b/src/lib/ecore_win32/ecore_win32_private.h
index 1956f8bf6b..88d0e12afb 100644
--- a/src/lib/ecore_win32/ecore_win32_private.h
+++ b/src/lib/ecore_win32/ecore_win32_private.h
@@ -156,7 +156,7 @@ void _ecore_win32_event_handle_create_notify(Ecore_Win32_Callback_Data *msg);
156void _ecore_win32_event_handle_destroy_notify(Ecore_Win32_Callback_Data *msg); 156void _ecore_win32_event_handle_destroy_notify(Ecore_Win32_Callback_Data *msg);
157void _ecore_win32_event_handle_map_notify(Ecore_Win32_Callback_Data *msg); 157void _ecore_win32_event_handle_map_notify(Ecore_Win32_Callback_Data *msg);
158void _ecore_win32_event_handle_unmap_notify(Ecore_Win32_Callback_Data *msg); 158void _ecore_win32_event_handle_unmap_notify(Ecore_Win32_Callback_Data *msg);
159void _ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg); 159void _ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg, Eina_Bool wmsize);
160void _ecore_win32_event_handle_resize(Ecore_Win32_Callback_Data *msg); 160void _ecore_win32_event_handle_resize(Ecore_Win32_Callback_Data *msg);
161 void _ecore_win32_event_handle_property_notify(Ecore_Win32_Callback_Data *msg); 161 void _ecore_win32_event_handle_property_notify(Ecore_Win32_Callback_Data *msg);
162void _ecore_win32_event_handle_delete_request(Ecore_Win32_Callback_Data *msg); 162void _ecore_win32_event_handle_delete_request(Ecore_Win32_Callback_Data *msg);