[gtk+] wayland: Don't send bogus values for cursor surface buffer/scale



commit eb2c9b433f203eb86854803d12dbb0d5be662a15
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Apr 30 10:26:52 2015 +0200

    wayland: Don't send bogus values for cursor surface buffer/scale
    
    I was getting really weird values for scale for the blank cursor used
    when hiding the cursor in a GtkEntry when typing, this was caused
    by gdk_wayland_device_update_window_cursor sending random values
    when the returned buffer was NULL.
    
    We fix this by just not sending any buffer or scale updates in this
    case.

 gdk/wayland/gdkdevice-wayland.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 0708372..99658ae 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -211,10 +211,13 @@ gdk_wayland_device_update_window_cursor (GdkWaylandDeviceData *wd)
                          wd->enter_serial,
                          wd->pointer_surface,
                          x, y);
-  wl_surface_attach (wd->pointer_surface, buffer, 0, 0);
-  wl_surface_set_buffer_scale (wd->pointer_surface, scale);
-  wl_surface_damage (wd->pointer_surface,  0, 0, w, h);
-  wl_surface_commit (wd->pointer_surface);
+  if (buffer)
+    {
+      wl_surface_attach (wd->pointer_surface, buffer, 0, 0);
+      wl_surface_set_buffer_scale (wd->pointer_surface, scale);
+      wl_surface_damage (wd->pointer_surface,  0, 0, w, h);
+      wl_surface_commit (wd->pointer_surface);
+    }
 
   if (wd->grab_cursor)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]