[gnome-shell/wip/carlosg/launch-context] shell-global: Use MetaLaunchContext instead of GdkLaunchContext
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/launch-context] shell-global: Use MetaLaunchContext instead of GdkLaunchContext
- Date: Thu, 13 Dec 2018 20:53:05 +0000 (UTC)
commit 0b58d9d7ed84400bafebc1fad7b246a2f12d0485
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Dec 13 20:42:41 2018 +0100
shell-global: Use MetaLaunchContext instead of GdkLaunchContext
Is functionally the same, without requiring the MetaX11Display.
src/shell-global.c | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
---
diff --git a/src/shell-global.c b/src/shell-global.c
index dbd3bbe95..02827e3a7 100644
--- a/src/shell-global.c
+++ b/src/shell-global.c
@@ -1388,24 +1388,32 @@ shell_global_create_app_launch_context (ShellGlobal *global,
guint32 timestamp,
int workspace)
{
- GdkAppLaunchContext *context;
+ MetaWorkspaceManager *workspace_manager = global->workspace_manager;
+ MetaStartupNotification *sn;
+ MetaLaunchContext *context;
+ MetaWorkspace *ws = NULL;
- context = gdk_display_get_app_launch_context (global->gdk_display);
+ sn = meta_display_get_startup_notification (global->meta_display);
+ context = meta_startup_notification_create_launcher (sn);
if (timestamp == 0)
timestamp = shell_global_get_current_time (global);
- gdk_app_launch_context_set_timestamp (context, timestamp);
+ if (timestamp != 0)
+ meta_launch_context_set_timestamp (context, timestamp);
if (workspace < 0)
{
- MetaWorkspaceManager *workspace_manager = global->workspace_manager;
-
- workspace =
- meta_workspace_manager_get_active_workspace_index (workspace_manager);
+ ws = meta_workspace_manager_get_active_workspace (workspace_manager);
}
- gdk_app_launch_context_set_desktop (context, workspace);
+ else
+ {
+ ws = meta_workspace_manager_get_workspace_by_index (workspace_manager,
+ workspace);
+ }
+
+ meta_launch_context_set_workspace (context, ws);
- return (GAppLaunchContext *)context;
+ return (GAppLaunchContext *) context;
}
typedef struct
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]