Skip to content

Commit b1b2658

Browse files
committed
lstopo/windows: fix redrawing on autoresizing on Windows 10
When autoresizing the lstopo window, SetWindowPos() with SWP_DEFERERASE causes a late background erase on Windows 10, hence a white screen. In theory this could cause some flickering since this flag was preventing some redraw events in the meantime, but at least things seem to work fine on both Windows 7 and 10 now. Another solution would be to pass SWP_DEFERERASE|SWP_NOREDRAW since we're going to redraw right after SetWindowPos() but Windows 7 would not redraw the background unhidden when downsizing the lstopo window. There's also the possibility of preventing the erasing by catching WM_ERASEBKGND and returning 1. Too many possibilities without enough documentation to clearly understand the best one. Maybe our event loop isn't properly organized anyway. Signed-off-by: Brice Goglin <[email protected]>
1 parent 5087c8f commit b1b2658

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Version 2.3.0
2828
lists of flag names (substrings).
2929
+ Tools that have a --restrict option may now receive a nodeset or
3030
some custom flags for restricting the topology.
31+
+ Fix lstopo drawing when autoresizing on Windows 10
3132

3233

3334
Version 2.2.0

tests/hwloc/ports/include/windows/windows.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2009-2019 Inria. All rights reserved.
2+
* Copyright © 2009-2020 Inria. All rights reserved.
33
* Copyright © 2009-2012 Université Bordeaux
44
* See COPYING in top-level directory.
55
*/

utils/lstopo/lstopo-windows.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
205205

206206
/* SetWindowPos() generates a WM_SIZE event, we don't want to scale the drawing there */
207207
ignore_wm_size = 1;
208-
SetWindowPos(the_output.toplevel, HWND_TOP, 0, 0, rect.right - rect.left, rect.bottom - rect.top, SWP_DEFERERASE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOOWNERZORDER|SWP_NOZORDER);
208+
SetWindowPos(the_output.toplevel, HWND_TOP, 0, 0, rect.right - rect.left, rect.bottom - rect.top, SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOOWNERZORDER|SWP_NOZORDER);
209209
ignore_wm_size = 0;
210210

211211
needs_resize = 0;

0 commit comments

Comments
 (0)