GNOME Bugzilla – Bug 115846
Focus is forcibly switched after sending WM_DELETE to a window
Last modified: 2004-12-22 21:47:04 UTC
In metacity-2.4.34/src/delete.c, in function meta_window_delete () the code looks like this (in particular, note the comment in the window->has_focus case) if (window->delete_window) { meta_topic (META_DEBUG_WINDOW_OPS, "Deleting %s with delete_window request\n", window->desc); meta_window_send_icccm_message (window, window->display->atom_wm_delete_window, timestamp); } [...] if (window->has_focus) { /* This is unfortunately going to result in weirdness * if the window doesn't respond to the delete event. * I don't know how to avoid that though. */ meta_topic (META_DEBUG_FOCUS, "Focusing top window because focus window %s was deleted/killed\n", window->desc); meta_screen_focus_top_window (window->screen, window); } If a user tries to close the window and the window denies the request to be closed (e.g. a JFrame that has its close operation set to the DO_NOTHING_ON_CLOSE), the focus is still switced to some other window. See sun Bug Id 4877726: http://developer.java.sun.com/developer/bugParade/bugs/4877726.html
The problem here is that I put that code there for some reason, and I don't remember what the reason was. :-( Makes it hard to evaluate the right thing to do. We can just take it out and see what happens I suppose.
Okay, I'm marking this as a dup of bug #108706 - Havoc has already disabled this behaviour pending any reports of weirdness without it. *** This bug has been marked as a duplicate of 108706 ***