kathenas / rpms / mutter

Forked from rpms/mutter 5 years ago
Clone

Blame SOURCES/0001-workspace-manager-Expose-layout-properties.patch

88c283
From 52536a44e96aa34d3ec3b9332adaa15a6399fc3e Mon Sep 17 00:00:00 2001
88c283
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
88c283
Date: Tue, 4 Jun 2019 21:21:37 +0200
88c283
Subject: [PATCH] workspace-manager: Expose layout properties
88c283
88c283
gnome-shell hardcodes a vertical one-column workspace layout, and
88c283
while not supporting arbitrary grids is very much by design, it
88c283
currently doesn't have a choice: We simply don't expose the workspace
88c283
layout we use.
88c283
88c283
Change that to allow gnome-shell to be a bit more flexible with the
88c283
workspace layouts it supports.
88c283
88c283
https://gitlab.gnome.org/GNOME/mutter/merge_requests/618
88c283
---
88c283
 src/core/meta-workspace-manager.c | 27 +++++++++++++++++++++++++++
88c283
 1 file changed, 27 insertions(+)
88c283
88c283
diff --git a/src/core/meta-workspace-manager.c b/src/core/meta-workspace-manager.c
88c283
index 8e1f03fe8..fbae34c73 100644
88c283
--- a/src/core/meta-workspace-manager.c
88c283
+++ b/src/core/meta-workspace-manager.c
88c283
@@ -50,6 +50,9 @@ enum
88c283
 {
88c283
   PROP_0,
88c283
 
88c283
+  PROP_LAYOUT_COLUMNS,
88c283
+  PROP_LAYOUT_ROWS,
88c283
+
88c283
   PROP_N_WORKSPACES
88c283
 };
88c283
 
88c283
@@ -68,6 +71,12 @@ meta_workspace_manager_get_property (GObject    *object,
88c283
 
88c283
   switch (prop_id)
88c283
     {
88c283
+    case PROP_LAYOUT_COLUMNS:
88c283
+      g_value_set_int (value, workspace_manager->columns_of_workspaces);
88c283
+      break;
88c283
+    case PROP_LAYOUT_ROWS:
88c283
+      g_value_set_int (value, workspace_manager->rows_of_workspaces);
88c283
+      break;
88c283
     case PROP_N_WORKSPACES:
88c283
       g_value_set_int (value, meta_workspace_manager_get_n_workspaces (workspace_manager));
88c283
       break;
88c283
@@ -154,6 +163,22 @@ meta_workspace_manager_class_init (MetaWorkspaceManagerClass *klass)
88c283
                   0, NULL, NULL, NULL,
88c283
                   G_TYPE_NONE, 0);
88c283
 
88c283
+  g_object_class_install_property (object_class,
88c283
+                                   PROP_LAYOUT_COLUMNS,
88c283
+                                   g_param_spec_int ("layout-columns",
88c283
+                                                     "Layout columns",
88c283
+                                                     "Number of columns in layout",
88c283
+                                                     -1, G_MAXINT, 1,
88c283
+                                                     G_PARAM_READABLE));
88c283
+
88c283
+  g_object_class_install_property (object_class,
88c283
+                                   PROP_LAYOUT_ROWS,
88c283
+                                   g_param_spec_int ("layout-rows",
88c283
+                                                     "Layout rows",
88c283
+                                                     "Number of rows in layout",
88c283
+                                                     -1, G_MAXINT, -1,
88c283
+                                                     G_PARAM_READABLE));
88c283
+
88c283
   g_object_class_install_property (object_class,
88c283
                                    PROP_N_WORKSPACES,
88c283
                                    g_param_spec_int ("n-workspaces",
88c283
@@ -474,6 +499,8 @@ meta_workspace_manager_update_workspace_layout (MetaWorkspaceManager *workspace_
88c283
                 workspace_manager->columns_of_workspaces,
88c283
                 workspace_manager->vertical_workspaces,
88c283
                 workspace_manager->starting_corner);
88c283
+  g_object_notify (G_OBJECT (workspace_manager), "layout-columns");
88c283
+  g_object_notify (G_OBJECT (workspace_manager), "layout-rows");
88c283
 }
88c283
 
88c283
 /**
88c283
-- 
88c283
2.21.0
88c283