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

Adds an intellihide mode for always-on-top (on non-fullscreen windows) #1668

Merged
merged 1 commit into from
Feb 23, 2022
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
7 changes: 7 additions & 0 deletions Settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -2688,6 +2688,13 @@ See the <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html&
<signal name="toggled" handler="maximized_windows_radio_button_toggled_cb" />
</object>
</child>
<child>
<object class="GtkCheckButton" id="always_on_top_radio_button">
<property name="label" translatable="yes">Always on top</property>
<property name="group">all_windows_radio_button</property>
<signal name="toggled" handler="always_on_top_radio_button_toggled_cb" />
</object>
</child>
<layout>
<property name="column">0</property>
<property name="row">2</property>
Expand Down
12 changes: 11 additions & 1 deletion intellihide.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const OverlapStatus = {
const IntellihideMode = {
ALL_WINDOWS: 0,
FOCUS_APPLICATION_WINDOWS: 1,
MAXIMIZED_WINDOWS : 2
MAXIMIZED_WINDOWS: 2,
ALWAYS_ON_TOP: 3,
};

// List of windows type taken into account. Order is important (keep the original
Expand Down Expand Up @@ -284,6 +285,15 @@ var Intellihide = class DashToDock_Intellihide {
if (!meta_win.maximized_vertically && !meta_win.maximized_horizontally)
return false;
break;

case IntellihideMode.ALWAYS_ON_TOP:
// Always on top, except for fullscreen windows
if (this._focusApp) {
const { focusWindow } = global.display;
if (!focusWindow?.fullscreen)
return false;
}
break;
}

if ( wksp_index == currentWorkspace && meta_win.showing_on_its_workspace() )
Expand Down
8 changes: 7 additions & 1 deletion prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,11 @@ var Settings = GObject.registerClass({
this._settings.set_enum('intellihide-mode', 2);
}

always_on_top_radio_button_toggled_cb(button) {
longmathemagician marked this conversation as resolved.
Show resolved Hide resolved
if (button.get_active())
this._settings.set_enum('intellihide-mode', 3);
}
longmathemagician marked this conversation as resolved.
Show resolved Hide resolved

_updateMonitorsSettings() {
// Monitor options
const preferredMonitor = this._settings.get_int('preferred-monitor');
Expand Down Expand Up @@ -477,7 +482,8 @@ var Settings = GObject.registerClass({
let intellihideModeRadioButtons = [
this._builder.get_object('all_windows_radio_button'),
this._builder.get_object('focus_application_windows_radio_button'),
this._builder.get_object('maximized_windows_radio_button')
this._builder.get_object('maximized_windows_radio_button'),
this._builder.get_object('always_on_top_radio_button'),
];

intellihideModeRadioButtons[this._settings.get_enum('intellihide-mode')].set_active(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<value value='0' nick='ALL_WINDOWS'/>
<value value='1' nick='FOCUS_APPLICATION_WINDOWS'/>
<value value='2' nick='MAXIMIZED_WINDOWS'/>
<value value='3' nick='ALWAYS_ON_TOP'/>
</enum>
<enum id='org.gnome.shell.extensions.dash-to-dock.transparency-mode'>
<value value='0' nick='DEFAULT'/>
Expand Down