GNOME Bugzilla – Bug 151990
Prevent focus inconsistencies by only providing one focus method
Last modified: 2004-12-22 21:47:04 UTC
meta_workspace_focus_default_window is designed to do the correct thing for all focus modes. meta_workspace_focus_mru_window and meta_workspace_focus_top_window are designed for special cases only used in certain focus modes (and are called by meta_workspace_focus_default_window). Thus, I think it would make sense to make the latter two functions static and remove them from the workspace.h header file. This would help prevent future patches from introducing focus inconsistencies. I will attach a patch momentarily.
Created attachment 31331 [details] [review] Remove all but one focus function from workspace.h
Ooops, I should have explained why I removed the meta_workspace_focus_top_window from screen.c instead of replacing it with meta_workspace_focus_default_window. I did some testing, looking through debug logs, etc., and found that in click-to-focus mode the meta_workspace_focus_top_window call there would merely focus the window that already had focus when the user pressed Ctrl-Alt-d to show the desktop. (In other words, when the desktop was shown, no shuffling occurred that would prevent the window that previously had focus from getting focus again). In sloppy and mouse focus modes, the focus might switch to a different window that was hidden (if the window that was focus was stacked below another). Switching to meta_workspace_focus_default_window would just make sure that in all three focus modes, the window that had focus would again be focused when the user tried to show the desktop. That's merely a waste of effort, so I removed the call.
Comment on attachment 31331 [details] [review] Remove all but one focus function from workspace.h Good cleanup, thanks.
committed.