@@ -81,6 +81,9 @@ typedef struct {
81
81
GtkRequisition requisition ;
82
82
GdkRectangle prev_allocation ;
83
83
cairo_surface_t * surface ;
84
+ gint surface_width ;
85
+ gint surface_height ;
86
+
84
87
guint timeout ;
85
88
int current_frame ;
86
89
gboolean in_applet ;
@@ -1414,6 +1417,8 @@ static void update_pixmap(FishApplet* fish)
1414
1417
fish -> surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget ),
1415
1418
CAIRO_CONTENT_COLOR_ALPHA ,
1416
1419
width , height );
1420
+ fish -> surface_width = width ;
1421
+ fish -> surface_height = height ;
1417
1422
1418
1423
gtk_widget_queue_resize (widget );
1419
1424
@@ -1475,8 +1480,8 @@ static gboolean fish_applet_draw(GtkWidget* widget, cairo_t *cr, FishApplet* fis
1475
1480
1476
1481
g_assert (fish -> n_frames > 0 );
1477
1482
1478
- width = cairo_image_surface_get_width ( fish -> surface ) ;
1479
- height = cairo_image_surface_get_height ( fish -> surface ) ;
1483
+ width = fish -> surface_width ;
1484
+ height = fish -> surface_height ;
1480
1485
src_x = 0 ;
1481
1486
src_y = 0 ;
1482
1487
@@ -1519,6 +1524,8 @@ static void fish_applet_unrealize(GtkWidget* widget, FishApplet* fish)
1519
1524
if (fish -> surface )
1520
1525
cairo_surface_destroy (fish -> surface );
1521
1526
fish -> surface = NULL ;
1527
+ fish -> surface_width = 0 ;
1528
+ fish -> surface_height = 0 ;
1522
1529
}
1523
1530
1524
1531
static void fish_applet_change_orient (MatePanelApplet * applet , MatePanelAppletOrient orientation )
@@ -1804,6 +1811,8 @@ static void fish_applet_dispose (GObject *object)
1804
1811
if (fish -> surface )
1805
1812
cairo_surface_destroy (fish -> surface );
1806
1813
fish -> surface = NULL ;
1814
+ fish -> surface_width = 0 ;
1815
+ fish -> surface_height = 0 ;
1807
1816
1808
1817
if (fish -> pixbuf )
1809
1818
g_object_unref (fish -> pixbuf );
0 commit comments