Bug 578833 - [Win32] Table remains visible though setVisible(false) was called
Summary: [Win32] Table remains visible though setVisible(false) was called
Status: CLOSED MOVED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.23   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 552277 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-02-18 10:37 EST by Thomas Singer CLA
Modified: 2022-06-23 10:41 EDT (History)
3 users (show)

See Also:


Attachments
Snippet to reproduce (1.78 KB, text/plain)
2022-02-18 10:37 EST, Thomas Singer CLA
no flags Details
Screenshot on Windows 10 (11.39 KB, image/png)
2022-02-18 10:38 EST, Thomas Singer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Singer CLA 2022-02-18 10:37:29 EST
Please run the attached snippet. The table is still showing.
Comment 1 Thomas Singer CLA 2022-02-18 10:37:49 EST
Created attachment 288075 [details]
Snippet to reproduce
Comment 2 Thomas Singer CLA 2022-02-18 10:38:34 EST
Created attachment 288076 [details]
Screenshot on Windows 10
Comment 3 Alexandr Miloslavskiy CLA 2022-02-18 10:53:53 EST
`table.setItemCount()` calls `new TableItem()`, which calls `setDeferResize()`, which manipulates `WM_SETREDRAW`, which makes invisible window visible. `Control.setRedraw()` has a comment about this side effect.

MSDN says [1]:
Passing a WM_SETREDRAW message to the DefWindowProc function removes the WS_VISIBLE style from the window when wParam is set to FALSE. Although the window content remains visible on screen, the IsWindowVisible function returns FALSE when called on a window in this state.

Passing a WM_SETREDRAW message to the DefWindowProc function adds the WS_VISIBLE style to the window, if not set, when wParam is set to TRUE. If your application sends the WM_SETREDRAW message with wParam set to TRUE to a hidden window, then the window becomes visible.

[1] https://docs.microsoft.com/en-us/windows/win32/gdi/wm-setredraw
Comment 4 Thomas Singer CLA 2022-02-18 11:12:09 EST
duplicate of bug 552277
Comment 5 Niraj Modi CLA 2022-06-23 10:36:05 EDT
*** Bug 552277 has been marked as a duplicate of this bug. ***
Comment 6 Niraj Modi CLA 2022-06-23 10:41:46 EDT
Moved this bug to github:
https://github.com/eclipse-platform/eclipse.platform.swt/issues/223