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