diff --git a/lib/messageTray.js b/lib/messageTray.js index b35541a7..7200b119 100644 --- a/lib/messageTray.js +++ b/lib/messageTray.js @@ -29,8 +29,8 @@ function update(reset = false) { _firstRun = false; if (reset) { - opt = null; setNotificationPosition(1); + opt = null; return; } @@ -38,6 +38,23 @@ function update(reset = false) { } function setNotificationPosition(position) { + const constraint = Main.messageTray.get_constraints()[0]; + if(opt.SEC_NOTIFICATIONS_SHIFT == true && constraint) { + print("Moving notf to second : " + opt.MOVE_TO_MONITOR_INDEX); + print("Primary Index : " + global.display.get_primary_monitor()); + + constraint.index = opt.MOVE_TO_MONITOR_INDEX; + Main.messageTray._constraint = constraint; + Main.messageTray._constraint.index = opt.MOVE_TO_MONITOR_INDEX; + + print("Moved? : " + Main.messageTray._constraint.index); + } + else { + print("Moving notf to primary : " + global.display.get_primary_monitor()); + constraint.index = global.display.get_primary_monitor(); + Main.messageTray._constraint.index = constraint; + } + switch (position) { case 0: Main.messageTray._bannerBin.x_align = Clutter.ActorAlign.START; @@ -64,4 +81,4 @@ function setNotificationPosition(position) { Main.messageTray._bannerBin.y_align = Clutter.ActorAlign.END; break; } -} +} \ No newline at end of file diff --git a/lib/panel.js b/lib/panel.js index e5de09f5..cfd10266 100644 --- a/lib/panel.js +++ b/lib/panel.js @@ -93,8 +93,16 @@ function update(reset = false) { Main.layoutManager._updateHotCorners(); } -function _setPanelPosition(reset = false) { - const geometry = global.display.get_monitor_geometry(global.display.get_primary_monitor()); +function _setPanelMonitor() { + if(opt.SEC_PANEL_SHIFT == true) { + return opt.MOVE_TO_MONITOR_INDEX; + } + + return global.display.get_primary_monitor(); +} + +function _setPanelPosition(reset = false) { + const geometry = global.display.get_monitor_geometry(_setPanelMonitor()); const panelBox = Main.layoutManager.panelBox; const panelHeight = Main.panel.height; // panelBox height can be 0 after shell start diff --git a/lib/settings.js b/lib/settings.js index c3c2df42..776302b6 100644 --- a/lib/settings.js +++ b/lib/settings.js @@ -52,6 +52,8 @@ var Options = class Options { wsPreviewScale: ['int', 'ws-preview-scale'], secWsPreviewScale: ['int', 'secondary-ws-preview-scale'], secWsPreviewShift: ['boolean', 'secondary-ws-preview-shift'], + secPanelShift: ['boolean', 'secondary-panel-shift'], + secNotificationsShift: ['boolean', 'secondary-notifications-shift'], wsThumbnailsFull: ['boolean', 'ws-thumbnails-full'], secWsThumbnailsPosition: ['int', 'secondary-ws-thumbnails-position'], dashPosition: ['int', 'dash-position'], @@ -340,6 +342,8 @@ var Options = class Options { this.SEC_WS_TMB_POSITION_ADJUSTMENT = this.get('secWsTmbPositionAdjust', true) * -1 / 100; // range 1 to -1 this.SEC_WS_PREVIEW_SHIFT = this.get('secWsPreviewShift', true); + this.SEC_PANEL_SHIFT = this.get('secPanelShift', true); + this.SEC_NOTIFICATIONS_SHIFT = this.get('secNotificationsShift', true); this.SHOW_WST_LABELS = this.get('showWsTmbLabels', true); this.SHOW_WST_LABELS_ON_HOVER = this.get('showWsTmbLabelsOnHover', true); this.CLOSE_WS_BUTTON_MODE = this.get('closeWsButtonMode', true); @@ -485,8 +489,16 @@ var Options = class Options { this.OVERLAY_KEY_SECONDARY = this.get('overlayKeySecondary', true); this.ESC_BEHAVIOR = this.get('overviewEscBehavior', true); - + this.FIX_NEW_WINDOW_FOCUS = this.get('newWindowFocusFix', true); + + this.MOVE_TO_MONITOR_INDEX = global.display.get_primary_monitor(); + for (let monitors = 1; monitors <= global.display.get_n_monitors(); monitors++) { + if (monitors !== global.display.get_primary_monitor()) { + this.MOVE_TO_MONITOR_INDEX = monitors; + break; + } + } } _getAnimationDirection() { diff --git a/locale/cs/LC_MESSAGES/vertical-workspaces.mo b/locale/cs/LC_MESSAGES/vertical-workspaces.mo new file mode 100644 index 00000000..1f878dca Binary files /dev/null and b/locale/cs/LC_MESSAGES/vertical-workspaces.mo differ diff --git a/locale/nl/LC_MESSAGES/vertical-workspaces.mo b/locale/nl/LC_MESSAGES/vertical-workspaces.mo new file mode 100644 index 00000000..f0a6d1a2 Binary files /dev/null and b/locale/nl/LC_MESSAGES/vertical-workspaces.mo differ diff --git a/prefs.js b/prefs.js index b03bb99e..efa8916f 100644 --- a/prefs.js +++ b/prefs.js @@ -630,7 +630,23 @@ function _getLayoutOptionList(itemFactory) { ) ); + optionList.push( + itemFactory.getRowWidget( + _('Move Panel to Second Monitor'), + _('Moves the top panel to the second monitor'), + itemFactory.newSwitch(), + 'secPanelShift' + ) + ); + optionList.push( + itemFactory.getRowWidget( + _('Move notifications to Second Monitor'), + _('Position is set under Notifications and OSD > Notification Banner Position'), + itemFactory.newSwitch(), + 'secNotificationsShift' + ) + ); return optionList; } diff --git a/schemas/gschemas.compiled b/schemas/gschemas.compiled new file mode 100644 index 00000000..51e64a4a Binary files /dev/null and b/schemas/gschemas.compiled differ diff --git a/schemas/org.gnome.shell.extensions.vertical-workspaces.gschema.xml b/schemas/org.gnome.shell.extensions.vertical-workspaces.gschema.xml index 612ca101..be6a8a7c 100644 --- a/schemas/org.gnome.shell.extensions.vertical-workspaces.gschema.xml +++ b/schemas/org.gnome.shell.extensions.vertical-workspaces.gschema.xml @@ -22,6 +22,12 @@ false + + false + + + false + 2 diff --git a/vertical-workspaces@G-dH.github.com.zip b/vertical-workspaces@G-dH.github.com.zip new file mode 100644 index 00000000..5e365df4 Binary files /dev/null and b/vertical-workspaces@G-dH.github.com.zip differ