diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2012-05-27 23:56:59 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2012-05-27 23:56:59 +0000 |
| commit | 732b61f8a63db0f01ea3e524f20e74ddcbab5c48 (patch) | |
| tree | 59ff4ec6efc38c69f62d97419fd4fbaa7d9b2a71 /src/ui/widget/selected-style.cpp | |
| parent | Reorder measure context item painting for better legibility. (diff) | |
| download | inkscape-732b61f8a63db0f01ea3e524f20e74ddcbab5c48.tar.gz inkscape-732b61f8a63db0f01ea3e524f20e74ddcbab5c48.zip | |
Stop using deprecated GdkBitmap in custom cursors
Fixed bugs:
- https://launchpad.net/bugs/943200
(bzr r11429)
Diffstat (limited to 'src/ui/widget/selected-style.cpp')
| -rw-r--r-- | src/ui/widget/selected-style.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index a60e3cc31..37b3f8a1a 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -1253,30 +1253,27 @@ RotateableSwatch::do_motion(double by, guint modifier) { if (!cr_set && modifier != 3) { GtkWidget *w = GTK_WIDGET(gobj()); + GdkPixbuf *pixbuf = NULL; - GdkBitmap *bitmap = NULL; - GdkBitmap *mask = NULL; if (modifier == 2) { // saturation - sp_cursor_bitmap_and_mask_from_xpm(&bitmap, &mask, cursor_adj_s_xpm); + pixbuf = gdk_pixbuf_new_from_xpm_data((const gchar **)cursor_adj_s_xpm); } else if (modifier == 1) { // lightness - sp_cursor_bitmap_and_mask_from_xpm(&bitmap, &mask, cursor_adj_l_xpm); + pixbuf = gdk_pixbuf_new_from_xpm_data((const gchar **)cursor_adj_l_xpm); } else { // hue - sp_cursor_bitmap_and_mask_from_xpm(&bitmap, &mask, cursor_adj_h_xpm); + pixbuf = gdk_pixbuf_new_from_xpm_data((const gchar **)cursor_adj_h_xpm); } - if ((bitmap != NULL) && (mask != NULL)) { - GtkStyle *style = gtk_widget_get_style(w); - cr = gdk_cursor_new_from_pixmap(bitmap, mask, - &style->black, - &style->white, - 16, 16); - g_object_unref (bitmap); - g_object_unref (mask); + + if (pixbuf != NULL) { + cr = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), pixbuf, 16, 16); + + g_object_unref(pixbuf); gdk_window_set_cursor(gtk_widget_get_window(w), cr); #if GTK_CHECK_VERSION(3,0,0) g_object_unref(cr); #else gdk_cursor_unref(cr); #endif + cr = NULL; cr_set = true; } } |
