Focus the desktop when showing it. Fixes #159257.

2004-12-19  Elijah Newren  <newren@gmail.com>

	Focus the desktop when showing it.  Fixes #159257.

	* src/display.c (event_callback): obtain a timestamp to pass to
	meta_screen_show_desktop

	* src/keybindings.c (handle_toggle_desktop): obtain a timestamp to
	pass to meta_screen_show_desktop

	* src/screen.c (meta_screen_show_desktop): add a timestamp
	parameter, get the most recently used window of type DESKTOP (if
	there is one) and focus it

	* src/screen.h (meta_screen_show_desktop): add a timestamp
	parameter
This commit is contained in:
Elijah Newren 2004-12-20 02:46:42 +00:00 committed by Elijah Newren
parent c3a607f999
commit d8d77bd65b
5 changed files with 44 additions and 4 deletions

View File

@ -1,3 +1,20 @@
2004-12-19 Elijah Newren <newren@gmail.com>
Focus the desktop when showing it. Fixes #159257.
* src/display.c (event_callback): obtain a timestamp to pass to
meta_screen_show_desktop
* src/keybindings.c (handle_toggle_desktop): obtain a timestamp to
pass to meta_screen_show_desktop
* src/screen.c (meta_screen_show_desktop): add a timestamp
parameter, get the most recently used window of type DESKTOP (if
there is one) and focus it
* src/screen.h (meta_screen_show_desktop): add a timestamp
parameter
2004-12-19 Elijah Newren <newren@gmail.com> 2004-12-19 Elijah Newren <newren@gmail.com>
Thanks to ash@contact.bg for this fix. Thanks to ash@contact.bg for this fix.

View File

@ -2152,7 +2152,7 @@ event_callback (XEvent *event,
meta_verbose ("Request to %s desktop\n", showing_desktop ? "show" : "hide"); meta_verbose ("Request to %s desktop\n", showing_desktop ? "show" : "hide");
if (showing_desktop) if (showing_desktop)
meta_screen_show_desktop (screen); meta_screen_show_desktop (screen, meta_display_get_current_time_roundtrip (display));
else else
{ {
meta_screen_unshow_desktop (screen); meta_screen_unshow_desktop (screen);

View File

@ -2837,7 +2837,7 @@ handle_toggle_desktop (MetaDisplay *display,
event->xkey.time); event->xkey.time);
} }
else else
meta_screen_show_desktop (screen); meta_screen_show_desktop (screen, event->xkey.time);
} }
static void static void

View File

@ -2229,8 +2229,11 @@ meta_screen_minimize_all_on_active_workspace_except (MetaScreen *screen,
} }
void void
meta_screen_show_desktop (MetaScreen *screen) meta_screen_show_desktop (MetaScreen *screen,
Time timestamp)
{ {
GList *windows;
if (screen->active_workspace->showing_desktop) if (screen->active_workspace->showing_desktop)
return; return;
@ -2238,6 +2241,25 @@ meta_screen_show_desktop (MetaScreen *screen)
queue_windows_showing (screen); queue_windows_showing (screen);
/* Focus the most recently used META_WINDOW_DESKTOP window, if there is one;
* see bug 159257.
*/
windows = screen->active_workspace->mru_list;
while (windows != NULL)
{
MetaWindow *w = windows->data;
if (w->screen == screen &&
w->type == META_WINDOW_DESKTOP)
{
meta_window_focus (w, timestamp);
break;
}
windows = windows->next;
}
meta_screen_update_showing_desktop_hint (screen); meta_screen_update_showing_desktop_hint (screen);
} }

View File

@ -200,7 +200,8 @@ void meta_screen_minimize_all_on_active_workspace_except (MetaScreen *screen
MetaWindow *keep); MetaWindow *keep);
/* Show/hide the desktop (temporarily hide all windows) */ /* Show/hide the desktop (temporarily hide all windows) */
void meta_screen_show_desktop (MetaScreen *screen); void meta_screen_show_desktop (MetaScreen *screen,
Time timestamp);
void meta_screen_unshow_desktop (MetaScreen *screen); void meta_screen_unshow_desktop (MetaScreen *screen);
/* Update whether the destkop is being shown for the current active_workspace */ /* Update whether the destkop is being shown for the current active_workspace */