Skip to content

Commit

Permalink
Revert "Dynamic workspace behaviour: add behaviour option that works …
Browse files Browse the repository at this point in the history
…better with #950"
  • Loading branch information
jtaala authored Oct 13, 2024
1 parent b8ccbab commit 2677f33
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 75 deletions.
41 changes: 0 additions & 41 deletions Settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -370,47 +370,6 @@
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">False</property>
<property name="focusable">False</property>
<child>
<object class="GtkGrid">
<property name="focusable">False</property>
<property name="tooltip_text" translatable="yes">Sets dynamic workspace behavior. PaperWM mode only removes empty spaces at the end of the workspace stack.</property>
<property name="margin_start">12</property>
<property name="margin_end">12</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
<property name="column_spacing">32</property>
<child>
<object class="GtkLabel">
<property name="focusable">False</property>
<property name="hexpand">1</property>
<property name="label" translatable="yes">Dynamic workspaces behavior</property>
<property name="use_markup">1</property>
<property name="xalign">0</property>
<layout>
<property name="column">0</property>
<property name="row">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkComboBoxText" id="dynamic-workspace-behavior">
<property name="focusable">False</property>
<property name="hexpand">0</property>
<property name="width-request">106</property>
<items>
<item id="gnome" translatable="yes">Gnome</item>
<item id="paperwm" translatable="yes">PaperWM</item>
</items>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
Expand Down
15 changes: 3 additions & 12 deletions patches.js
Original file line number Diff line number Diff line change
Expand Up @@ -678,20 +678,11 @@ export function _checkWorkspaces() {

// Delete empty workspaces except for the last one; do it from the end
// to avoid index changes
// PaperWM dynamic workspace behaviour
const removeCheck = i => {
switch (Settings.prefs.dynamic_workspace_behavior) {
case 0:
// eslint-disable-next-line eqeqeq
return emptyWorkspaces[i] && i != lastEmptyIndex;
default:
return emptyWorkspaces[i] && i > lastEmptyIndex;
}
};
for (i = lastIndex; i >= 0; i--) {
// eslint-disable-next-line eqeqeq
if (removeCheck(i)) {
workspaceManager.remove_workspace(this._workspaces[i], global.get_current_time());
if (emptyWorkspaces[i] && i != lastEmptyIndex) {
workspaceManager.remove_workspace(this._workspaces[i]
, global.get_current_time());
}
}

Expand Down
9 changes: 0 additions & 9 deletions prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,15 +330,6 @@ class SettingsWidget {
this._settings.set_boolean('show-workspace-indicator', !state);
});

enumOptionsChanged(
'dynamic-workspace-behavior',
{
'gnome': 0,
'paperwm': 1,
},
'paperwm',
1);

// Workspaces
booleanStateChanged('use-default-background');

Expand Down
Binary file modified schemas/gschemas.compiled
Binary file not shown.
5 changes: 0 additions & 5 deletions schemas/org.gnome.shell.extensions.paperwm.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -748,11 +748,6 @@
<summary>Sets the animation when exiting GNOME overview and ensuring selected window is in view. 0:NONE, 1:TRANSLATE, 2:FADE</summary>
</key>

<key type="i" name="dynamic-workspace-behavior">
<default>1</default>
<summary>Sets the behaviour for dynamic workspaces (paperwm mode only removes empty spaces at the end). 0:GNOME, 1:PAPERWM</summary>
</key>

<key type="as" name="winprops">
<default><![CDATA[[]]]></default>
<summary>Array of winprops as (JSON) string objects</summary>
Expand Down
1 change: 0 additions & 1 deletion settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export function enable(extension) {
'open-window-position-option-end',
'open-window-position-option-down',
'open-window-position-option-up',
'dynamic-workspace-behavior',
]
.forEach(k => setState(null, k));
prefs.__defineGetter__("minimum_margin", () => {
Expand Down
7 changes: 0 additions & 7 deletions tiling.js
Original file line number Diff line number Diff line change
Expand Up @@ -4084,13 +4084,6 @@ export function insertWindow(metaWindow, options = {}) {
const space = spaces.spaceOfWindow(metaWindow);

if (overwriteSpace !== undefined) {
// create required spaces
let created = 0;
while (workspaceManager.nWorkspaces <= overwriteSpace) {
workspaceManager.append_new_workspace(false, global.get_current_time());
created++;
}
console.debug("#winprops", `created ${created} new spaces for insertion`);
const newspace = spaces.spaceOfIndex(overwriteSpace);
if (!newspace) {
console.warn("#winprops", `overwriteSpace with index ${overwriteSpace} does not exist. \
Expand Down

0 comments on commit 2677f33

Please sign in to comment.