Bug 1174374 - gdk_cursor_new() is deprecated in 3.16. Use gdk_cursor_new_for_display(). r=karlt
authorHubert Figuière <hfiguiere@mozilla.com>
Fri, 12 Jun 2015 22:38:20 -0400
changeset 248864 fbfb01908458a36ddd67e70a428b5b58322fb2ad
parent 248863 a59dc4748390220d88c07abb353cbd42745567e1
child 248865 35e83cf9f460fe6487b7d1867c273e6f2195e0b1
push id28909
push userryanvm@gmail.com
push dateMon, 15 Jun 2015 19:55:33 +0000
treeherdermozilla-central@cd0d976e5f5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1174374
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1174374 - gdk_cursor_new() is deprecated in 3.16. Use gdk_cursor_new_for_display(). r=karlt
widget/gtk/mozgtk/mozgtk.c
widget/gtk/nsWindow.cpp
--- a/widget/gtk/mozgtk/mozgtk.c
+++ b/widget/gtk/mozgtk/mozgtk.c
@@ -3,17 +3,17 @@
 
 #define STUB(symbol) MOZ_EXPORT void symbol (void) { MOZ_CRASH(); }
 
 #ifdef COMMON_SYMBOLS
 STUB(gdk_atom_intern)
 STUB(gdk_atom_name)
 STUB(gdk_beep)
 STUB(gdk_color_free)
-STUB(gdk_cursor_new)
+STUB(gdk_cursor_new_for_display)
 STUB(gdk_cursor_new_from_name)
 STUB(gdk_cursor_new_from_pixbuf)
 STUB(gdk_display_close)
 STUB(gdk_display_get_default)
 STUB(gdk_display_get_default_screen)
 STUB(gdk_display_get_pointer)
 STUB(gdk_display_get_window_at_pointer)
 STUB(gdk_display_manager_get)
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -4932,59 +4932,64 @@ get_gtk_cursor(nsCursor aCursor)
     
     GdkDisplay *defaultDisplay = gdk_display_get_default();
 
     // The strategy here is to use standard GDK cursors, and, if not available,
     // load by standard name with gdk_cursor_new_from_name.
     // Spec is here: http://www.freedesktop.org/wiki/Specifications/cursor-spec/
     switch (aCursor) {
     case eCursor_standard:
-        gdkcursor = gdk_cursor_new(GDK_LEFT_PTR);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_LEFT_PTR);
         break;
     case eCursor_wait:
-        gdkcursor = gdk_cursor_new(GDK_WATCH);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_WATCH);
         break;
     case eCursor_select:
-        gdkcursor = gdk_cursor_new(GDK_XTERM);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_XTERM);
         break;
     case eCursor_hyperlink:
-        gdkcursor = gdk_cursor_new(GDK_HAND2);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_HAND2);
         break;
     case eCursor_n_resize:
-        gdkcursor = gdk_cursor_new(GDK_TOP_SIDE);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_TOP_SIDE);
         break;
     case eCursor_s_resize:
-        gdkcursor = gdk_cursor_new(GDK_BOTTOM_SIDE);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_BOTTOM_SIDE);
         break;
     case eCursor_w_resize:
-        gdkcursor = gdk_cursor_new(GDK_LEFT_SIDE);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_LEFT_SIDE);
         break;
     case eCursor_e_resize:
-        gdkcursor = gdk_cursor_new(GDK_RIGHT_SIDE);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_RIGHT_SIDE);
         break;
     case eCursor_nw_resize:
-        gdkcursor = gdk_cursor_new(GDK_TOP_LEFT_CORNER);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay,
+                                               GDK_TOP_LEFT_CORNER);
         break;
     case eCursor_se_resize:
-        gdkcursor = gdk_cursor_new(GDK_BOTTOM_RIGHT_CORNER);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay,
+                                               GDK_BOTTOM_RIGHT_CORNER);
         break;
     case eCursor_ne_resize:
-        gdkcursor = gdk_cursor_new(GDK_TOP_RIGHT_CORNER);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay,
+                                               GDK_TOP_RIGHT_CORNER);
         break;
     case eCursor_sw_resize:
