|
|
f92192 |
From 5efefc0e46963749a53a8d81ff6641fd6f9e6e1f 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 |
---
|
|
|
f92192 |
src/core/screen.c | 30 ++++++++++++++++++++++++++++++
|
|
|
f92192 |
1 file changed, 30 insertions(+)
|
|
|
066919 |
|
|
|
066919 |
diff --git a/src/core/screen.c b/src/core/screen.c
|
|
|
f92192 |
index c14bba0cf..090baecda 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 |
/**
|
|
|
f92192 |
@@ -1785,6 +1812,9 @@ meta_screen_override_workspace_layout (MetaScreen *screen,
|
|
|
f92192 |
screen->rows_of_workspaces = n_rows;
|
|
|
f92192 |
screen->columns_of_workspaces = n_columns;
|
|
|
f92192 |
|
|
|
f92192 |
+ g_object_notify (G_OBJECT (screen), "layout-columns");
|
|
|
f92192 |
+ g_object_notify (G_OBJECT (screen), "layout-rows");
|
|
|
f92192 |
+
|
|
|
f92192 |
/* In theory we should remove _NET_DESKTOP_LAYOUT from _NET_SUPPORTED at this
|
|
|
f92192 |
* point, but it's unlikely that anybody checks that, and it's unlikely that
|
|
|
f92192 |
* anybody who checks that handles changes, so we'd probably just create
|
|
|
066919 |
--
|
|
|
f92192 |
2.26.2
|
|
|
066919 |
|