GdkWin32: Avoid Using Deprecated API

Update the Win32 GDK backend to not use the deprecated GDK APIs.

https://bugzilla.gnome.org/show_bug.cgi?id=705068
This commit is contained in:
Chun-wei Fan 2013-07-30 11:06:57 +08:00
parent 7d48c3b2c7
commit ae79dd7068
4 changed files with 18 additions and 23 deletions

View File

@ -119,7 +119,7 @@ gdk_device_win32_get_state (GdkDevice *device,
{
gint x_int, y_int;
gdk_window_get_pointer (window, &x_int, &y_int, mask);
gdk_window_get_device_position (window, device, &x_int, &y_int, mask);
if (axes)
{

View File

@ -885,6 +885,7 @@ _gdk_input_other_event (GdkEvent *event,
GdkDisplay *display;
GdkDeviceWintab *source_device = NULL;
GdkDeviceGrabInfo *last_grab;
GdkDevice *device = NULL;
GdkEventMask masktest;
guint key_state;
POINT pt;
@ -907,7 +908,8 @@ _gdk_input_other_event (GdkEvent *event,
device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (_gdk_display));
window = gdk_window_at_pointer (&x, &y);
device = gdk_event_get_device (event);
window = gdk_device_get_window_at_position (device, &x, &y);
if (window == NULL)
window = _gdk_root;

View File

@ -2714,15 +2714,11 @@ gdk_event_translate (MSG *msg,
if (windowpos->flags & SWP_HIDEWINDOW ||
((windowpos->flags & SWP_STATECHANGED) && IsIconic (msg->hwnd)))
{
if (pointer_grab != NULL)
{
if (pointer_grab->window == window)
gdk_pointer_ungrab (msg->time);
}
GdkDevice *device = gdk_device_manager_get_client_pointer (device_manager);
if (keyboard_grab != NULL &&
keyboard_grab->window == window)
gdk_keyboard_ungrab (msg->time);
if ((pointer_grab != NULL && pointer_grab->window == window) ||
(keyboard_grab != NULL && keyboard_grab->window == window))
gdk_device_ungrab (device, msg -> time);
}
/* Send MAP events */
@ -3115,16 +3111,13 @@ gdk_event_translate (MSG *msg,
break;
case WM_NCDESTROY:
if (pointer_grab != NULL)
if ((pointer_grab != NULL && pointer_grab -> window == window) ||
(keyboard_grab && keyboard_grab -> window == window))
{
if (pointer_grab->window == window)
gdk_pointer_ungrab (msg->time);
GdkDevice *device = gdk_device_manager_get_client_pointer (device_manager);
gdk_device_ungrab (device, msg -> time);
}
if (keyboard_grab &&
keyboard_grab->window == window)
gdk_keyboard_ungrab (msg->time);
if ((window != NULL) && (msg->hwnd != GetDesktopWindow ()))
gdk_window_destroy_notify (window);

View File

@ -2655,7 +2655,7 @@ gdk_win32_window_begin_resize_drag (GdkWindow *window,
/* Must break the automatic grab that occured when the button was
* pressed, otherwise it won't work.
*/
gdk_display_pointer_ungrab (_gdk_display, 0);
gdk_device_ungrab (device, 0);
switch (edge)
{
@ -2722,7 +2722,7 @@ gdk_win32_window_begin_move_drag (GdkWindow *window,
/* Must break the automatic grab that occured when the button was pressed,
* otherwise it won't work.
*/
gdk_display_pointer_ungrab (_gdk_display, 0);
gdk_device_ungrab (device, 0);
DefWindowProcW (GDK_WINDOW_HWND (window), WM_NCLBUTTONDOWN, HTCAPTION,
MAKELPARAM (root_x - _gdk_offset_x, root_y - _gdk_offset_y));