GNOME Bugzilla – Bug 102665
Unminimizing from window list right-click menu doesn't focus unminimized window
Last modified: 2004-12-22 21:47:04 UTC
From a recent review by a Sun beta tester: "When a minimize window is restored by selecting Unminimize in the window menu (using either the pointing device or keyboard), focus is not assigned to the restored window. However, when a minimized window is restored by clicking the tasklist button, focus is assigned to the restored window. The window should receive focus regardless of the method used to perform the action."
I am tranferring this bug to libwnck as I believe that is the correct product category. It seems that the request is that wnck_window_minimize() should also call wnck_window_activate() to activate the window.
Updating status_whiteboard field to reflect A11Y team's assessment of accessibility impact.
Apologies for spam... marking as GNOMEVER2.3 so it appears on the official GNOME bug list :)
Created attachment 19342 [details] [review] Patch fixes the bug.
Did someone review this patch ?
Havoc, is this ok to apply for 2.6.1?
Personally, I'm curious as to whether having Metacity itself do the focusing when unminimizing a window would be better than having libwnck instruct Metacity to do it. In particular, I believe this depends on focus mode. For click-to-focus we want the unminimized window to be focused. For mouse focus, we only want it focused if the window happens to be under the mouse after being unminimized (unless we want to break that invariant here, but I dislike breaking invariants where not necessary?). For sloppy focus, who knows? ...focus it unless a different window is under the mouse? (See also bug 135810, which discusses issues of which window to focus for the various focus modes in more detail) Anyway, unless the policy is _always_ focus a window being unminimized (which I'm not so sure it should be), the patch belongs in Metacity. Metacity may be the better place anyway, because that leaves room for future flexibility if we change our minds about the best operation. I'm going to cc metacity-maint because of this...
That seems sensible, but may have unexpected side effects if you implemented it and tried it out. Only way to know would be to try it.
Actually, this bug (and a very closely related one introduced by the _NET_WM_USER_TIME commit) is further proof that _NET_WM_STATE_MINIMIZED would be really nice for the spec to have. Let me explain: libwnck uses either gdk_window_show or XMapRaised to unminimize a window. This window needs to be focused in the case of click-to-focus or sloppy-focus, but not for mouse-focus. libwnck doesn't know that, so Metacity has to do it. This means having Metacity somehow intercept a window being remapped, and then focusing the appropriate window (although that raises the question, "How does Metacity know whether the remapped window should be focused? Should it be in all cases, or only in the case where libwnck caused it to happen?") Also, since libwnck is remapping a window that probably is not the most recently interacted with, it appears below the focused window. libwnck could manually set the _NET_WM_USER_TIME hint before deiconifying the window, but wouldn't this be a better job for the window manager to handle? As the complexity increases, it just seems that it would be nicer to have the tasklist be able to send a message to the WM saying "unminimize this window, and do all the other stuff you need to do", instead of having the tasklist try to do all that work itself, and somehow keep in sync with the WM policy.
I'm going to second guess myself and say that Vijaykumar's patch could be viewed as correct, with the following logic: The choice of window to focus after close/minimize/switch-desktop does depend on focus method, as I pointed out (see bug 135810). However, unminimize can be viewed as the same as launching a new window, which ignores the methods in bug 135810 and merely compares timestamps (see bug 118372) to determine whether to focus the window. That actually does sound pretty appealing, since uniminimize does act a lot more like a new window launching than it does like close/minimize/switch-desktop. Thoughts?
Er, let me modify that statement slightly to "Vijaykumar's patch could be viewed as providing correct behavior". I really think that what I wrote above, as well as what Rob wrote in comment 95 of bug 118372, is valid about it being Metacity's responsibility to do the work. But Vijaykumar's patch could possibly be used as a temporary hack to make things work right.
This has been fixed by the patches in bug 118372 (skip the first 100 comments or so and then start reading; only the last 10 or so comments were about the patches related to this bug).