Sebastien,

After upgrading to fiesty this bug still exists and seeing how it looks
like it'll still be here in gutsy I have decided to do something about
it (this is after all the point of all this open source stuff)

I've written a patch that fixes the problem by changing the number of
lines shown as the graph re sizes (see the screenshot attached)

I'm not sure the best way to provide the patch but here is the output of diff.  
If you want a better format let me know and i'll try to provide it.
Could you also pass this upstream as I don't have a bugzilla account 

the file is trunck/src/load-graph.cpp

this is the diff between my patch and the current ubuntu
i think the #include <gtkmm.h> is an error (not part of my patch) as I've been 
working from 2.18.1.1 as I can't get 2.19.4 to configure but I've done the diff 
against 2.19.4

diff  ./src/load-graph.cpp ../gnome-system-monitor-2.19.4/src/load-
graph.cpp

1a2,4
> 
> #include <gtkmm.h>
> 
96d98
<       int num_bars;
114,131c116,117
<       /* work out how many lines across the graph (plus one)*/
<       num_bars =(g->draw_height) / (fontsize + 5);
<       switch (num_bars){
<               case 1:
<                       break;
<               case 2:
<               case 3:
<                       num_bars=2;
<                       break;
<               case 4:
<                       num_bars=4;
<                       break;
<               default:
<                       num_bars=5;
<       }
< 
<       dely = (g->draw_height) / num_bars; /* round to int to avoid AA blur */
<       real_draw_height = dely * num_bars;
---
>       dely = (g->draw_height) / 5; /* round to int to avoid AA blur */
>       real_draw_height = dely * 5;
133c119
<       for (i = 0; i <= num_bars; ++i) {
---
>       for (i = 0; i <= 5; ++i) {
137c123,127
<               if (i==num_bars)
---
>               switch (i) {
>               case 0:
>                       y = 0.5 + fontsize / 2.0;
>                       break;
>               case 5:
139,143c129,132
<               else {
<                       if (i==0)
<                               y =  0.5 +(i * dely) + (fontsize / 2.0);
<                       else
<                               y =  (i * dely) + (fontsize / 2.0);
---
>                       break;
>               default:
>                       y = i * dely + fontsize / 2.0;
>                       break;
147c136
<               caption = g_strdup_printf("%3d %%", 100 - i * (100/num_bars));
---
>               caption = g_strdup_printf("%3d %%", 100 - i * 20);


--------------------------------------------------------------------
this is the diff against the  current upstream svn trunk

99d98
<       int num_bars;
117,131c116,117
<       /* work out how many lines across the graph (plus one)*/
<       num_bars =(g->draw_height) / (fontsize + 3);
<       switch (num_bars){
<               case 1:
<                       break;
<               case 2:
<               case 3:
<                       num_bars=2;
<                       break;
<               case 4:
<                       num_bars=4;
<                       break;
<               default:
<                       num_bars=5;
<       }
---
>       dely = (g->draw_height) / 5; /* round to int to avoid AA blur */
>       real_draw_height = dely * 5;
133,136c119
<       dely = (g->draw_height) / num_bars; /* round to int to avoid AA blur */
<       real_draw_height = dely * num_bars;
< 
<       for (i = 0; i <= num_bars; ++i) {
---
>       for (i = 0; i <= 5; ++i) {
140c123,127
<               if (i==num_bars)
---
>               switch (i) {
>               case 0:
>                       y = 0.5 + fontsize / 2.0;
>                       break;
>               case 5:
142,146c129,132
<               else {
<                       if (i==0)
<                               y =  0.5 +(i * dely) + (fontsize / 2.0);
<                       else
<                               y =  (i * dely) + (fontsize / 2.0);
---
>                       break;
>               default:
>                       y = i * dely + fontsize / 2.0;
>                       break;
150c136
<               caption = g_strdup_printf("%3d %%", 100 - i * (100/num_bars));
---
>               caption = g_strdup_printf("%3d %%", 100 - i * 20);



** Attachment added: "Screenshot-System Monitor.png"
   http://launchpadlibrarian.net/8176732/Screenshot-System%20Monitor.png

-- 
gnome-system-monitor shows squashed key in resources graphs
https://bugs.launchpad.net/bugs/68620
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is a bug assignee.

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to