mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-13 15:54:12 +09:00
Add setting to force monitor isolation when using a single panel
gh-2355
This commit is contained in:
@@ -695,6 +695,10 @@
|
|||||||
<summary>Provide monitor isolation</summary>
|
<summary>Provide monitor isolation</summary>
|
||||||
<description>Dash shows only windows from the current monitor</description>
|
<description>Dash shows only windows from the current monitor</description>
|
||||||
</key>
|
</key>
|
||||||
|
<key type="b" name="isolate-monitors-with-single-panel">
|
||||||
|
<default>false</default>
|
||||||
|
<summary>Isolate monitors even with a single panel</summary>
|
||||||
|
</key>
|
||||||
<key type="b" name="show-favorites-all-monitors">
|
<key type="b" name="show-favorites-all-monitors">
|
||||||
<default>true</default>
|
<default>true</default>
|
||||||
<summary>Display the favorites on all monitors</summary>
|
<summary>Display the favorites on all monitors</summary>
|
||||||
|
|||||||
@@ -1870,7 +1870,9 @@ export function getInterestingWindows(app, monitor, isolateMonitors) {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
monitor &&
|
monitor &&
|
||||||
(isolateMonitors || SETTINGS.get_boolean('isolate-monitors'))
|
(isolateMonitors || SETTINGS.get_boolean('isolate-monitors')) &&
|
||||||
|
(SETTINGS.get_boolean('multi-monitors') ||
|
||||||
|
SETTINGS.get_boolean('isolate-monitors-with-single-panel'))
|
||||||
) {
|
) {
|
||||||
windows = windows.filter(function (w) {
|
windows = windows.filter(function (w) {
|
||||||
return w.get_monitor() == monitor.index
|
return w.get_monitor() == monitor.index
|
||||||
|
|||||||
@@ -495,7 +495,9 @@ export const PanelManager = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let isolateWorkspaces = SETTINGS.get_boolean('isolate-workspaces')
|
let isolateWorkspaces = SETTINGS.get_boolean('isolate-workspaces')
|
||||||
let isolateMonitors = SETTINGS.get_boolean('isolate-monitors')
|
let isolateMonitors =
|
||||||
|
!SETTINGS.get_boolean('multi-monitors') ||
|
||||||
|
SETTINGS.get_boolean('isolate-monitors')
|
||||||
|
|
||||||
this.focusedApp = app
|
this.focusedApp = app
|
||||||
|
|
||||||
|
|||||||
32
src/prefs.js
32
src/prefs.js
@@ -184,6 +184,7 @@ const Preferences = class {
|
|||||||
this._builder.add_from_file(
|
this._builder.add_from_file(
|
||||||
this._path + '/ui/BoxIsolateWorkspacesOptions.ui',
|
this._path + '/ui/BoxIsolateWorkspacesOptions.ui',
|
||||||
)
|
)
|
||||||
|
this._builder.add_from_file(this._path + '/ui/BoxIsolateMonitorsOptions.ui')
|
||||||
|
|
||||||
// pages
|
// pages
|
||||||
this._builder.add_from_file(this._path + '/ui/SettingsPosition.ui')
|
this._builder.add_from_file(this._path + '/ui/SettingsPosition.ui')
|
||||||
@@ -2608,6 +2609,37 @@ const Preferences = class {
|
|||||||
Gio.SettingsBindFlags.DEFAULT,
|
Gio.SettingsBindFlags.DEFAULT,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
this._settings.bind(
|
||||||
|
'isolate-monitors-with-single-panel',
|
||||||
|
this._builder.get_object('isolate_monitors_with_single_panel_switch'),
|
||||||
|
'active',
|
||||||
|
Gio.SettingsBindFlags.DEFAULT,
|
||||||
|
)
|
||||||
|
|
||||||
|
this._builder
|
||||||
|
.get_object('isolate_monitors_button')
|
||||||
|
.connect('clicked', () => {
|
||||||
|
let scrolledWindow = this._builder.get_object(
|
||||||
|
'box_isolate_monitors_options',
|
||||||
|
)
|
||||||
|
|
||||||
|
let dialog = this._createPreferencesDialog(
|
||||||
|
_('Isolate monitors options'),
|
||||||
|
scrolledWindow,
|
||||||
|
() => {
|
||||||
|
// restore default settings
|
||||||
|
this._settings.set_value(
|
||||||
|
'isolate-monitors-with-single-panel',
|
||||||
|
this._settings.get_default_value(
|
||||||
|
'isolate-monitors-with-single-panel',
|
||||||
|
),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
dialog.show()
|
||||||
|
})
|
||||||
|
|
||||||
this._settings.bind(
|
this._settings.bind(
|
||||||
'overview-click-to-exit',
|
'overview-click-to-exit',
|
||||||
this._builder.get_object('clicktoexit_switch'),
|
this._builder.get_object('clicktoexit_switch'),
|
||||||
|
|||||||
34
ui/BoxIsolateMonitorsOptions.ui
Normal file
34
ui/BoxIsolateMonitorsOptions.ui
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk" version="4.18"/>
|
||||||
|
<requires lib="libadwaita" version="1.2"/>
|
||||||
|
<object class="GtkScrolledWindow" id="box_isolate_monitors_options">
|
||||||
|
<property name="height-request">300</property>
|
||||||
|
<property name="vexpand">True</property>
|
||||||
|
<property name="width-request">600</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="margin-bottom">32</property>
|
||||||
|
<property name="margin-end">32</property>
|
||||||
|
<property name="margin-start">32</property>
|
||||||
|
<property name="margin-top">32</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">24</property>
|
||||||
|
<child>
|
||||||
|
<object class="AdwPreferencesGroup">
|
||||||
|
<child>
|
||||||
|
<object class="AdwActionRow">
|
||||||
|
<property name="title" translatable="yes">Isolate monitors even when using a single panel</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSwitch" id="isolate_monitors_with_single_panel_switch">
|
||||||
|
<property name="valign">center</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
||||||
@@ -145,6 +145,20 @@
|
|||||||
<child>
|
<child>
|
||||||
<object class="AdwActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="title" translatable="yes">Isolate monitors</property>
|
<property name="title" translatable="yes">Isolate monitors</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="isolate_monitors_button">
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage" id="image_isolate_monitors_options">
|
||||||
|
<property name="icon-name">emblem-system-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<style>
|
||||||
|
<class name="circular"/>
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSwitch" id="multimon_multi_isolate_monitor_switch">
|
<object class="GtkSwitch" id="multimon_multi_isolate_monitor_switch">
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
|
|||||||
Reference in New Issue
Block a user