diff --git a/src/sview/common.c b/src/sview/common.c index 3b4d5d5174cb7aa556a488d3f06b7179ba6e071d..c1e195f6c9855520715da74dd77ad422014c9327 100644 --- a/src/sview/common.c +++ b/src/sview/common.c @@ -1242,10 +1242,47 @@ found: extern void sview_widget_modify_bg(GtkWidget *widget, GtkStateType state, const GdkColor color) { - GtkRcStyle *rc_style = gtk_widget_get_modifier_style (widget); +/* DEF_TIMERS; */ + +/* START_TIMER; */ + if(fast_bg) { + GtkRcStyle *rc_style = gtk_widget_get_modifier_style (widget); + widget->style->bg[state] = color; + rc_style->bg[state] = color; + rc_style->color_flags[state] |= GTK_RC_BG; + gtk_widget_reset_rc_styles (widget); + } else + gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, &color); +/* END_TIMER; */ +/* g_print("got %s\n", TIME_STR); */ + +/* START_TIMER; */ +/* GtkRcStyle *rc_style = gtk_widget_get_modifier_style (grid_button->button); */ +/* END_TIMER; */ +/* g_print("%d 1 took %s\n", grid_button->inx, TIME_STR); */ + +/* grid_button->button-> */ +/* style->bg[GTK_STATE_NORMAL] = color; */ +/* /\* grid_button->button-> *\/ */ +/* /\* style->style->flags[GTK_STATE_NORMAL] = color; *\/ */ +/* START_TIMER; */ +/* rc_style->bg[GTK_STATE_NORMAL] = color; */ +/* rc_style->color_flags[GTK_STATE_NORMAL] |= GTK_RC_BG; */ +/* /\* g_object_set_qdata (G_OBJECT(grid_button->button), *\/ */ +/* /\* quark_rc_style, *\/ */ +/* /\* rc_style); *\/ */ +/* END_TIMER; */ +/* g_print("%d 2 took %s\n", grid_button->inx, TIME_STR); */ +/* START_TIMER; */ +/* gtk_widget_reset_rc_styles (grid_button->button); */ +/* /\* gtk_widget_set_sensitive(grid_button->button, 0); *\/ */ +/* /\* gtk_widget_set_sensitive(grid_button->button, 1); *\/ */ + +/* /\* gtk_widget_hide_all(grid_button->button); *\/ */ +/* /\* gtk_widget_show_all(grid_button->button); *\/ */ +/* /\* gtk_widget_modify_bg(grid_button->button, *\/ */ +/* /\* GTK_STATE_NORMAL, &color); *\/ */ +/* END_TIMER; */ +/* g_print("%d 3 took %s\n", grid_button->inx, TIME_STR); */ - widget->style->bg[state] = color; - rc_style->bg[state] = color; - rc_style->color_flags[state] |= GTK_RC_BG; - gtk_widget_reset_rc_styles (widget); } diff --git a/src/sview/grid.c b/src/sview/grid.c index 3da54b05339af4277f9e67e448b92a1beff28ebc..2b9cdd39c430039d775cef1c6c94f0544a4085ce 100644 --- a/src/sview/grid.c +++ b/src/sview/grid.c @@ -464,34 +464,6 @@ extern char *change_grid_color(List button_list, int start, int end, grid_button->color_inx = color_inx; sview_widget_modify_bg(grid_button->button, GTK_STATE_NORMAL, color); -/* START_TIMER; */ -/* GtkRcStyle *rc_style = gtk_widget_get_modifier_style (grid_button->button); */ -/* END_TIMER; */ -/* g_print("%d 1 took %s\n", grid_button->inx, TIME_STR); */ - -/* grid_button->button-> */ -/* style->bg[GTK_STATE_NORMAL] = color; */ -/* /\* grid_button->button-> *\/ */ -/* /\* style->style->flags[GTK_STATE_NORMAL] = color; *\/ */ -/* START_TIMER; */ -/* rc_style->bg[GTK_STATE_NORMAL] = color; */ -/* rc_style->color_flags[GTK_STATE_NORMAL] |= GTK_RC_BG; */ -/* /\* g_object_set_qdata (G_OBJECT(grid_button->button), *\/ */ -/* /\* quark_rc_style, *\/ */ -/* /\* rc_style); *\/ */ -/* END_TIMER; */ -/* g_print("%d 2 took %s\n", grid_button->inx, TIME_STR); */ -/* START_TIMER; */ -/* gtk_widget_reset_rc_styles (grid_button->button); */ -/* /\* gtk_widget_set_sensitive(grid_button->button, 0); *\/ */ -/* /\* gtk_widget_set_sensitive(grid_button->button, 1); *\/ */ - -/* /\* gtk_widget_hide_all(grid_button->button); *\/ */ -/* /\* gtk_widget_show_all(grid_button->button); *\/ */ -/* /\* gtk_widget_modify_bg(grid_button->button, *\/ */ -/* /\* GTK_STATE_NORMAL, &color); *\/ */ -/* END_TIMER; */ -/* g_print("%d 3 took %s\n", grid_button->inx, TIME_STR); */ } } list_iterator_destroy(itr); @@ -806,6 +778,9 @@ extern int get_system_stats(GtkTable *table) node_list = create_node_info_list(node_info_ptr, changed); setup_grid_table(main_grid_table, grid_button_list, node_list); gtk_widget_show_all(GTK_WIDGET(main_grid_table)); + + fast_bg = GTK_CHECK_VERSION(2,16,0); + return SLURM_SUCCESS; } diff --git a/src/sview/sview.c b/src/sview/sview.c index b5f12db7230394f118c8d37b9859dc6091ba7150..8fdfd52326d93f694eaf8ab7ce9bb3705f1af09a 100644 --- a/src/sview/sview.c +++ b/src/sview/sview.c @@ -66,6 +66,7 @@ GStaticMutex sview_mutex = G_STATIC_MUTEX_INIT; GMutex *grid_mutex = NULL; GCond *grid_cond = NULL; GtkActionGroup *admin_action_group = NULL; +int fast_bg = 0; display_data_t main_display_data[] = { {G_TYPE_NONE, JOB_PAGE, "Jobs", TRUE, -1, diff --git a/src/sview/sview.h b/src/sview/sview.h index 6bbec78d0d599af392404cfa3353fe0c63da947f..ffb5b7affd7b4ef428b68a5c8e16b5406cb5c8f1 100644 --- a/src/sview/sview.h +++ b/src/sview/sview.h @@ -263,6 +263,7 @@ extern GtkTable *main_grid_table; extern GStaticMutex sview_mutex; extern int cpus_per_node; extern int g_node_scaling; +extern int fast_bg; extern void init_grid(node_info_msg_t *node_info_ptr); extern int set_grid(int start, int end, int count);