[gnome-system-monitor] Compile with CXXFLAGS=-DGSEAL_ENABLE. Fixes bug 612482.
- From: Andre Klapper <aklapper src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-monitor] Compile with CXXFLAGS=-DGSEAL_ENABLE. Fixes bug 612482.
- Date: Sun, 20 Jun 2010 16:54:18 +0000 (UTC)
commit d6e9e6576d3bf06904d7abe19e4d9e5a72d4be23
Author: Andre Klapper <a9016009 gmx de>
Date: Sun Jun 20 11:50:50 2010 +0200
Compile with CXXFLAGS=-DGSEAL_ENABLE. Fixes bug 612482.
src/load-graph.cpp | 30 ++++++++++++++++++++----------
src/openfiles.cpp | 2 +-
src/procdialogs.cpp | 8 ++++----
src/procman.cpp | 2 +-
src/sysinfo.cpp | 20 ++++++++++++--------
5 files changed, 38 insertions(+), 24 deletions(-)
---
diff --git a/src/load-graph.cpp b/src/load-graph.cpp
index 020d237..79700d4 100644
--- a/src/load-graph.cpp
+++ b/src/load-graph.cpp
@@ -67,6 +67,7 @@ unsigned LoadGraph::num_bars() const
#define FRAME_WIDTH 4
void draw_background(LoadGraph *g) {
+ GtkAllocation allocation;
double dash[2] = { 1.0, 2.0 };
cairo_t *cr;
guint i;
@@ -80,9 +81,10 @@ void draw_background(LoadGraph *g) {
g->graph_delx = (g->draw_width - 2.0 - g->rmargin - g->indent) / (LoadGraph::NUM_POINTS - 3);
g->graph_buffer_offset = (int) (1.5 * g->graph_delx) + FRAME_WIDTH ;
- g->background = gdk_pixmap_new (GDK_DRAWABLE (g->disp->window),
- g->disp->allocation.width,
- g->disp->allocation.height,
+ gtk_widget_get_allocation (g->disp, &allocation);
+ g->background = gdk_pixmap_new (GDK_DRAWABLE (gtk_widget_get_window (g->disp)),
+ allocation.width,
+ allocation.height,
-1);
cr = gdk_cairo_create (g->background);
@@ -180,14 +182,17 @@ load_graph_configure (GtkWidget *widget,
GdkEventConfigure *event,
gpointer data_ptr)
{
+ GtkAllocation allocation;
LoadGraph * const g = static_cast<LoadGraph*>(data_ptr);
- g->draw_width = widget->allocation.width - 2 * FRAME_WIDTH;
- g->draw_height = widget->allocation.height - 2 * FRAME_WIDTH;
+
+ gtk_widget_get_allocation (widget, &allocation);
+ g->draw_width = allocation.width - 2 * FRAME_WIDTH;
+ g->draw_height = allocation.height - 2 * FRAME_WIDTH;
g->clear_background();
if (g->gc == NULL) {
- g->gc = gdk_gc_new (GDK_DRAWABLE (widget->window));
+ g->gc = gdk_gc_new (GDK_DRAWABLE (gtk_widget_get_window (widget)));
}
load_graph_draw (g);
@@ -201,6 +206,8 @@ load_graph_expose (GtkWidget *widget,
gpointer data_ptr)
{
LoadGraph * const g = static_cast<LoadGraph*>(data_ptr);
+ GtkAllocation allocation;
+ GdkWindow *window;
guint i, j;
gdouble sample_width, x_offset;
@@ -208,12 +215,15 @@ load_graph_expose (GtkWidget *widget,
if (g->background == NULL) {
draw_background(g);
}
- gdk_draw_drawable (g->disp->window,
+
+ 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,
- g->disp->allocation.width,
- g->disp->allocation.height);
+ 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;
@@ -226,7 +236,7 @@ load_graph_expose (GtkWidget *widget,
/* draw the graph */
cairo_t* cr;
- cr = gdk_cairo_create (g->disp->window);
+ cr = gdk_cairo_create (window);
cairo_set_line_width (cr, 1);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
diff --git a/src/openfiles.cpp b/src/openfiles.cpp
index 500b42a..f4a088a 100644
--- a/src/openfiles.cpp
+++ b/src/openfiles.cpp
@@ -338,7 +338,7 @@ create_single_openfiles_dialog (GtkTreeModel *model, GtkTreePath *path,
gtk_dialog_set_has_separator (GTK_DIALOG (openfilesdialog), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (openfilesdialog), 5);
- vbox = GTK_DIALOG (openfilesdialog)->vbox;
+ vbox = gtk_dialog_get_content_area (GTK_DIALOG (openfilesdialog));
gtk_box_set_spacing (GTK_BOX (vbox), 2);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
diff --git a/src/procdialogs.cpp b/src/procdialogs.cpp
index eec7de2..4c814a0 100644
--- a/src/procdialogs.cpp
+++ b/src/procdialogs.cpp
@@ -128,7 +128,7 @@ renice_scale_changed (GtkAdjustment *adj, gpointer data)
{
GtkWidget *label = GTK_WIDGET (data);
- new_nice_value = int(adj->value);
+ new_nice_value = int(gtk_adjustment_get_value (adj));
gtk_label_set_text (GTK_LABEL (label), get_nice_level (new_nice_value));
}
@@ -182,7 +182,7 @@ procdialog_create_renice_dialog (ProcData *procdata)
gtk_container_set_border_width (GTK_CONTAINER (renice_dialog), 5);
button = gtk_button_new ();
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_container_add (GTK_CONTAINER (button), align);
@@ -201,7 +201,7 @@ procdialog_create_renice_dialog (ProcData *procdata)
gtk_dialog_set_default_response (GTK_DIALOG (renice_dialog), 100);
new_nice_value = -100;
- dialog_vbox = GTK_DIALOG (dialog)->vbox;
+ dialog_vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_box_set_spacing (GTK_BOX (dialog_vbox), 2);
gtk_container_set_border_width (GTK_CONTAINER (dialog_vbox), 5);
@@ -513,7 +513,7 @@ procdialog_create_preferences_dialog (ProcData *procdata)
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
prefs_dialog = dialog;
- main_vbox = GTK_DIALOG (dialog)->vbox;
+ main_vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_box_set_spacing (GTK_BOX (main_vbox), 2);
notebook = gtk_notebook_new ();
diff --git a/src/procman.cpp b/src/procman.cpp
index c252ef9..b5c0d0a 100644
--- a/src/procman.cpp
+++ b/src/procman.cpp
@@ -555,7 +555,7 @@ procman_save_config (ProcData *data)
procman_save_tree_state (data->client, data->tree, "/apps/procman/proctree");
procman_save_tree_state (data->client, data->disk_list, "/apps/procman/disktreenew");
- gdk_drawable_get_size (data->app->window, &width, &height);
+ gdk_drawable_get_size (gtk_widget_get_window (data->app), &width, &height);
data->config.width = width;
data->config.height = height;
diff --git a/src/sysinfo.cpp b/src/sysinfo.cpp
index 76690eb..a6b7870 100644
--- a/src/sysinfo.cpp
+++ b/src/sysinfo.cpp
@@ -416,12 +416,15 @@ sysinfo_logo_expose (GtkWidget *widget,
GdkEventExpose *event,
gpointer data_ptr)
{
+ GtkAllocation allocation;
+ GtkStyle *style;
cairo_t *cr;
cairo_pattern_t *cp;
- cr = gdk_cairo_create(widget->window);
+ cr = gdk_cairo_create(gtk_widget_get_window(widget));
- cairo_translate(cr, widget->allocation.x, widget->allocation.y);
+ gtk_widget_get_allocation (widget, &allocation);
+ cairo_translate(cr, allocation.x, allocation.y);
cairo_move_to(cr, X_PAD + RADIUS, Y_PAD);
cairo_line_to(cr, X_PAD + LOGO_W - RADIUS, Y_PAD);
@@ -434,15 +437,16 @@ sysinfo_logo_expose (GtkWidget *widget,
cairo_arc(cr, X_PAD + RADIUS, Y_PAD + RADIUS, RADIUS, -1.0 * M_PI, -0.5 * M_PI);
cp = cairo_pattern_create_linear(0, Y_PAD, 0, Y_PAD + LOGO_H);
+ style = gtk_widget_get_style (widget);
cairo_pattern_add_color_stop_rgba(cp, 0.0,
- widget->style->base[GTK_STATE_SELECTED].red / 65535.0,
- widget->style->base[GTK_STATE_SELECTED].green / 65535.0,
- widget->style->base[GTK_STATE_SELECTED].blue / 65535.0,
+ style->base[GTK_STATE_SELECTED].red / 65535.0,
+ style->base[GTK_STATE_SELECTED].green / 65535.0,
+ style->base[GTK_STATE_SELECTED].blue / 65535.0,
1.0);
cairo_pattern_add_color_stop_rgba(cp, 1.0,
- widget->style->base[GTK_STATE_SELECTED].red / 65535.0,
- widget->style->base[GTK_STATE_SELECTED].green / 65535.0,
- widget->style->base[GTK_STATE_SELECTED].blue / 65535.0,
+ style->base[GTK_STATE_SELECTED].red / 65535.0,
+ style->base[GTK_STATE_SELECTED].green / 65535.0,
+ style->base[GTK_STATE_SELECTED].blue / 65535.0,
0.0);
cairo_set_source(cr, cp);
cairo_fill(cr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]