-        gdkcursor = gdk_cursor_new(GDK_BOTTOM_LEFT_CORNER);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay,
+                                               GDK_BOTTOM_LEFT_CORNER);
         break;
     case eCursor_crosshair:
-        gdkcursor = gdk_cursor_new(GDK_CROSSHAIR);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_CROSSHAIR);
         break;
     case eCursor_move:
-        gdkcursor = gdk_cursor_new(GDK_FLEUR);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_FLEUR);
         break;
     case eCursor_help:
-        gdkcursor = gdk_cursor_new(GDK_QUESTION_ARROW);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay,
+                                               GDK_QUESTION_ARROW);
         break;
     case eCursor_copy: // CSS3
         gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "copy");
         if (!gdkcursor)
             newType = MOZ_CURSOR_COPY;
         break;
     case eCursor_alias:
         gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "alias");
@@ -4992,17 +4997,17 @@ get_gtk_cursor(nsCursor aCursor)
             newType = MOZ_CURSOR_ALIAS;
         break;
     case eCursor_context_menu:
         gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "context-menu");
         if (!gdkcursor)
             newType = MOZ_CURSOR_CONTEXT_MENU;
         break;
     case eCursor_cell:
-        gdkcursor = gdk_cursor_new(GDK_PLUS);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_PLUS);
         break;
     // Those two aren’t standardized. Trying both KDE’s and GNOME’s names
     case eCursor_grab:
         gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "openhand");
         if (!gdkcursor)
             newType = MOZ_CURSOR_HAND_GRAB;
         break;
     case eCursor_grabbing:
@@ -5038,51 +5043,55 @@ get_gtk_cursor(nsCursor aCursor)
             gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "circle");
         if (!gdkcursor)
             newType = MOZ_CURSOR_NOT_ALLOWED;
         break;
     case eCursor_vertical_text:
         newType = MOZ_CURSOR_VERTICAL_TEXT;
         break;
     case eCursor_all_scroll:
-        gdkcursor = gdk_cursor_new(GDK_FLEUR);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_FLEUR);
         break;
     case eCursor_nesw_resize:
         gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "size_bdiag");
         if (!gdkcursor)
             newType = MOZ_CURSOR_NESW_RESIZE;
         break;
     case eCursor_nwse_resize:
         gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "size_fdiag");
         if (!gdkcursor)
             newType = MOZ_CURSOR_NWSE_RESIZE;
         break;
     case eCursor_ns_resize:
-        gdkcursor = gdk_cursor_new(GDK_SB_V_DOUBLE_ARROW);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay,
+                                               GDK_SB_V_DOUBLE_ARROW);
         break;
     case eCursor_ew_resize:
-        gdkcursor = gdk_cursor_new(GDK_SB_H_DOUBLE_ARROW);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay,
+                                               GDK_SB_H_DOUBLE_ARROW);
         break;
     // Here, two better fitting cursors exist in some cursor themes. Try those first
     case eCursor_row_resize:
         gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "split_v");
         if (!gdkcursor)
-            gdkcursor = gdk_cursor_new(GDK_SB_V_DOUBLE_ARROW);
+            gdkcursor = gdk_cursor_new_for_display(defaultDisplay,
+                                                   GDK_SB_V_DOUBLE_ARROW);
         break;
     case eCursor_col_resize:
         gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "split_h");
         if (!gdkcursor)
-            gdkcursor = gdk_cursor_new(GDK_SB_H_DOUBLE_ARROW);
+            gdkcursor = gdk_cursor_new_for_display(defaultDisplay,
+                                                   GDK_SB_H_DOUBLE_ARROW);
         break;
     case eCursor_none:
         newType = MOZ_CURSOR_NONE;
         break;
     default:
         NS_ASSERTION(aCursor, "Invalid cursor type");
-        gdkcursor = gdk_cursor_new(GDK_LEFT_PTR);
+        gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_LEFT_PTR);
         break;
     }
 
     // If by now we don't have a xcursor, this means we have to make a custom
     // one. First, we try creating a named cursor based on the hash of our
     // custom bitmap, as libXcursor has some magic to convert bitmapped cursors
     // to themed cursors
     if (newType != 0xFF && GtkCursors[newType].hash) {