Unmap tooltip when sheet is unmapped
[pspp-builds.git] / lib / gtk-contrib / psppire-sheet.c
index 33e7b47a0cce90cf7121ab275a78c965d3b66d0a..9442f260750f24874d6c199aee0c048e0ecfcd96 100644 (file)
@@ -1981,6 +1981,9 @@ psppire_sheet_realize (GtkWidget *widget)
   gtk_widget_set_parent_window (sheet->button, sheet->sheet_window);
   gtk_widget_set_parent (sheet->button, GTK_WIDGET (sheet));
 
+  sheet->button->style = gtk_style_attach (sheet->button->style,
+                                          sheet->sheet_window);
+
 
   sheet->cursor_drag = gdk_cursor_new_for_display (display, GDK_PLUS);
 
@@ -2138,11 +2141,9 @@ psppire_sheet_unmap (GtkWidget *widget)
     gdk_window_hide (sheet->row_title_window);
   gdk_window_hide (widget->window);
 
-  if (GTK_WIDGET_MAPPED (sheet->entry_widget))
-    gtk_widget_unmap (sheet->entry_widget);
-
-  if (GTK_WIDGET_MAPPED (sheet->button))
-    gtk_widget_unmap (sheet->button);
+  gtk_widget_unmap (sheet->entry_widget);
+  gtk_widget_unmap (sheet->button);
+  gtk_widget_unmap (sheet->hover_window->window);
 }
 
 /* get cell attributes of the given cell */
@@ -3802,6 +3803,8 @@ motion_timeout_callback (gpointer data)
   PsppireSheet *sheet = PSPPIRE_SHEET (data);
   gint x, y;
   gint row, column;
+
+  gdk_threads_enter ();
   gtk_widget_get_pointer (GTK_WIDGET (sheet), &x, &y);
 
   if ( psppire_sheet_get_pixel_info (sheet, x, y, &row, &column) )
@@ -3825,6 +3828,7 @@ motion_timeout_callback (gpointer data)
        }
     }
 
+  gdk_threads_leave ();
   return FALSE;
 }
 
@@ -4793,8 +4797,9 @@ draw_button (PsppireSheet *sheet, GdkWindow *window,
 
   gtk_paint_box (sheet->button->style, window,
                 GTK_STATE_NORMAL, GTK_SHADOW_OUT,
-                &allocation, GTK_WIDGET (sheet->button),
-                "buttondefault",
+                &allocation,
+                GTK_WIDGET (sheet->button),
+                NULL,
                 allocation.x, allocation.y,
                 allocation.width, allocation.height);
 
@@ -4810,7 +4815,7 @@ draw_button (PsppireSheet *sheet, GdkWindow *window,
     gtk_paint_box (sheet->button->style, window,
                   button->state, shadow_type,
                   &allocation, GTK_WIDGET (sheet->button),
-                  "button",
+                  NULL,
                   allocation.x, allocation.y,
                   allocation.width, allocation.height);
 
@@ -4828,7 +4833,7 @@ draw_button (PsppireSheet *sheet, GdkWindow *window,
                         shadow_type,
                         NULL,
                         GTK_WIDGET (sheet),
-                        "button",
+                        NULL,
                         points,
                         2,
                         TRUE);