diff --git a/src/core/workspace-private.h b/src/core/workspace-private.h index a58b2347d..f0d896f6c 100644 --- a/src/core/workspace-private.h +++ b/src/core/workspace-private.h @@ -92,6 +92,7 @@ GList* meta_workspace_get_onscreen_region (MetaWorkspace *workspace); GList * meta_workspace_get_onmonitor_region (MetaWorkspace *workspace, MetaLogicalMonitor *logical_monitor); +MetaWindow * meta_workspace_get_default_focus_window (MetaWorkspace *workspace); void meta_workspace_focus_default_window (MetaWorkspace *workspace, MetaWindow *not_this_one, guint32 timestamp); diff --git a/src/core/workspace.c b/src/core/workspace.c index 321d3efb0..564c5589d 100644 --- a/src/core/workspace.c +++ b/src/core/workspace.c @@ -1284,6 +1284,20 @@ meta_workspace_get_name (MetaWorkspace *workspace) return meta_prefs_get_workspace_name (meta_workspace_index (workspace)); } +MetaWindow * +meta_workspace_get_default_focus_window (MetaWorkspace *workspace) +{ + if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK) + { + return meta_stack_get_default_focus_window (workspace->display->stack, + workspace, NULL); + } + else + { + return NULL; + } +} + void meta_workspace_focus_default_window (MetaWorkspace *workspace, MetaWindow *not_this_one,