Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 335954

Summary: Browser widget beeps when closing shell with Alt+F4
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Markus Keller CLA 2011-02-01 08:38:24 EST
HEAD, happens since at least 3.2.2 (didn't check further back)

When I close a shell that contains a browser widget by pressing Alt+4, a beep is played somewhere in IOleInPlaceObject#InPlaceDeactivate().

In the SDK, this happens with the "Help > Help Contents" window, and it also happens when I detach the Javadoc view and then close it via Alt+F4. Does not happen when I close the child shell by other means.

package snip;

import org.eclipse.swt.*;
import org.eclipse.swt.browser.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

public class SnippetBrowserAltF4 {
    public static void main(String[] args) {
        Display display= new Display();
        final Shell shell= new Shell(display);
        shell.setSize(320, 200);
        shell.setLayout(new GridLayout());
        
        Button button= new Button(shell, SWT.PUSH);
        button.setText("&Open");
        button.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                Shell shell2= new Shell(shell);
                shell2.setLayout(new FillLayout());
                Browser browser= new Browser(shell2, SWT.NONE);
                browser.setText("Close with <b>Alt+F4</b> => beeps.");
                
                Rectangle bounds= shell.getBounds();
                bounds.x += 20;
                bounds.y += 60;
                shell2.setBounds(bounds);
                shell2.open();
            }
        });
        
        shell.open();

        while (!shell.isDisposed()) {
            if (!display.readAndDispatch())
                display.sleep();
        }
        display.dispose();
    }
}

Beeps when stepping over this line:

Thread [main] (Suspended)	
	IOleInPlaceObject.InPlaceDeactivate() line: 21	
	WebSite(OleClientSite).deactivateInPlaceClient() line: 559	
	WebSite(OleClientSite).onDispose(Event) line: 908	
	OleClientSite.access$1(OleClientSite, Event) line: 895	
	OleClientSite$1.handleEvent(Event) line: 129	
	EventTable.sendEvent(Event) line: 89	
	WebSite(Widget).sendEvent(Event) line: 1062	
	WebSite(Widget).sendEvent(int, Event, boolean) line: 1086	
	WebSite(Widget).sendEvent(int) line: 1067	
	WebSite(Widget).release(boolean) line: 817	
	OleFrame(Composite).releaseChildren(boolean) line: 873	
	OleFrame(Widget).release(boolean) line: 820	
	Browser(Composite).releaseChildren(boolean) line: 873	
	Browser(Widget).release(boolean) line: 820	
	Shell(Composite).releaseChildren(boolean) line: 873	
	Shell(Canvas).releaseChildren(boolean) line: 167	
	Shell(Decorations).releaseChildren(boolean) line: 810	
	Shell.releaseChildren(boolean) line: 1290	
	Shell(Widget).release(boolean) line: 820	
	Shell(Widget).dispose() line: 455	
	Shell(Decorations).dispose() line: 483	
	Shell.dispose() line: 714	
	Shell(Decorations).closeWidget() line: 345	
	Shell(Decorations).WM_CLOSE(int, int) line: 1723	
	Shell(Control).windowProc(int, int, int, int) line: 4509	
	Shell(Canvas).windowProc(int, int, int, int) line: 341	
	Shell(Decorations).windowProc(int, int, int, int) line: 1656	
	Shell.windowProc(int, int, int, int) line: 2061	
	Display.windowProc(int, int, int, int) line: 4933	
	OS.CallWindowProcW(int, int, int, int, int) line: not available [native method]	
	OS.CallWindowProc(int, int, int, int, int) line: 2418	
	Shell.callWindowProc(int, int, int, int) line: 495	
	Shell(Control).windowProc(int, int, int, int) line: 4601	
	Shell(Canvas).windowProc(int, int, int, int) line: 341	
	Shell(Decorations).windowProc(int, int, int, int) line: 1656	
	Shell.windowProc(int, int, int, int) line: 2061	
	Display.windowProc(int, int, int, int) line: 4946	
	OS.DispatchMessageW(MSG) line: not available [native method]	
	OS.DispatchMessage(MSG) line: 2524	
	Display.readAndDispatch() line: 3713	
	SnippetBrowserAltF4.main(String[]) line: 37
Comment 1 Lars Vogel CLA 2019-09-24 13:52:01 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.