Skip to content

Commit

Permalink
fix(gpu): nvidia fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ljuzig committed Apr 17, 2024
1 parent 2ac65d9 commit bd65e7d
Show file tree
Hide file tree
Showing 2 changed files with 207 additions and 142 deletions.
20 changes: 10 additions & 10 deletions src/gpu/gpuMenuComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ export default class GpuMenuComponent {
orientation: Clutter.Orientation.HORIZONTAL
}),
x_expand: true,
style: 'margin-left:0.5em;margin-right:0;'
style: 'margin-left:0.15em;margin-right:0;'
});

const usedContainer = new St.Widget({
Expand Down Expand Up @@ -933,7 +933,7 @@ export default class GpuMenuComponent {

footerContainer.add_child(totalContainer);

grid.addToGrid(footerContainer);
grid.addToGrid(footerContainer, 2);

popup.addToMenu(grid, 2);

Expand Down Expand Up @@ -1032,12 +1032,7 @@ export default class GpuMenuComponent {

for(let processNum = 0; processNum < numProcesses; processNum++) {
const processData = data.topProcesses[processNum];
if(processData) {
const process = popup.processes[processNum];
for(let i = 0; i < numValues; i++) {
process.values[i].show();
}
} else {
if(!processData) {
const process = popup.processes[processNum];
for(let i = 0; i < numValues; i++) {
process.values[i].hide();
Expand All @@ -1052,11 +1047,16 @@ export default class GpuMenuComponent {
const pipe = processData.pipes[i - 1];
if(!pipe) {
processValues[i].text = '-';
processValues[i].hide();
continue;
}
processValues[i].show();

if(pipe.unit === '%') processValues[i].text = pipe.value.toFixed(0) + '%';
else processValues[i].text = Utils.formatBytes(pipe.value, 'kB-KB', 4);
if(pipe.unit === '%') {
processValues[i].text = pipe.value.toFixed(0) + '%';
} else {
processValues[i].text = Utils.formatBytes(pipe.value, 'kB-KB', 4);
}
}
}
};
Expand Down
Loading

0 comments on commit bd65e7d

Please sign in to comment.