Skip to content
Open
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
21 changes: 19 additions & 2 deletions lib/messageTray.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,32 @@ function update(reset = false) {
_firstRun = false;

if (reset) {
opt = null;
setNotificationPosition(1);
opt = null;
return;
}

setNotificationPosition(opt.NOTIFICATION_POSITION);
}

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;
Expand All @@ -64,4 +81,4 @@ function setNotificationPosition(position) {
Main.messageTray._bannerBin.y_align = Clutter.ActorAlign.END;
break;
}
}
}
12 changes: 10 additions & 2 deletions lib/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 13 additions & 1 deletion lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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() {
Expand Down
Binary file added locale/cs/LC_MESSAGES/vertical-workspaces.mo
Binary file not shown.
Binary file added locale/nl/LC_MESSAGES/vertical-workspaces.mo
Binary file not shown.
16 changes: 16 additions & 0 deletions prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Binary file added schemas/gschemas.compiled
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
<key type="b" name="secondary-ws-preview-shift">
<default>false</default>
</key>
<key type="b" name="secondary-panel-shift">
<default>false</default>
</key>
<key type="b" name="secondary-notifications-shift">
<default>false</default>
</key>
<key type="i" name="dash-position">
<default>2</default>
</key>
Expand Down
Binary file added vertical-workspaces@G-dH.github.com.zip
Binary file not shown.