diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-10-17 12:45:25 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-10-17 12:45:25 -0400 |
commit | c8604923598aad745a65ec16eb79113c97649345 (patch) | |
tree | 2015c1e7b33b09b9f196c9fa3b3f8726e2996937 /gdk/win32/gdkdevice-virtual.c | |
parent | 00b39e4a82401f407a2df2e2e35a18ede88b41ea (diff) | |
download | gtk+-c8604923598aad745a65ec16eb79113c97649345.tar.gz |
Clean up handling of _gdk_win32_grab_cursor
This is a variable holding a ref to an object, so it is
a great case to use g_set_object and g_clear_object.
# Please enter the commit message for your changes. Lines starting
Diffstat (limited to 'gdk/win32/gdkdevice-virtual.c')
-rw-r--r-- | gdk/win32/gdkdevice-virtual.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gdk/win32/gdkdevice-virtual.c b/gdk/win32/gdkdevice-virtual.c index 3a972855db..b947800240 100644 --- a/gdk/win32/gdkdevice-virtual.c +++ b/gdk/win32/gdkdevice-virtual.c @@ -266,10 +266,9 @@ gdk_device_virtual_grab (GdkDevice *device, { if (GetCursor () == GDK_WIN32_CURSOR (_gdk_win32_grab_cursor)->hcursor) SetCursor (NULL); - g_clear_object (&_gdk_win32_grab_cursor); } - _gdk_win32_grab_cursor = (cursor == NULL) ? NULL : g_object_ref (cursor); + g_set_object (&_gdk_win32_grab_cursor, cursor); if (_gdk_win32_grab_cursor != NULL) SetCursor (GDK_WIN32_CURSOR (_gdk_win32_grab_cursor)->hcursor); @@ -303,9 +302,8 @@ gdk_device_virtual_ungrab (GdkDevice *device, { if (GetCursor () == GDK_WIN32_CURSOR (_gdk_win32_grab_cursor)->hcursor) SetCursor (NULL); - g_clear_object (&_gdk_win32_grab_cursor); } - _gdk_win32_grab_cursor = NULL; + g_clear_object (&_gdk_win32_grab_cursor); ReleaseCapture (); } |