All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] gtk: Replace gdk_cursor_new()
@ 2015-05-20 13:35 Max Reitz
  2015-05-20 14:16 ` Cole Robinson
  0 siblings, 1 reply; 2+ messages in thread
From: Max Reitz @ 2015-05-20 13:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Max Reitz

gdk_cursor_new() has been deprecated in GTK 3.16, it is recommended to
use gdk_cursor_new_for_display() instead, so do that.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 ui/gtk.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index c58028f..b9abee1 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1875,6 +1875,7 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
 {
     GtkDisplayState *s = g_malloc0(sizeof(*s));
     char *filename;
+    GdkDisplay *window_display;
 
     gtk_init(NULL, NULL);
 
@@ -1893,7 +1894,9 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
     bindtextdomain("qemu", CONFIG_QEMU_LOCALEDIR);
     textdomain("qemu");
 
-    s->null_cursor = gdk_cursor_new(GDK_BLANK_CURSOR);
+    window_display = gtk_widget_get_display(s->window);
+    s->null_cursor = gdk_cursor_new_for_display(window_display,
+                                                GDK_BLANK_CURSOR);
 
     s->mouse_mode_notifier.notify = gd_mouse_mode_change;
     qemu_add_mouse_mode_change_notifier(&s->mouse_mode_notifier);
-- 
2.4.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] gtk: Replace gdk_cursor_new()
  2015-05-20 13:35 [Qemu-devel] [PATCH] gtk: Replace gdk_cursor_new() Max Reitz
@ 2015-05-20 14:16 ` Cole Robinson
  0 siblings, 0 replies; 2+ messages in thread
From: Cole Robinson @ 2015-05-20 14:16 UTC (permalink / raw)
  To: Max Reitz, qemu-devel; +Cc: Gerd Hoffmann

On 05/20/2015 09:35 AM, Max Reitz wrote:
> gdk_cursor_new() has been deprecated in GTK 3.16, it is recommended to
> use gdk_cursor_new_for_display() instead, so do that.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  ui/gtk.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/ui/gtk.c b/ui/gtk.c
> index c58028f..b9abee1 100644
> --- a/ui/gtk.c
> +++ b/ui/gtk.c
> @@ -1875,6 +1875,7 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
>  {
>      GtkDisplayState *s = g_malloc0(sizeof(*s));
>      char *filename;
> +    GdkDisplay *window_display;
>  
>      gtk_init(NULL, NULL);
>  
> @@ -1893,7 +1894,9 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
>      bindtextdomain("qemu", CONFIG_QEMU_LOCALEDIR);
>      textdomain("qemu");
>  
> -    s->null_cursor = gdk_cursor_new(GDK_BLANK_CURSOR);
> +    window_display = gtk_widget_get_display(s->window);
> +    s->null_cursor = gdk_cursor_new_for_display(window_display,
> +                                                GDK_BLANK_CURSOR);
>  
>      s->mouse_mode_notifier.notify = gd_mouse_mode_change;
>      qemu_add_mouse_mode_change_notifier(&s->mouse_mode_notifier);
> 

Docs say gdk_cursor_new_for_display is around since gtk 2.2, so looks fine to
use unconditionally

Reviewed-by: Cole Robinson <crobinso@redhat.com>

- Cole

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-20 14:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-20 13:35 [Qemu-devel] [PATCH] gtk: Replace gdk_cursor_new() Max Reitz
2015-05-20 14:16 ` Cole Robinson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.