Skip to content

Commit 7612891

Browse files
committed
lstopo/draw: don't show the interactive usage again on refresh
Signed-off-by: Brice Goglin <[email protected]>
1 parent 5468925 commit 7612891

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

utils/lstopo/lstopo-cairo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@ output_x11(struct lstopo_output *loutput, const char *dummy __hwloc_attribute_un
365365

366366
XMapWindow(dpy, top);
367367

368-
lstopo_show_interactive_help();
368+
if (!loutput->refreshing)
369+
lstopo_show_interactive_help();
369370

370371
/* ready */
371372
declare_colors(loutput);

utils/lstopo/lstopo-windows.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,9 @@ output_windows (struct lstopo_output *loutput, const char *dummy __hwloc_attribu
440440
toplevel = CreateWindow("lstopo", loutput->title, WS_OVERLAPPEDWINDOW,
441441
CW_USEDEFAULT, CW_USEDEFAULT,
442442
10, 10, NULL, NULL, NULL, NULL);
443+
assert(!loutput->refreshing);
444+
} else {
445+
assert(loutput->refreshing);
443446
}
444447

445448
/* recurse once for preparing sizes and positions using a fake top level window */
@@ -491,7 +494,9 @@ output_windows (struct lstopo_output *loutput, const char *dummy __hwloc_attribu
491494
declare_colors(loutput);
492495
lstopo_prepare_custom_styles(loutput);
493496

494-
lstopo_show_interactive_help();
497+
if (!loutput->refreshing)
498+
lstopo_show_interactive_help();
499+
495500
ShowWindow(toplevel, SW_SHOWDEFAULT);
496501
InvalidateRect(toplevel, NULL, 1); /* make sure UpdateWindow() will update something when refreshing the topology */
497502
UpdateWindow(toplevel);

utils/lstopo/lstopo.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,8 @@ main (int argc, char *argv[])
664664

665665
hwloc_utils_check_api_version(callname);
666666

667+
loutput.refreshing = 0;
668+
667669
loutput.overwrite = 0;
668670

669671
loutput.index_type = LSTOPO_INDEX_TYPE_DEFAULT;
@@ -1498,8 +1500,10 @@ main (int argc, char *argv[])
14981500

14991501
hwloc_topology_destroy (topology);
15001502

1501-
if (loutput.needs_topology_refresh)
1503+
if (loutput.needs_topology_refresh) {
1504+
loutput.refreshing = 1;
15021505
goto refresh;
1506+
}
15031507

15041508
for(i=0; i<loutput.legend_append_nr; i++)
15051509
free(loutput.legend_append[i]);

utils/lstopo/lstopo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ struct lstopo_output {
4444

4545
/* when an interactive backends want a refresh of the topology */
4646
int needs_topology_refresh;
47+
/* when actually doing a refresh */
48+
int refreshing;
4749

4850
/* file config */
4951
FILE *file;

0 commit comments

Comments
 (0)