Bug 558723

Summary: Toolbar doesn't get visibile when setting inside setRedraw
Product: [Eclipse Project] Platform Reporter: zzzz <nzanaga>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: rolf.theunissen
Version: 4.14   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=258176
Whiteboard:

Description zzzz CLA 2020-01-02 06:16:40 EST
When setting 'setVisible(true)' on a Toolbar inside a setRedraw, toolbar is never shown


Below the snippet, clicking on button will show the label, but not the toolbar.
Removing setRedraw false/true on toolbar, toolbar will show correctly



        Display display = Display.getDefault();

        Shell s = new Shell(display);
        s.setBounds(0, 0, 600, 400);

        Label lbl1 = new Label(s, SWT.NONE);
        lbl1.setText("label text");
        lbl1.setBounds(20, 20, 200, 30);
        lbl1.setVisible(false);

        ToolBar toolbar1 = new ToolBar(s, SWT.NONE);
        ToolItem toolItem = new ToolItem(toolbar1, SWT.PUSH);
        toolItem.setText("toolbar text");
        toolbar1.setBounds(300, 20, 200, 30);
        toolbar1.setVisible(false);

        Button b1 = new Button(s, SWT.PUSH);
        b1.setText("doit");
        b1.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                lbl1.setRedraw(false);
                lbl1.setVisible(true);
                lbl1.setRedraw(true);

                toolbar1.setRedraw(false);
                toolbar1.setVisible(true);
                toolbar1.setRedraw(true);
            }
        });
        b1.setBounds(20, 60, 200, 30);

        s.open();
        for( ;; ) {
            if( display.isDisposed() || s.isDisposed() )
                return;

            if( !display.readAndDispatch() )
                display.sleep();
        }