Merge branch 'master' into feature-multimon

This commit is contained in:
Charles Gagnon
2018-10-06 10:34:35 -04:00
7 changed files with 148 additions and 95 deletions

View File

@@ -195,29 +195,31 @@ var taskbarAppIcon = new Lang.Class({
this._setAppIconPadding();
this._showDots();
this._dtpSettings.connect('changed::dot-position', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettings.connect('changed::dot-size', Lang.bind(this, this._updateDotSize));
this._dtpSettings.connect('changed::dot-style-focused', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettings.connect('changed::dot-style-unfocused', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettings.connect('changed::dot-color-override', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettings.connect('changed::dot-color-1', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettings.connect('changed::dot-color-2', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettings.connect('changed::dot-color-3', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettings.connect('changed::dot-color-4', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettings.connect('changed::dot-color-unfocused-different', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettings.connect('changed::dot-color-unfocused-1', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettings.connect('changed::dot-color-unfocused-2', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettings.connect('changed::dot-color-unfocused-3', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettings.connect('changed::dot-color-unfocused-4', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettings.connect('changed::focus-highlight', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettings.connect('changed::focus-highlight-color', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettings.connect('changed::focus-highlight-opacity', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettings.connect('changed::group-apps-label-font-size', Lang.bind(this, this._updateWindowTitleStyle));
this._dtpSettings.connect('changed::group-apps-label-font-weight', Lang.bind(this, this._updateWindowTitleStyle));
this._dtpSettings.connect('changed::group-apps-label-font-color', Lang.bind(this, this._updateWindowTitleStyle));
this._dtpSettings.connect('changed::group-apps-label-max-width', Lang.bind(this, this._updateWindowTitleStyle));
this._dtpSettings.connect('changed::group-apps-use-fixed-width', Lang.bind(this, this._updateWindowTitleStyle));
this._dtpSettings.connect('changed::group-apps-underline-unfocused', Lang.bind(this, this._settingsChangeRefresh));
this._dtpSettingsSignalIds = [
this._dtpSettings.connect('changed::dot-position', Lang.bind(this, this._settingsChangeRefresh)),
this._dtpSettings.connect('changed::dot-size', Lang.bind(this, this._updateDotSize)),
this._dtpSettings.connect('changed::dot-style-focused', Lang.bind(this, this._settingsChangeRefresh)),
this._dtpSettings.connect('changed::dot-style-unfocused', Lang.bind(this, this._settingsChangeRefresh)),
this._dtpSettings.connect('changed::dot-color-override', Lang.bind(this, this._settingsChangeRefresh)),
this._dtpSettings.connect('changed::dot-color-1', Lang.bind(this, this._settingsChangeRefresh)),
this._dtpSettings.connect('changed::dot-color-2', Lang.bind(this, this._settingsChangeRefresh)),
this._dtpSettings.connect('changed::dot-color-3', Lang.bind(this, this._settingsChangeRefresh)),
this._dtpSettings.connect('changed::dot-color-4', Lang.bind(this, this._settingsChangeRefresh)),
this._dtpSettings.connect('changed::dot-color-unfocused-different', Lang.bind(this, this._settingsChangeRefresh)),
this._dtpSettings.connect('changed::dot-color-unfocused-1', Lang.bind(this, this._settingsChangeRefresh)),
this._dtpSettings.connect('changed::dot-color-unfocused-2', Lang.bind(this, this._settingsChangeRefresh)),
this._dtpSettings.connect('changed::dot-color-unfocused-3', Lang.bind(this, this._settingsChangeRefresh)),
this._dtpSettings.connect('changed::dot-color-unfocused-4', Lang.bind(this, this._settingsChangeRefresh)),
this._dtpSettings.connect('changed::focus-highlight', Lang.bind(this, this._settingsChangeRefresh)),
this._dtpSettings.connect('changed::focus-highlight-color', Lang.bind(this, this._settingsChangeRefresh)),
this._dtpSettings.connect('changed::focus-highlight-opacity', Lang.bind(this, this._settingsChangeRefresh)),
this._dtpSettings.connect('changed::group-apps-label-font-size', Lang.bind(this, this._updateWindowTitleStyle)),
this._dtpSettings.connect('changed::group-apps-label-font-weight', Lang.bind(this, this._updateWindowTitleStyle)),
this._dtpSettings.connect('changed::group-apps-label-font-color', Lang.bind(this, this._updateWindowTitleStyle)),
this._dtpSettings.connect('changed::group-apps-label-max-width', Lang.bind(this, this._updateWindowTitleStyle)),
this._dtpSettings.connect('changed::group-apps-use-fixed-width', Lang.bind(this, this._updateWindowTitleStyle)),
this._dtpSettings.connect('changed::group-apps-underline-unfocused', Lang.bind(this, this._settingsChangeRefresh))
]
this.forcedOverview = false;
@@ -345,6 +347,10 @@ var taskbarAppIcon = new Lang.Class({
if(this._scaleFactorChangedId)
St.ThemeContext.get_for_stage(global.stage).disconnect(this._scaleFactorChangedId);
for (let i = 0; i < this._dtpSettingsSignalIds.length; ++i) {
this._dtpSettings.disconnect(this._dtpSettingsSignalIds[i]);
}
},
onWindowsChanged: function() {

View File

@@ -51,7 +51,7 @@ var Intellihide = new Lang.Class({
this._signalsHandler = new Utils.GlobalSignalsHandler();
this._timeoutsHandler = new Utils.TimeoutsHandler();
this._dtpSettings.connect('changed::intellihide', Lang.bind(this, this._changeEnabledStatus));
this._intellihideChangedId = this._dtpSettings.connect('changed::intellihide', Lang.bind(this, this._changeEnabledStatus));
if (this._dtpSettings.get_boolean('intellihide')) {
this.enable();
@@ -88,6 +88,10 @@ var Intellihide = new Lang.Class({
},
disable: function(reset) {
if (!reset) {
this._dtpSettings.disconnect(this._intellihideChangedId);
}
this._setTrackPanel(reset, false);
this._disconnectFocusedWindow();

View File

@@ -90,13 +90,18 @@ var dtpOverview = new Lang.Class({
let label = 'optionalWorkspaceIsolation';
this._dtpSettings.connect('changed::isolate-workspaces', Lang.bind(this, function() {
this.taskbar.resetAppIcons();
if (this._dtpSettings.get_boolean('isolate-workspaces'))
Lang.bind(this, enable)();
else
Lang.bind(this, disable)();
}));
this._signalsHandler.addWithLabel(label, [
this._dtpSettings,
'changed::isolate-workspaces',
Lang.bind(this, function() {
this.taskbar.resetAppIcons();
if (this._dtpSettings.get_boolean('isolate-workspaces'))
Lang.bind(this, enable)();
else
Lang.bind(this, disable)();
})
]);
if (this._dtpSettings.get_boolean('isolate-workspaces'))
Lang.bind(this, enable)();

View File

@@ -58,11 +58,7 @@ var dtpPanelWrapper = new Lang.Class({
this.panelManager = panelManager;
this._dtpSettings = panelManager._dtpSettings;
this.panelStyle = new PanelStyle.dtpPanelStyle(panelManager._dtpSettings);
//rebuild panel when taskar-position change
this._dtpSettings.connect('changed::taskbar-position', Lang.bind(this, function() {
this.disable();
this.enable();
}));
this.monitor = monitor;
this.panel = panel;
this.panelBox = panelBox;
@@ -146,6 +142,11 @@ var dtpPanelWrapper = new Lang.Class({
// sync hover after a popupmenu is closed
this.taskbar.connect('menu-closed', Lang.bind(this, function(){this.container.sync_hover();}));
// Since Gnome 3.8 dragging an app without having opened the overview before cause the attemp to
//animate a null target since some variables are not initialized when the viewSelector is created
if(Main.overview.viewSelector._activePage == null)
Main.overview.viewSelector._activePage = Main.overview.viewSelector._workspacesPage;
if(this.taskbar._showAppsIcon)
this.taskbar._showAppsIcon._dtpPanel = this;
@@ -164,6 +165,12 @@ var dtpPanelWrapper = new Lang.Class({
Main.overview.dashIconSize = this.taskbar.iconSize;
})
],
[
// sync hover after a popupmenu is closed
this.taskbar,
'menu-closed',
Lang.bind(this, function(){this.container.sync_hover();})
],
// This duplicate the similar signal which is in overview.js.
// Being connected and thus executed later this effectively
// overwrite any attempt to use the size of the default dash
@@ -256,7 +263,11 @@ var dtpPanelWrapper = new Lang.Class({
if(this._ScaleFactorListener !== null) {
St.ThemeContext.get_for_stage(global.stage).disconnect(this._ScaleFactorListener);
}
for (let i = 0; i < this._dtpSettingsSignalIds.length; ++i) {
this._dtpSettings.disconnect(this._dtpSettingsSignalIds[i]);
}
this._removeTopLimit();
if (this.panel._updateSolidStyle) {
@@ -305,40 +316,48 @@ var dtpPanelWrapper = new Lang.Class({
},
_bindSettingsChanges: function() {
this._dtpSettings.connect('changed::panel-position', Lang.bind(this, function() {
this._setPanelPosition();
}));
this._dtpSettingsSignalIds = [
//rebuild panel when taskar-position change
this._dtpSettings.connect('changed::taskbar-position', Lang.bind(this, function() {
this.disable();
this.enable();
})),
this._dtpSettings.connect('changed::panel-size', Lang.bind(this, function() {
this._setPanelPosition();
this.taskbar.resetAppIcons();
}));
this._dtpSettings.connect('changed::panel-position', Lang.bind(this, function() {
this._setPanelPosition();
})),
this._dtpSettings.connect('changed::appicon-margin', Lang.bind(this, function() {
this.taskbar.resetAppIcons();
}));
this._dtpSettings.connect('changed::panel-size', Lang.bind(this, function() {
this._setPanelPosition();
this.taskbar.resetAppIcons();
})),
this._dtpSettings.connect('changed::appicon-padding', Lang.bind(this, function() {
this.taskbar.resetAppIcons();
}));
this._dtpSettings.connect('changed::appicon-margin', Lang.bind(this, function() {
this.taskbar.resetAppIcons();
})),
this._dtpSettings.connect('changed::show-activities-button', Lang.bind(this, function() {
this._setActivitiesButtonVisible(this._dtpSettings.get_boolean('show-activities-button'));
}));
this._dtpSettings.connect('changed::show-appmenu', Lang.bind(this, function() {
this._setAppmenuVisible(this._dtpSettings.get_boolean('show-appmenu'));
}));
this._dtpSettings.connect('changed::appicon-padding', Lang.bind(this, function() {
this.taskbar.resetAppIcons();
})),
this._dtpSettings.connect('changed::location-clock', Lang.bind(this, function() {
this._setClockLocation(this._dtpSettings.get_string('location-clock'));
}));
this._dtpSettings.connect('changed::show-activities-button', Lang.bind(this, function() {
this._setActivitiesButtonVisible(this._dtpSettings.get_boolean('show-activities-button'));
})),
this._dtpSettings.connect('changed::show-appmenu', Lang.bind(this, function() {
this._setAppmenuVisible(this._dtpSettings.get_boolean('show-appmenu'));
})),
this._dtpSettings.connect('changed::show-showdesktop-button', Lang.bind(this, function() {
this._displayShowDesktopButton(this._dtpSettings.get_boolean('show-showdesktop-button'));
}));
this._dtpSettings.connect('changed::location-clock', Lang.bind(this, function() {
this._setClockLocation(this._dtpSettings.get_string('location-clock'));
})),
this._dtpSettings.connect('changed::showdesktop-button-width', () => this._setShowDesktopButtonWidth());
this._dtpSettings.connect('changed::show-showdesktop-button', Lang.bind(this, function() {
this._displayShowDesktopButton(this._dtpSettings.get_boolean('show-showdesktop-button'));
})),
this._dtpSettings.connect('changed::showdesktop-button-width', () => this._setShowDesktopButtonWidth())
];
},
_allocate: function(actor, box, flags) {

View File

@@ -47,6 +47,10 @@ var dtpPanelStyle = new Lang.Class({
},
disable: function () {
for (let i = 0; i < this._dtpSettingsSignalIds.length; ++i) {
this._dtpSettings.disconnect(this._dtpSettingsSignalIds[i]);
}
this._removeStyles();
},
@@ -58,12 +62,14 @@ var dtpPanelStyle = new Lang.Class({
"leftbox-padding",
"status-icon-padding",
];
this._dtpSettingsSignalIds = [];
for(let i in configKeys) {
this._dtpSettings.connect('changed::' + configKeys[i], Lang.bind(this, function () {
this._dtpSettingsSignalIds.push(this._dtpSettings.connect('changed::' + configKeys[i], Lang.bind(this, function () {
this._removeStyles();
this._applyStyles();
}));
})));
}
},

View File

@@ -303,14 +303,44 @@ var taskbar = new Lang.Class({
this._dtpSettings,
'changed::show-window-previews',
Lang.bind(this, this._toggleWindowPreview)
],
[
this._dtpSettings,
'changed::show-show-apps-button',
Lang.bind(this, function() {
if (this._dtpSettings.get_boolean('show-show-apps-button'))
this.showShowAppsButton();
else
this.hideShowAppsButton();
})
],
[
this._dtpSettings,
[
'changed::dot-size',
'changed::show-favorites'
],
Lang.bind(this, this._redisplay)
],
[
this._dtpSettings,
'changed::group-apps',
Lang.bind(this, function() {
this.isGroupApps = this._dtpSettings.get_boolean('group-apps');
this._connectWorkspaceSignals();
this.resetAppIcons();
})
],
[
this._dtpSettings,
'changed::group-apps-use-launchers',
() => this.resetAppIcons()
]
);
this.isGroupApps = this._dtpSettings.get_boolean('group-apps');
this._connectWorkspaceSignals();
this._bindSettingsChanges();
},
destroy: function() {
@@ -321,29 +351,6 @@ var taskbar = new Lang.Class({
this._disconnectWorkspaceSignals();
},
_bindSettingsChanges: function () {
this._dtpSettings.connect('changed::show-show-apps-button', Lang.bind(this, function() {
if (this._dtpSettings.get_boolean('show-show-apps-button'))
this.showShowAppsButton();
else
this.hideShowAppsButton();
}));
this._dtpSettings.connect('changed::dot-size', Lang.bind(this, this._redisplay));
this._dtpSettings.connect('changed::show-favorites', Lang.bind(this, this._redisplay));
this._dtpSettings.connect('changed::group-apps', Lang.bind(this, function() {
this.isGroupApps = this._dtpSettings.get_boolean('group-apps');
this._connectWorkspaceSignals();
this.resetAppIcons();
}));
this._dtpSettings.connect('changed::group-apps-use-launchers', Lang.bind(this, function() {
this.resetAppIcons();
}));
},
_onScrollEvent: function(actor, event) {
// Event coordinates are relative to the stage but can be transformed

View File

@@ -902,10 +902,12 @@ var thumbnailPreviewList = new Lang.Class({
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
this._dtpSettings.connect('changed::window-preview-width', () => this._resetPreviews());
this._dtpSettings.connect('changed::window-preview-height', () => this._resetPreviews());
this._dtpSettings.connect('changed::window-preview-show-title', () => this._resetPreviews());
this._dtpSettings.connect('changed::window-preview-padding', () => this._resetPreviews());
this._dtpSettingsSignalIds = [
this._dtpSettings.connect('changed::window-preview-width', () => this._resetPreviews()),
this._dtpSettings.connect('changed::window-preview-height', () => this._resetPreviews()),
this._dtpSettings.connect('changed::window-preview-show-title', () => this._resetPreviews()),
this._dtpSettings.connect('changed::window-preview-padding', () => this._resetPreviews())
];
this._stateChangedId = this._source.window ? 0 :
this.app.connect('windows-changed', Lang.bind(this, this._queueRedisplay));
@@ -996,6 +998,10 @@ var thumbnailPreviewList = new Lang.Class({
},
_onDestroy: function() {
for (let i = 0; i < this._dtpSettingsSignalIds.length; ++i) {
this._dtpSettings.disconnect(this._dtpSettingsSignalIds[i]);
}
if (this._stateChangedId) {
this.app.disconnect(this._stateChangedId);
this._stateChangedId = 0;