[gnome-shell/wip/carlosg/launch-context: 85/85] shell-global: Use MetaLaunchContext instead of GdkLaunchContext



commit b597d5faf05d87b010a0e8fc96e76f44399c910b
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 | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/src/shell-global.c b/src/shell-global.c
index c3b2555aa..df84b6b0d 100644
--- a/src/shell-global.c
+++ b/src/shell-global.c
@@ -1382,24 +1382,26 @@ 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);
+  meta_launch_context_set_timestamp (context, timestamp);
 
   if (workspace < 0)
-    {
-      MetaWorkspaceManager *workspace_manager = global->workspace_manager;
+    ws = meta_workspace_manager_get_active_workspace (workspace_manager);
+  else
+    ws = meta_workspace_manager_get_workspace_by_index (workspace_manager, workspace);
 
-      workspace =
-        meta_workspace_manager_get_active_workspace_index (workspace_manager);
-    }
-  gdk_app_launch_context_set_desktop (context, 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]