Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to maximize windows within the tiling flow #871

Merged
merged 3 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion Settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -2006,7 +2006,43 @@
</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="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="tooltip_text" translatable="yes">Enables handling maximize events (like double clicking the header bar) by stretching window width but not going out of the tiling margins</property>
<property name="hexpand">1</property>
<property name="label" translatable="yes">Maximize within tiling</property>
<property name="xalign">0</property>
<layout>
<property name="column">0</property>
<property name="row">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkSwitch" id="maximize-within-tiling">
<layout>
<property name="column">1</property>
<property name="row">0</property>
</layout>
</object>
</child>
</object>
</child>
</object>
</child>

<child>
<object class="GtkListBoxRow">
Expand Down
1 change: 1 addition & 0 deletions prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ class SettingsWidget {
// disabled since opposite of gnome-pill
// booleanSetState('show-workspace-indicator');
percentValueChanged('maximize-width-percent', 'maximize-width-percent');
booleanStateChanged('maximize-within-tiling');

// About
// build version information
Expand Down
Binary file modified schemas/gschemas.compiled
Binary file not shown.
5 changes: 5 additions & 0 deletions schemas/org.gnome.shell.extensions.paperwm.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,11 @@
<summary>Percent of workspace width the horizontal window maximise function (Super+F) will use.</summary>
</key>

<key type="b" name="maximize-within-tiling">
<default>true</default>
<summary>Handle maximize events from windows (e.g. header bar double click) by maximizing their width without going beyond the margins.</summary>
</key>

<key type="as" name="workspace-colors">
<default><![CDATA[['#314E6C', '#565248', '#445632', '#663822',
'#494066', '#826647', '#4B6983', '#807D74', '#5D7555', '#884631',
Expand Down
1 change: 1 addition & 0 deletions settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function enable(extension) {
'cycle-width-steps',
'cycle-height-steps',
'maximize-width-percent',
'maximize-within-tiling',
'minimap-scale',
'edge-preview-enable',
'edge-preview-scale',
Expand Down
9 changes: 9 additions & 0 deletions tiling.js
Original file line number Diff line number Diff line change
Expand Up @@ -3339,6 +3339,15 @@ export function registerWindow(metaWindow) {
signals.connect(metaWindow, 'notify::minimized', metaWindow => {
minimizeHandler(metaWindow);
});
signals.connect(metaWindow, 'notify::maximized-horizontally', metaWindow => {
if (
Settings.prefs.maximize_within_tiling &&
metaWindow.get_maximized() === Meta.MaximizeFlags.BOTH) {
metaWindow.unmaximize(Meta.MaximizeFlags.BOTH);
toggleMaximizeHorizontally(metaWindow);
}
spaces.spaceOfWindow(metaWindow)?.layout();
});
signals.connect(actor, 'show', actor => {
showHandler(actor);
});
Expand Down