Advertisement
Guest User

mswin_window_get_position.patch

a guest
Dec 23rd, 2012
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. diff --git a/src/win/wwindow.c b/src/win/wwindow.c
  2. index 38527a5..5b31c4e 100644
  3. --- a/src/win/wwindow.c
  4. +++ b/src/win/wwindow.c
  5. @@ -70,32 +70,6 @@ static void display_flags_to_window_styles(int flags,
  6. }
  7. }
  8.  
  9. -/*
  10. - * Find the top left position of the client area of a window.
  11. - */
  12. -static void get_window_pos(HWND window, RECT *pos)
  13. -{
  14. - RECT with_decorations;
  15. - RECT adjusted;
  16. - int top;
  17. - int left;
  18. - WINDOWINFO wi;
  19. -
  20. - wi.cbSize = sizeof(WINDOWINFO);
  21. -
  22. - GetWindowRect(window, &with_decorations);
  23. - memcpy(&adjusted, &with_decorations, sizeof(RECT));
  24. -
  25. - GetWindowInfo(window, &wi);
  26. - AdjustWindowRectEx(&adjusted, wi.dwStyle, false, wi.dwExStyle);
  27. -
  28. - top = with_decorations.top - adjusted.top;
  29. - left = with_decorations.left - adjusted.left;
  30. -
  31. - pos->top = with_decorations.top + top;
  32. - pos->left = with_decorations.left + left;
  33. -}
  34. -
  35. HWND _al_win_create_hidden_window()
  36. {
  37. HWND window = CreateWindowEx(0,
  38. @@ -1071,8 +1045,7 @@ void _al_win_set_window_position(HWND window, int x, int y)
  39. void _al_win_get_window_position(HWND window, int *x, int *y)
  40. {
  41. RECT r;
  42. -
  43. - get_window_pos(window, &r);
  44. + GetWindowRect(window, &r);
  45.  
  46. if (x) {
  47. *x = r.left;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement