comparison gtk/dw.c @ 57:1ed95c8ec2ff

Added a mutex lock and unlock in the pointer calls. And fixed a warning on OS/2.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 21 Nov 2001 23:30:24 +0000
parents b6948eac375a
children 61869769c050
comparison
equal deleted inserted replaced
56:b0f94956c981 57:1ed95c8ec2ff
1703 */ 1703 */
1704 void dw_pointer_query_pos(long *x, long *y) 1704 void dw_pointer_query_pos(long *x, long *y)
1705 { 1705 {
1706 GdkModifierType state; 1706 GdkModifierType state;
1707 int gx, gy; 1707 int gx, gy;
1708 1708 int _locked_by_me = FALSE;
1709
1710 DW_MUTEX_LOCK;
1709 gdk_window_get_pointer (GDK_ROOT_PARENT(), &gx, &gy, &state); 1711 gdk_window_get_pointer (GDK_ROOT_PARENT(), &gx, &gy, &state);
1710 *x = gx; 1712 *x = gx;
1711 *y = gy; 1713 *y = gy;
1714 DW_MUTEX_UNLOCK;
1712 } 1715 }
1713 1716
1714 /* 1717 /*
1715 * Sets the X and Y coordinates of the mouse pointer. 1718 * Sets the X and Y coordinates of the mouse pointer.
1716 * Parameters: 1719 * Parameters:
1717 * x: X coordinate. 1720 * x: X coordinate.
1718 * y: Y coordinate. 1721 * y: Y coordinate.
1719 */ 1722 */
1720 void dw_pointer_set_pos(long x, long y) 1723 void dw_pointer_set_pos(long x, long y)
1721 { 1724 {
1725 int _locked_by_me = FALSE;
1726
1727 DW_MUTEX_LOCK;
1722 XWarpPointer(GDK_DISPLAY(), None, GDK_ROOT_WINDOW(), 0,0,0,0, x, y); 1728 XWarpPointer(GDK_DISPLAY(), None, GDK_ROOT_WINDOW(), 0,0,0,0, x, y);
1729 DW_MUTEX_UNLOCK;
1723 } 1730 }
1724 1731
1725 /* 1732 /*
1726 * Create a container object to be packed. 1733 * Create a container object to be packed.
1727 * Parameters: 1734 * Parameters: