summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/callbacks.cpp2
-rw-r--r--src/callbacks.h2
-rw-r--r--src/disks.cpp4
-rw-r--r--src/gsm_color_button.c3
-rw-r--r--src/load-graph.cpp30
-rw-r--r--src/load-graph.h1
-rw-r--r--src/lsof.cpp1
-rw-r--r--src/memmaps.cpp1
-rw-r--r--src/openfiles.cpp2
-rw-r--r--src/procdialogs.cpp4
-rw-r--r--src/procman.cpp9
11 files changed, 22 insertions, 37 deletions
diff --git a/src/callbacks.cpp b/src/callbacks.cpp
index 3ad102e..0e1b399 100644
--- a/src/callbacks.cpp
+++ b/src/callbacks.cpp
@@ -324,7 +324,7 @@ cb_tree_popup_menu (GtkWidget *widget, gpointer data)
void
-cb_switch_page (GtkNotebook *nb, GtkNotebookPage *page,
+cb_switch_page (GtkNotebook *nb, GtkWidget *page,
gint num, gpointer data)
{
cb_change_current_page (nb, num, data);
diff --git a/src/callbacks.h b/src/callbacks.h
index 4c84793..6ce3e18 100644
--- a/src/callbacks.h
+++ b/src/callbacks.h
@@ -60,7 +60,7 @@ gboolean cb_tree_button_pressed (GtkWidget *widget, GdkEventButton *event,
void cb_change_current_page (GtkNotebook *nb,
gint num, gpointer data);
-void cb_switch_page (GtkNotebook *nb, GtkNotebookPage *page,
+void cb_switch_page (GtkNotebook *nb, GtkWidget *page,
gint num, gpointer data);
gint cb_update_disks (gpointer data);
diff --git a/src/disks.cpp b/src/disks.cpp
index 172fc7a..c694c0a 100644
--- a/src/disks.cpp
+++ b/src/disks.cpp
@@ -288,7 +288,6 @@ GtkWidget *
create_disk_view(ProcData *procdata)
{
GtkWidget *disk_box;
- GtkWidget *label;
GtkWidget *scrolled;
GtkWidget *disk_tree;
GtkListStore *model;
@@ -310,9 +309,6 @@ create_disk_view(ProcData *procdata)
gtk_container_set_border_width(GTK_CONTAINER(disk_box), 12);
- label = make_title_label(_("File Systems"));
- gtk_box_pack_start(GTK_BOX(disk_box), label, FALSE, FALSE, 0);
-
scrolled = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
GTK_POLICY_AUTOMATIC,
diff --git a/src/gsm_color_button.c b/src/gsm_color_button.c
index ce72cc1..da82169 100644
--- a/src/gsm_color_button.c
+++ b/src/gsm_color_button.c
@@ -601,8 +601,6 @@ gsm_color_button_init (GSMColorButton * color_button)
{
color_button->priv = GSM_COLOR_BUTTON_GET_PRIVATE (color_button);
- rsvg_init ();
-
color_button->priv->color.red = 0;
color_button->priv->color.green = 0;
color_button->priv->color.blue = 0;
@@ -651,7 +649,6 @@ gsm_color_button_finalize (GObject * object)
cairo_surface_destroy (color_button->priv->image_buffer);
color_button->priv->image_buffer = NULL;
- rsvg_term ();
G_OBJECT_CLASS (gsm_color_button_parent_class)->finalize (object);
}
diff --git a/src/load-graph.cpp b/src/load-graph.cpp
index 79700d4..3cf8683 100644
--- a/src/load-graph.cpp
+++ b/src/load-graph.cpp
@@ -87,7 +87,7 @@ void draw_background(LoadGraph *g) {
allocation.height,
-1);
cr = gdk_cairo_create (g->background);
-
+
// set the background colour
GtkStyle *style = gtk_widget_get_style (ProcData::get_instance()->notebook);
gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_NORMAL]);
@@ -95,13 +95,13 @@ void draw_background(LoadGraph *g) {
/* draw frame */
cairo_translate (cr, FRAME_WIDTH, FRAME_WIDTH);
-
+
/* Draw background rectangle */
cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
cairo_rectangle (cr, g->rmargin + g->indent, 0,
g->draw_width - g->rmargin - g->indent, g->real_draw_height);
cairo_fill(cr);
-
+
cairo_set_line_width (cr, 1.0);
cairo_set_dash (cr, dash, 2, 0);
cairo_set_font_size (cr, g->fontsize);
@@ -191,10 +191,6 @@ load_graph_configure (GtkWidget *widget,
g->clear_background();
- if (g->gc == NULL) {
- g->gc = gdk_gc_new (GDK_DRAWABLE (gtk_widget_get_window (widget)));
- }
-
load_graph_draw (g);
return TRUE;
@@ -212,19 +208,14 @@ load_graph_expose (GtkWidget *widget,
guint i, j;
gdouble sample_width, x_offset;
+ window = gtk_widget_get_window (g->disp);
+ gtk_widget_get_allocation (g->disp, &allocation);
+
if (g->background == NULL) {
draw_background(g);
+ gdk_window_set_back_pixmap (window, g->background, FALSE);
}
- window = gtk_widget_get_window (g->disp);
- gtk_widget_get_allocation (g->disp, &allocation);
- gdk_draw_drawable (window,
- g->gc,
- g->background,
- 0, 0, 0, 0,
- allocation.width,
- allocation.height);
-
/* Number of pixels wide for one graph point */
sample_width = (float)(g->draw_width - g->rmargin - g->indent) / (float)LoadGraph::NUM_POINTS;
/* General offset */
@@ -252,7 +243,7 @@ load_graph_expose (GtkWidget *widget,
for (i = 1; i < LoadGraph::NUM_POINTS; ++i) {
if (g->data[i][j] == -1.0f)
continue;
- cairo_curve_to (cr,
+ cairo_curve_to (cr,
x_offset - ((i - 0.5f) * g->graph_delx),
(1.0f - g->data[i-1][j]) * g->real_draw_height + 3.5f,
x_offset - ((i - 0.5f) * g->graph_delx),
@@ -619,7 +610,6 @@ LoadGraph::LoadGraph(guint type)
graph_buffer_offset(0),
main_widget(NULL),
disp(NULL),
- gc(NULL),
background(NULL),
timer_index(0),
draw(FALSE),
@@ -676,9 +666,9 @@ LoadGraph::LoadGraph(guint type)
case LOAD_GRAPH_MEM:
g->colors[0] = ProcData::get_instance()->config.mem_color;
g->colors[1] = ProcData::get_instance()->config.swap_color;
- g->mem_color_picker = gsm_color_button_new (&g->colors[0],
+ g->mem_color_picker = gsm_color_button_new (&g->colors[0],
GSMCP_TYPE_PIE);
- g->swap_color_picker = gsm_color_button_new (&g->colors[1],
+ g->swap_color_picker = gsm_color_button_new (&g->colors[1],
GSMCP_TYPE_PIE);
break;
case LOAD_GRAPH_NET:
diff --git a/src/load-graph.h b/src/load-graph.h
index 6e7a599..9dd28bb 100644
--- a/src/load-graph.h
+++ b/src/load-graph.h
@@ -66,7 +66,6 @@ struct LoadGraph {
GtkWidget *main_widget;
GtkWidget *disp;
- GdkGC *gc;
GdkDrawable *background;
guint timer_index;
diff --git a/src/lsof.cpp b/src/lsof.cpp
index 24f14a5..7773eff 100644
--- a/src/lsof.cpp
+++ b/src/lsof.cpp
@@ -312,7 +312,6 @@ void procman_lsof(ProcData *procdata)
// G_CALLBACK(close_dialog), NULL);
gtk_window_set_resizable(GTK_WINDOW(dialog), TRUE);
gtk_window_set_default_size(GTK_WINDOW(dialog), 575, 400);
- // gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
gtk_container_set_border_width(GTK_CONTAINER(dialog), 12);
GtkWidget *mainbox = gtk_vbox_new(FALSE, 12);
gtk_container_add(GTK_CONTAINER(dialog), mainbox);
diff --git a/src/memmaps.cpp b/src/memmaps.cpp
index 3ca8229..de32ce0 100644
--- a/src/memmaps.cpp
+++ b/src/memmaps.cpp
@@ -608,7 +608,6 @@ create_single_memmaps_dialog (GtkTreeModel *model, GtkTreePath *path,
gtk_window_set_title(GTK_WINDOW(memmapsdialog), _("Memory Maps"));
gtk_window_set_resizable(GTK_WINDOW(memmapsdialog), TRUE);
gtk_window_set_default_size(GTK_WINDOW(memmapsdialog), 575, 400);
- // gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
gtk_container_set_border_width(GTK_CONTAINER(memmapsdialog), 12);
GtkWidget *mainbox = gtk_vbox_new(FALSE, 12);
diff --git a/src/openfiles.cpp b/src/openfiles.cpp
index 8b76858..de3e864 100644
--- a/src/openfiles.cpp
+++ b/src/openfiles.cpp
@@ -335,7 +335,7 @@ create_single_openfiles_dialog (GtkTreeModel *model, GtkTreePath *path,
NULL);
gtk_window_set_resizable (GTK_WINDOW (openfilesdialog), TRUE);
gtk_window_set_default_size (GTK_WINDOW (openfilesdialog), 575, 400);
- gtk_dialog_set_has_separator (GTK_DIALOG (openfilesdialog), FALSE);
+ g_object_set(G_OBJECT(openfilesdialog), "has-separator", FALSE, NULL);
gtk_container_set_border_width (GTK_CONTAINER (openfilesdialog), 5);
vbox = gtk_dialog_get_content_area (GTK_DIALOG (openfilesdialog));
diff --git a/src/procdialogs.cpp b/src/procdialogs.cpp
index fef8b5f..2d0de35 100644
--- a/src/procdialogs.cpp
+++ b/src/procdialogs.cpp
@@ -178,7 +178,7 @@ procdialog_create_renice_dialog (ProcData *procdata)
NULL);
renice_dialog = dialog;
gtk_window_set_resizable (GTK_WINDOW (renice_dialog), FALSE);
- gtk_dialog_set_has_separator (GTK_DIALOG (renice_dialog), FALSE);
+ g_object_set (G_OBJECT (renice_dialog), "has-separator", FALSE, NULL);
gtk_container_set_border_width (GTK_CONTAINER (renice_dialog), 5);
button = gtk_button_new ();
@@ -510,7 +510,7 @@ procdialog_create_preferences_dialog (ProcData *procdata)
/* any function to set list height by contents/items inside it. */
gtk_window_set_default_size (GTK_WINDOW (dialog), 400, 420);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
+ g_object_set (G_OBJECT (dialog), "has-separator", FALSE, NULL);
prefs_dialog = dialog;
main_vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
diff --git a/src/procman.cpp b/src/procman.cpp
index 16640c3..bffb4af 100644
--- a/src/procman.cpp
+++ b/src/procman.cpp
@@ -728,11 +728,12 @@ main (int argc, char *argv[])
exit (0);
}
+ /* initialize rsvg */
+ rsvg_init ();
+
gtk_window_set_default_icon_name ("utilities-system-monitor");
g_set_application_name(_("System Monitor"));
- mateconf_init (argc, argv, NULL);
-
client = mateconf_client_get_default ();
mateconf_client_add_dir(client, "/apps/procman", MATECONF_CLIENT_PRELOAD_NONE, NULL);
@@ -768,6 +769,10 @@ main (int argc, char *argv[])
glibtop_close ();
+ // This function should only be called just before program exit.
+ // See MATE bug #592100 for a discussion about this.
+ rsvg_term ();
+
return 0;
}