|
|
066919 |
From 6b8e2636911c79d77d95aaac62336dd4f4063f63 Mon Sep 17 00:00:00 2001
|
|
|
066919 |
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
|
|
066919 |
Date: Tue, 4 Jun 2019 21:21:37 +0200
|
|
|
066919 |
Subject: [PATCH] screen: Expose workspace layout properties
|
|
|
066919 |
|
|
|
066919 |
gnome-shell hardcodes a vertical one-column workspace layout, and
|
|
|
066919 |
while not supporting arbitrary grids is very much by design, it
|
|
|
066919 |
currently doesn't have a choice: We simply don't expose the workspace
|
|
|
066919 |
layout we use.
|
|
|
066919 |
|
|
|
066919 |
Change that to allow gnome-shell to be a bit more flexible with the
|
|
|
066919 |
workspace layouts it supports.
|
|
|
066919 |
|
|
|
066919 |
https://gitlab.gnome.org/GNOME/mutter/merge_requests/618
|
|
|
066919 |
---
|
|
|
066919 |
src/core/screen.c | 27 +++++++++++++++++++++++++++
|
|
|
066919 |
1 file changed, 27 insertions(+)
|
|
|
066919 |
|
|
|
066919 |
diff --git a/src/core/screen.c b/src/core/screen.c
|
|
|
066919 |
index c14bba0cf..4fac02cdb 100644
|
|
|
066919 |
--- a/src/core/screen.c
|
|
|
066919 |
+++ b/src/core/screen.c
|
|
|
066919 |
@@ -81,6 +81,9 @@ static void on_monitors_changed (MetaMonitorManager *manager,
|
|
|
066919 |
enum
|
|
|
066919 |
{
|
|
|
066919 |
PROP_N_WORKSPACES = 1,
|
|
|
066919 |
+
|
|
|
066919 |
+ PROP_LAYOUT_COLUMNS,
|
|
|
066919 |
+ PROP_LAYOUT_ROWS,
|
|
|
066919 |
};
|
|
|
066919 |
|
|
|
066919 |
enum
|
|
|
066919 |
@@ -138,6 +141,12 @@ meta_screen_get_property (GObject *object,
|
|
|
066919 |
|
|
|
066919 |
switch (prop_id)
|
|
|
066919 |
{
|
|
|
066919 |
+ case PROP_LAYOUT_COLUMNS:
|
|
|
066919 |
+ g_value_set_int (value, screen->columns_of_workspaces);
|
|
|
066919 |
+ break;
|
|
|
066919 |
+ case PROP_LAYOUT_ROWS:
|
|
|
066919 |
+ g_value_set_int (value, screen->rows_of_workspaces);
|
|
|
066919 |
+ break;
|
|
|
066919 |
case PROP_N_WORKSPACES:
|
|
|
066919 |
g_value_set_int (value, meta_screen_get_n_workspaces (screen));
|
|
|
066919 |
break;
|
|
|
066919 |
@@ -261,6 +270,22 @@ meta_screen_class_init (MetaScreenClass *klass)
|
|
|
066919 |
NULL, NULL, NULL,
|
|
|
066919 |
G_TYPE_NONE, 0);
|
|
|
066919 |
|
|
|
066919 |
+ g_object_class_install_property (object_class,
|
|
|
066919 |
+ PROP_LAYOUT_COLUMNS,
|
|
|
066919 |
+ g_param_spec_int ("layout-columns",
|
|
|
066919 |
+ "Layout columns",
|
|
|
066919 |
+ "Number of columns in layout",
|
|
|
066919 |
+ -1, G_MAXINT, 1,
|
|
|
066919 |
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
|
|
066919 |
+
|
|
|
066919 |
+ g_object_class_install_property (object_class,
|
|
|
066919 |
+ PROP_LAYOUT_ROWS,
|
|
|
066919 |
+ g_param_spec_int ("layout-rows",
|
|
|
066919 |
+ "Layout rows",
|
|
|
066919 |
+ "Number of rows in layout",
|
|
|
066919 |
+ -1, G_MAXINT, 1,
|
|
|
066919 |
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
|
|
066919 |
+
|
|
|
066919 |
g_object_class_install_property (object_class,
|
|
|
066919 |
PROP_N_WORKSPACES,
|
|
|
066919 |
pspec);
|
|
|
066919 |
@@ -1753,6 +1778,8 @@ meta_screen_update_workspace_layout (MetaScreen *screen)
|
|
|
066919 |
screen->columns_of_workspaces,
|
|
|
066919 |
screen->vertical_workspaces,
|
|
|
066919 |
screen->starting_corner);
|
|
|
066919 |
+ g_object_notify (G_OBJECT (screen), "layout-columns");
|
|
|
066919 |
+ g_object_notify (G_OBJECT (screen), "layout-rows");
|
|
|
066919 |
}
|
|
|
066919 |
|
|
|
066919 |
/**
|
|
|
066919 |
--
|
|
|
066919 |
2.21.0
|
|
|
066919 |
|