Update to Gnome 40 (#1303)

* 1

* renamed ui.viewSelector to ui.searchController

* add arrowIcon null check

* add object null check

* add _showAppsButton null check

* fixed _workspacesDisplay

* removed shadow-type properties

* removed packing from ui

* renamed margin_left/right to margin_start/end

* renamed GtkRadioButton to GtkToggleButton, removed draw_indicator and image_position

* removed xalign from buttons, stock -> icon_name, GtkFileChooserButton -> BtkButton (todo connect a GtkFileChooserNative), removed format-value (todo connect GtkScaleFormatValueFunc callback)

* removed events, relief

* comment arrowIcon.set_icon_name and _hbox.get_last_child out

* called gtk4-builder-tool simplify --3to4 on Settings.ui

* fix _workspaceDisplay

* revert Settings.ui back to old gtk3 version

* removed _builder.connect_signals_full and added a BuilderScope instead, use class specific add functions, removed show_all for widgets, updated margins* for GtkGrid

* add try catch aroung object.connect

* fixed _searchEntry path

* disabled _newUpdateWorkspacesViews temporarily, because it is very buggy right now

* fixed _searchEntry path (this time for real?)

* dialog.show_all() -> dialog.show(), widget.get_toplevel() -> widget.get_root(), fixed adjustScrollableHeight (no longer crashes, still does not work correctly)

* updated GtkGrid.attach calls

* added Gtk.FileChooserNative for show_applications_icon_file_filebutton

* added packing again to ui (commented) and also added layout row/column/width/height in exchange for top_attach/left_attach/colspan/rowspan

* renamed colspan/rowspan to column-span/row-span

* removed all packaing left_attach/top_attach

* updated adjustScrollableHeight so the dialog will have a reasonable size again

* limit shell-version to 40 since it is not backwards compatible right now

* called _updateBackgrounds in layoutManager ,fixed overview <-> _overview typo?

* pass Settings instead of Settings._settings to BuilderScope

* workaround for showAppsIcon (_showAppsButton seems to be no longer be available)

* replaced newlines in the ui file with the newline unicode symbol, so code block collapsing works peroperly

* moved the scrolled window directly into each notebook tab, so the tab headers are always visible

* fixed taskbarListBox children loops

* commented non working elements out (panel on left/right, import/export settings, update)

* renamed Settings to Preferences to avoid confusion with dconf settings object

* updated this.widget to this.notebook

* fixed dialogs size and expand

* fixed window preview options having too many columns

* removed all packing with expand/fill/position (already uncommented)

* removed menu arrows since they are no longer recommended for gnome40

* removed adjustScrollableHeight, default sizes are acceptable

* updated ui required version to gtk 4.0

* updated path to dash.showAppsButton

* fixes for showAppsButton

* fixed clickToExit

* fixed import/export settings

* added disable show overview on startup option

* removed old show apps animation

* fixed panel on left/right side

* fixed scroll on volume icon

no longer will scrolling on the volume icon switch workspaces as well

* commented some setFocusedMonitor support out, caused issues on Xorg

* removed oldDash

* updated hide overview on startup, no longer closes overview after suspend etc

* removed _newOverviewRelayout

* removed _newUpdateWorkspacesViews

* commented setFocusedMonitor out completly, because show overview on non primary monitor does not work properly for now

* fixed typo

* fixed merging error

* check if func is valid in hookVfunc

* updated ui to gtk4, fixed merging error

* fixed layout for apply changes to all monitors

* fix behaviour tab and app icon margin/padding grid

* fix animate launching new windows grid row

* fixed about tab

Co-authored-by: Cole Gerdemann <corvettecole@gmail.com>
This commit is contained in:
Philipp
2021-05-08 15:07:25 +02:00
committed by GitHub
parent 925f5b27b3
commit a4224f4acc
10 changed files with 3807 additions and 4741 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -38,12 +38,13 @@ const Utils = Me.imports.utils;
const UBUNTU_DOCK_UUID = 'ubuntu-dock@ubuntu.com';
let panelManager;
let oldDash;
let extensionChangedHandler;
let disabledUbuntuDock;
let extensionSystem = (Main.extensionManager || imports.ui.extensionSystem);
function init() {
this._realHasOverview = Main.sessionMode.hasOverview;
Convenience.initTranslations(Utils.TRANSLATION_DOMAIN);
//create an object that persists until gnome-shell is restarted, even if the extension is disabled
@@ -91,6 +92,13 @@ function _enable() {
Me.settings = Convenience.getSettings('org.gnome.shell.extensions.dash-to-panel');
Me.desktopSettings = Convenience.getSettings('org.gnome.desktop.interface');
if (Me.settings.get_boolean('hide-overview-on-startup') && Main.layoutManager._startingUp) {
Main.sessionMode.hasOverview = false;
Main.layoutManager.connect('startup-complete', () => {
Main.sessionMode.hasOverview = this._realHasOverview
});
}
panelManager = new PanelManager.dtpPanelManager();
panelManager.enable();
@@ -107,21 +115,14 @@ function _enable() {
}),
Shell.ActionMode.NORMAL | Shell.ActionMode.POPUP
);
// Pretend I'm the dash: meant to make appgrd swarm animation come from the
// right position of the appShowButton.
oldDash = Main.overview._dash;
Main.overview._dash = panelManager.primaryPanel.taskbar;
}
function disable(reset) {
panelManager.disable();
Main.overview._dash = oldDash;
Me.settings.run_dispose();
Me.desktopSettings.run_dispose();
delete Me.settings;
oldDash = null;
panelManager = null;
Utils.removeKeybinding('open-application-menu');
@@ -141,4 +142,6 @@ function disable(reset) {
(extensionSystem._callExtensionEnable || extensionSystem.enableExtension).call(extensionSystem, UBUNTU_DOCK_UUID);
}
}
Main.sessionMode.hasOverview = this._realHasOverview;
}

View File

@@ -3,7 +3,7 @@
"uuid": "dash-to-panel@jderose9.github.com",
"name": "Dash to Panel",
"description": "An icon taskbar for the Gnome Shell. This extension moves the dash into the gnome main panel so that the application launchers and system tray are combined into a single panel, similar to that found in KDE Plasma and Windows 7+. A separate dock is no longer needed for easy access to running and favorited applications.\n\nFor a more traditional experience, you may also want to use Tweak Tool to enable Windows > Titlebar Buttons > Minimize & Maximize.\n\nFor the best support, please report any issues on Github. Dash-to-panel is developed and maintained by @jderose9 and @charlesg99.",
"shell-version": [ "3.18", "3.20", "3.22", "3.24", "3.26", "3.28", "3.30", "3.32", "3.34", "3.36", "3.38" ],
"shell-version": [ "40" ],
"url": "https://github.com/jderose9/dash-to-panel",
"gettext-domain": "dash-to-panel",
"version": 9999

View File

@@ -33,7 +33,6 @@ const Gdk = imports.gi.Gdk;
const Gio = imports.gi.Gio;
const Mainloop = imports.mainloop;
const IconGrid = imports.ui.iconGrid;
const ViewSelector = imports.ui.viewSelector;
const Meta = imports.gi.Meta;
@@ -421,7 +420,7 @@ var dtpOverview = Utils.defineClass({
if (this._clickToExitEnabled)
return;
let views = Utils.getAppDisplayViews();
let view = imports.ui.appDisplay;
this._oldOverviewReactive = Main.overview._overview.reactive
Main.overview._overview.reactive = true;
@@ -435,76 +434,10 @@ var dtpOverview = Utils.defineClass({
let [x, y] = global.get_pointer();
let pickedActor = global.stage.get_actor_at_pos(Clutter.PickMode.ALL, x, y);
let activePage = Main.overview.viewSelector.getActivePage();
if (activePage == ViewSelector.ViewPage.APPS) {
if(pickedActor != Main.overview._overview
&& (views.length > 1 && pickedActor != Main.overview.viewSelector.appDisplay._controls.get_parent())
&& pickedActor != (views[0].view.actor || views[0].view)
&& (views.length > 1 && pickedActor != views[1].view._scrollView)
&& (views.length > 1 && pickedActor != views[1].view._grid)) {
return Clutter.EVENT_PROPAGATE;
}
if(Me.settings.get_boolean('animate-show-apps')) {
let view = Utils.find(views, v => v.view.actor.visible).view;
view.animate(IconGrid.AnimationDirection.OUT, Lang.bind(this, function() {
Main.overview.viewSelector._appsPage.hide();
Main.overview.hide();
}));
} else {
Main.overview.hide();
}
} else if (activePage == ViewSelector.ViewPage.WINDOWS) {
let overviewControls = Main.overview._overview._controls || Main.overview._controls;
if(pickedActor == overviewControls._thumbnailsBox
|| pickedActor == overviewControls.dash._container) {
return Clutter.EVENT_PROPAGATE;
}
if (pickedActor instanceof Meta.BackgroundActor) {
Utils.find(overviewControls._thumbnailsBox._thumbnails, t =>
pickedActor == t._bgManager.backgroundActor
).activate();
return Clutter.EVENT_STOP;
}
Main.overview.toggle();
} else {
Main.overview.toggle();
}
});
Main.overview._overview.add_action(this._clickAction);
[Main.overview.viewSelector._workspacesDisplay].concat(views.map(v => v.view)).forEach(v => {
if (v._swipeTracker) {
this._signalsHandler.addWithLabel('clickToExit', [
v._swipeTracker,
'begin',
Lang.bind(this, this._onSwipeBegin)
],[
v._swipeTracker,
'end',
Lang.bind(this, this._onSwipeEnd)
]);
} else if (v._panAction) {
this._signalsHandler.addWithLabel('clickToExit', [
v._panAction,
'gesture-begin',
Lang.bind(this, this._onSwipeBegin)
],[
v._panAction,
'gesture-cancel',
Lang.bind(this, this._onSwipeEnd)
],[
v._panAction,
'gesture-end',
Lang.bind(this, this._onSwipeEnd)
]);
}
});
this._clickToExitEnabled = true;
},

View File

@@ -53,7 +53,6 @@ const DND = imports.ui.dnd;
const Shell = imports.gi.Shell;
const PopupMenu = imports.ui.popupMenu;
const IconGrid = imports.ui.iconGrid;
const ViewSelector = imports.ui.viewSelector;
const DateMenu = imports.ui.dateMenu;
const Volume = imports.ui.status.volume;
const Progress = Me.imports.progress;
@@ -74,20 +73,6 @@ const T5 = 'trackerFocusAppTimeout';
const T6 = 'scrollPanelDelayTimeout';
const T7 = 'waitPanelBoxAllocation';
function setMenuArrow(arrowIcon, side) {
let parent = arrowIcon.get_parent();
let iconNames = {
'0': 'pan-down-symbolic', //TOP
'1': 'pan-start-symbolic', //RIGHT
'2': 'pan-up-symbolic', //BOTTOM
'3': 'pan-end-symbolic' //LEFT
};
parent.remove_child(arrowIcon);
arrowIcon.set_icon_name(iconNames[side]);
parent.add_child(arrowIcon);
}
var dtpPanel = Utils.defineClass({
Name: 'DashToPanel-Panel',
Extends: St.Widget,
@@ -147,10 +132,6 @@ var dtpPanel = Utils.defineClass({
this._setPanelMenu('dateMenu', DateMenu.DateMenuButton, this.panel.actor);
this._setPanelMenu('activities', Panel.ActivitiesButton, this.panel.actor);
if (this.statusArea.aggregateMenu) {
setMenuArrow(this.statusArea.aggregateMenu._indicators.get_last_child(), position);
}
this.panel.add_child(this._leftBox);
this.panel.add_child(this._centerBox);
this.panel.add_child(this._rightBox);
@@ -159,8 +140,6 @@ var dtpPanel = Utils.defineClass({
this.statusArea = Main.panel.statusArea;
this.menuManager = Main.panel.menuManager;
setMenuArrow(this.statusArea.aggregateMenu._indicators.get_last_child(), position);
panelBoxes.forEach(p => this[p] = Main.panel[p]);
['activities', 'aggregateMenu', 'dateMenu'].forEach(b => {
@@ -231,14 +210,7 @@ var dtpPanel = Utils.defineClass({
Main.overview._overview.insert_child_at_index(this._myPanelGhost, 0);
} else {
let overviewControls = Main.overview._overview._controls || Main.overview._controls;
if (this.geom.position == St.Side.BOTTOM) {
Main.overview._overview.add_actor(this._myPanelGhost);
} else if (this.geom.position == St.Side.LEFT) {
overviewControls._group.insert_child_at_index(this._myPanelGhost, 0);
} else {
overviewControls._group.add_actor(this._myPanelGhost);
}
}
if (this.panel._leftCorner) {
@@ -300,15 +272,6 @@ var dtpPanel = Utils.defineClass({
}
};
if (this.statusArea.appMenu) {
setMenuArrow(this.statusArea.appMenu._arrow, position);
this._leftBox.remove_child(this.statusArea.appMenu.container);
}
if (this.statusArea.keyboard) {
setMenuArrow(this.statusArea.keyboard._hbox.get_last_child(), position);
}
this.dynamicTransparency = new Transparency.DynamicTransparency(this);
this.taskbar = new Taskbar.taskbar(this);
@@ -322,11 +285,6 @@ var dtpPanel = Utils.defineClass({
this.panel.actor.add_style_class_name('dashtopanelMainPanel ' + this.getOrientation());
// 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;
this._setPanelGhostSize();
this._timeoutsHandler.add([T2, Me.settings.get_int('intellihide-enable-start-delay'), () => this.intellihide = new Intellihide.Intellihide(this)]);
@@ -366,6 +324,7 @@ var dtpPanel = Utils.defineClass({
this.statusArea.activities.actor,
'captured-event',
(actor, e) => {
// todo this is not being called right now, so the overview is not shown on the correct monitor
if (e.type() == Clutter.EventType.BUTTON_PRESS || e.type() == Clutter.EventType.TOUCH_BEGIN) {
//temporarily use as primary the monitor on which the activities btn was clicked
this.panelManager.setFocusedMonitor(this.monitor, true);
@@ -481,15 +440,6 @@ var dtpPanel = Utils.defineClass({
originalParent ? originalParent.insert_child_at_index(container, b[1]) : null;
delete container._dtpOriginalParent;
});
if (this.statusArea.appMenu) {
setMenuArrow(this.statusArea.appMenu._arrow, St.Side.TOP);
this._leftBox.add_child(this.statusArea.appMenu.container);
}
if (this.statusArea.keyboard) {
setMenuArrow(this.statusArea.keyboard._hbox.get_last_child(), St.Side.TOP);
}
}
if (!this.panel._leftCorner.actor.mapped) {
@@ -500,7 +450,6 @@ var dtpPanel = Utils.defineClass({
this._setShowDesktopButton(false);
delete Utils.getIndicators(this.statusArea.aggregateMenu._volume)._dtpIgnoreScroll;
setMenuArrow(this.statusArea.aggregateMenu._indicators.get_last_child(), St.Side.TOP);
if (DateMenu.IndicatorPad) {
Utils.hookVfunc(DateMenu.IndicatorPad.prototype, 'get_preferred_width', DateMenu.IndicatorPad.prototype.vfunc_get_preferred_width);
@@ -766,8 +715,7 @@ var dtpPanel = Utils.defineClass({
let paddingSide = this.getPosition() == St.Side.LEFT ? 'left' : 'right';
let scaleFactor = Utils.getScaleFactor();
let style = offset ? 'padding-' + paddingSide + ':' + (offset / scaleFactor) + 'px;' : null;
let searchEntry = Main.overview._searchEntry || Main.overview._overview._searchEntry;
let searchEntry = Main.overview._overview._controls._searchEntry;
searchEntry.get_parent().set_style(style);
}
},
@@ -1461,7 +1409,7 @@ var dtpPanel = Utils.defineClass({
_checkIfIgnoredScrollSource: function(source) {
let ignoredConstr = ['WorkspaceIndicator'];
return source._dtpIgnoreScroll || ignoredConstr.indexOf(source.constructor.name) >= 0;
return source.get_parent()._dtpIgnoreScroll || ignoredConstr.indexOf(source.constructor.name) >= 0;
},
_initProgressManager: function() {
@@ -1532,7 +1480,6 @@ var dtpSecondaryAggregateMenu = Utils.defineClass({
this._indicators.add_child(Utils.getIndicators(this._volume));
this._indicators.add_child(Utils.getIndicators(this._power));
this._indicators.add_child(PopupMenu.arrowIcon(St.Side.BOTTOM));
this.menu.addMenuItem(this._volume.menu);
this._volume._volumeMenu._readOutput();

View File

@@ -76,6 +76,8 @@ var dtpPanelManager = Utils.defineClass({
this.dtpPrimaryMonitor = Main.layoutManager.monitors[dtpPrimaryIndex] || Main.layoutManager.primaryMonitor;
this.proximityManager = new Proximity.ProximityManager();
this._oldGetShowAppsButton = imports.ui.main.overview.dash.showAppsButton;
Utils.wrapActor(Main.panel);
Utils.wrapActor(Main.overview.dash || 0);
@@ -129,11 +131,6 @@ var dtpPanelManager = Utils.defineClass({
if (reset) return;
this._oldViewSelectorAnimateIn = Main.overview.viewSelector._animateIn;
Main.overview.viewSelector._animateIn = Lang.bind(this.primaryPanel, newViewSelectorAnimateIn);
this._oldViewSelectorAnimateOut = Main.overview.viewSelector._animateOut;
Main.overview.viewSelector._animateOut = Lang.bind(this.primaryPanel, newViewSelectorAnimateOut);
if (Config.PACKAGE_VERSION > '3.35.1') {
this._oldDoSpringAnimation = AppDisplay.BaseAppView.prototype._doSpringAnimation;
AppDisplay.BaseAppView.prototype._doSpringAnimation = newDoSpringAnimation;
@@ -157,20 +154,13 @@ var dtpPanelManager = Utils.defineClass({
this._enableHotCornersId = Main.layoutManager._interfaceSettings.connect('changed::enable-hot-corners', () => Main.layoutManager._updateHotCorners());
}
this._oldOverviewRelayout = Main.overview._relayout;
Main.overview._relayout = Lang.bind(Main.overview, this._newOverviewRelayout);
this._oldUpdateWorkspacesViews = Main.overview.viewSelector._workspacesDisplay._updateWorkspacesViews;
Main.overview.viewSelector._workspacesDisplay._updateWorkspacesViews = Lang.bind(Main.overview.viewSelector._workspacesDisplay, this._newUpdateWorkspacesViews);
this._oldGetShowAppsButton = Main.overview.getShowAppsButton;
Main.overview.getShowAppsButton = this._newGetShowAppsButton.bind(this);
this._needsDashItemContainerAllocate = !Dash.DashItemContainer.prototype.hasOwnProperty('vfunc_allocate');
// 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._needsDashItemContainerAllocate) {
Utils.hookVfunc(Dash.DashItemContainer.prototype, 'allocate', this._newDashItemContainerAllocate);
}
LookingGlass.LookingGlass.prototype._oldResize = LookingGlass.LookingGlass.prototype._resize;
LookingGlass.LookingGlass.prototype._resize = _newLookingGlassResize;
@@ -340,14 +330,6 @@ var dtpPanelManager = Utils.defineClass({
Main.layoutManager._updatePanelBarrier = this._oldUpdatePanelBarrier;
Main.layoutManager._updatePanelBarrier();
Main.overview.viewSelector._animateIn = this._oldViewSelectorAnimateIn;
Main.overview.viewSelector._animateOut = this._oldViewSelectorAnimateOut;
Main.overview._relayout = this._oldOverviewRelayout;
Main.overview._relayout();
Main.overview.viewSelector._workspacesDisplay._updateWorkspacesViews = this._oldUpdateWorkspacesViews;
Utils.getPanelGhost().set_size(-1, -1);
if (this._oldDoSpringAnimation) {
@@ -366,18 +348,16 @@ var dtpPanelManager = Utils.defineClass({
},
setFocusedMonitor: function(monitor, ignoreRelayout) {
this._needsIconAllocate = 1;
// todo show overview on non primary monitor is not working right now on gnome40
if (!this.checkIfFocusedMonitor(monitor)) {
Main.overview.viewSelector._workspacesDisplay._primaryIndex = monitor.index;
// this._needsIconAllocate = 1;
Main.overview._overview.clear_constraints();
Main.overview._overview.add_constraint(new Layout.MonitorConstraint({ index: monitor.index }));
// if (!this.checkIfFocusedMonitor(monitor)) {
// Main.overview._overview._controls._workspacesDisplay._primaryIndex = monitor.index;
if (ignoreRelayout) return;
this._newOverviewRelayout.call(Main.overview);
}
// Main.overview._overview.clear_constraints();
// Main.overview._overview.add_constraint(new Layout.MonitorConstraint({ index: monitor.index }));
// }
},
_saveMonitors: function() {
@@ -393,7 +373,7 @@ var dtpPanelManager = Utils.defineClass({
},
checkIfFocusedMonitor: function(monitor) {
return Main.overview.viewSelector._workspacesDisplay._primaryIndex == monitor.index;
return Main.overview._overview._controls._workspacesDisplay._primaryIndex == monitor.index;
},
_createPanel: function(monitor, isStandalone) {
@@ -511,66 +491,6 @@ var dtpPanelManager = Utils.defineClass({
});
},
_newOverviewRelayout: function() {
// To avoid updating the position and size of the workspaces
// we just hide the overview. The positions will be updated
// when it is next shown.
this.hide();
let workArea = Main.layoutManager.getWorkAreaForMonitor(Main.overview.viewSelector._workspacesDisplay._primaryIndex);
this._coverPane.set_position(0, workArea.y);
this._coverPane.set_size(workArea.width, workArea.height);
this._updateBackgrounds();
},
_newUpdateWorkspacesViews: function() {
for (let i = 0; i < this._workspacesViews.length; i++)
this._workspacesViews[i].destroy();
this._workspacesViews = [];
let monitors = Main.layoutManager.monitors;
for (let i = 0; i < monitors.length; i++) {
let workspaces;
let view;
if (this._workspacesOnlyOnPrimary && i != Main.layoutManager.primaryIndex) {
view = new WorkspacesView.ExtraWorkspaceView(i);
view.getActiveWorkspace = view.getActiveWorkspace || function() { return this._workspace; };
workspaces = [view._workspace];
} else {
view = new WorkspacesView.WorkspacesView(i, this._scrollAdjustment || 0);
workspaces = view._workspaces;
}
Utils.wrapActor(view);
view.actor.connect('scroll-event', this._onScrollEvent.bind(this));
if (i == Main.layoutManager.primaryIndex && view.scrollAdjustment) {
this._scrollAdjustment = view.scrollAdjustment;
this._scrollAdjustment.connect('notify::value',
this._scrollValueChanged.bind(this));
}
workspaces.forEach(w => w.setFullGeometry = geom => w._fullGeometry = geom);
this._workspacesViews.push(view);
}
this._workspacesViews.forEach(wv => Main.layoutManager.overviewGroup.add_actor(wv.actor));
if (this._syncWorkspacesFullGeometry) {
//gnome-shell 3.36.4
if (this._fullGeometry)
this._syncWorkspacesFullGeometry();
if (this._actualGeometry)
this._syncWorkspacesActualGeometry();
} else if (this._updateWorkspacesFullGeometry) {
this._updateWorkspacesFullGeometry();
this._updateWorkspacesActualGeometry();
}
},
_newGetShowAppsButton: function() {
let focusedMonitorIndex = Utils.findIndex(this.allPanels, p => this.checkIfFocusedMonitor(p.monitor));
@@ -661,47 +581,6 @@ var IconAnimator = Utils.defineClass({
}
});
function newViewSelectorAnimateIn(oldPage) {
if (oldPage)
oldPage.hide();
let vs = Main.overview.viewSelector;
vs.emit('page-empty');
vs._activePage.show();
if (vs._activePage == vs._appsPage && oldPage == vs._workspacesPage) {
// Restore opacity, in case we animated via _fadePageOut
vs._activePage.opacity = 255;
let animate = Me.settings.get_boolean('animate-show-apps');
if(animate)
vs.appDisplay.animate(IconGrid.AnimationDirection.IN);
} else {
vs._fadePageIn();
}
}
function newViewSelectorAnimateOut(page) {
let oldPage = page;
let vs = Main.overview.viewSelector;
if (page == vs._appsPage &&
vs._activePage == vs._workspacesPage &&
!Main.overview.animationInProgress) {
let animate = Me.settings.get_boolean('animate-show-apps');
if(animate)
vs.appDisplay.animate(IconGrid.AnimationDirection.OUT, Lang.bind(this,
function() {
vs._animateIn(oldPage)
}));
else
vs._animateIn(oldPage)
} else {
vs._fadePageOut(page);
}
}
function newGetPositionForDirection(direction, fromWs, toWs) {
let [xDest, yDest] = WM.WindowManager.prototype._getPositionForDirection(direction, fromWs, toWs);

649
prefs.js

File diff suppressed because it is too large Load Diff

View File

@@ -384,11 +384,6 @@
<summary>Override escape key</summary>
<description>Override the escape key to return to the desktop when entering the overview using the Show Applications button</description>
</key>
<key type="b" name="animate-show-apps">
<default>true</default>
<summary>Animate Show Applications from the desktop</summary>
<description>Animate Show Applications from the desktop</description>
</key>
<key type="as" name="show-apps-button-context-menu-commands">
<default>[]</default>
<summary>Show Apps button context menu commands</summary>
@@ -559,6 +554,11 @@
<summary>Close overview by clicking in empty space</summary>
<description>Close overview or app grid by clicking in empty space</description>
</key>
<key type="b" name="hide-overview-on-startup">
<default>false</default>
<summary>Hide overview on startup</summary>
<description>Hide overview on startup, which would be shown by default at gnome startup.</description>
</key>
<key type="b" name="group-apps">
<default>true</default>
<summary>Group applications</summary>

View File

@@ -35,7 +35,8 @@ const Shell = imports.gi.Shell;
const St = imports.gi.St;
const Mainloop = imports.mainloop;
const AppDisplay = imports.ui.appDisplay;
const SearchController = imports.ui.main.overview._overview._controls._searchController;
const AppDisplay = imports.ui.main.overview._overview._controls.appDisplay;
const AppFavorites = imports.ui.appFavorites;
const Dash = imports.ui.dash;
const DND = imports.ui.dnd;
@@ -247,7 +248,8 @@ var taskbar = Utils.defineClass({
}
this.showAppsButton.connect('notify::checked', Lang.bind(this, this._onShowAppsButtonToggled));
this.showAppsButton.checked = Main.overview.viewSelector._showAppsButton.checked;
this.showAppsButton.checked = (SearchController._showAppsButton) ? SearchController._showAppsButton.checked : false;
this._showAppsIcon.childScale = 1;
this._showAppsIcon.childOpacity = 255;
@@ -352,7 +354,7 @@ var taskbar = Utils.defineClass({
],
[
// Ensure the ShowAppsButton status is kept in sync
Main.overview.viewSelector._showAppsButton,
SearchController._showAppsButton,
'notify::checked',
Lang.bind(this, this._syncShowAppsButtonToggled)
],
@@ -1214,26 +1216,16 @@ var taskbar = Utils.defineClass({
// application button, cutomize the behaviour. Otherwise the shell has changed the
// status (due to the _syncShowAppsButtonToggled function below) and it
// has already performed the desired action.
let selector = SearchController;
let animate = Me.settings.get_boolean('animate-show-apps');
let selector = Main.overview.viewSelector;
if (selector._showAppsButton.checked !== this.showAppsButton.checked) {
if (selector._showAppsButton &&
selector._showAppsButton.checked !== this.showAppsButton.checked) {
// find visible view
let visibleView;
Utils.getAppDisplayViews().every(function(v, index) {
if (v.view.actor.visible) {
visibleView = index;
return false;
}
else
return true;
});
if (this.showAppsButton.checked) {
if (Me.settings.get_boolean('show-apps-override-escape')) {
//override escape key to return to the desktop when entering the overview using the showapps button
Main.overview.viewSelector._onStageKeyPress = function(actor, event) {
SearchController._onStageKeyPress = function(actor, event) {
if (Main.modalCount == 1 && event.get_key_symbol() === Clutter.KEY_Escape) {
this._searchActive ? this.reset() : Main.overview.hide();
@@ -1248,7 +1240,7 @@ var taskbar = Utils.defineClass({
// runs if we are already inside the overview.
if (!Main.overview._shown) {
this.forcedOverview = true;
let grid = Utils.getAppDisplayViews()[visibleView].view._grid;
let grid = AppDisplay._grid;
let onShownCb;
let overviewSignal = Config.PACKAGE_VERSION > '3.38.1' ? 'showing' : 'shown';
let overviewShowingId = Main.overview.connect(overviewSignal, () => {
@@ -1256,31 +1248,8 @@ var taskbar = Utils.defineClass({
onShownCb();
});
if (animate) {
// Animate in the the appview, hide the appGrid to avoiud flashing
// Go to the appView before entering the overview, skipping the workspaces.
// Do this manually avoiding opacity in transitions so that the setting of the opacity
// to 0 doesn't get overwritten.
Main.overview.viewSelector._activePage.hide();
Main.overview.viewSelector._activePage = Main.overview.viewSelector._appsPage;
Main.overview.viewSelector._activePage.show();
grid.actor.opacity = 0;
// The animation has to be trigered manually because the AppDisplay.animate
// method is waiting for an allocation not happening, as we skip the workspace view
// and the appgrid could already be allocated from previous shown.
// It has to be triggered after the overview is shown as wrong coordinates are obtained
// otherwise.
onShownCb = () => Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
grid.actor.opacity = 255;
grid.animateSpring(IconGrid.AnimationDirection.IN, this.showAppsButton);
});
} else {
Main.overview.viewSelector._activePage = Main.overview.viewSelector._appsPage;
Main.overview.viewSelector._activePage.show();
onShownCb = () => grid.emit('animation-done');
}
}
//temporarily use as primary the monitor on which the showapps btn was clicked, this is
//restored by the panel when exiting the overview
@@ -1288,34 +1257,20 @@ var taskbar = Utils.defineClass({
let overviewHiddenId = Main.overview.connect('hidden', () => {
Main.overview.disconnect(overviewHiddenId);
delete Main.overview.viewSelector._onStageKeyPress;
delete SearchController._onStageKeyPress;
});
// Finally show the overview
selector._showAppsButton.checked = true;
Main.overview.show();
Main.overview.show(2 /*APP_GRID*/);
}
else {
if (this.forcedOverview) {
// force exiting overview if needed
if (animate) {
// Manually trigger springout animation without activating the
// workspaceView to avoid the zoomout animation. Hide the appPage
// onComplete to avoid ugly flashing of original icons.
let view = Utils.getAppDisplayViews()[visibleView].view;
view.animate(IconGrid.AnimationDirection.OUT, Lang.bind(this, function() {
Main.overview.viewSelector._appsPage.hide();
Main.overview.hide();
selector._showAppsButton.checked = false;
this.forcedOverview = false;
}));
}
else {
Main.overview.hide();
this.forcedOverview = false;
}
}
else {
selector._showAppsButton.checked = false;
this.forcedOverview = false;
@@ -1325,7 +1280,7 @@ var taskbar = Utils.defineClass({
},
_syncShowAppsButtonToggled: function() {
let status = Main.overview.viewSelector._showAppsButton.checked;
let status = SearchController._showAppsButton.checked;
if (this.showAppsButton.checked !== status)
this.showAppsButton.checked = status;
},

View File

@@ -187,9 +187,14 @@ var GlobalSignalsHandler = defineClass({
let object = item[0];
let event = item[1][i];
let callback = item[2]
try {
let id = object.connect(event, callback);
handlers.push([object, id]);
} catch (e)
{
}
}
return handlers;
@@ -304,7 +309,7 @@ var getScaleFactor = function() {
var getAppDisplayViews = function() {
//gnome-shell 3.38 only has one view and it is now the appDisplay
return Main.overview.viewSelector.appDisplay._views || [{ view: Main.overview.viewSelector.appDisplay }];
return imports.ui.appDisplay._views || [{ view: imports.ui.appDisplay }];
};
var findIndex = function(array, predicate) {
@@ -340,7 +345,7 @@ var mergeObjects = function(main, bck) {
};
var hookVfunc = function(proto, symbol, func) {
if (Gi.hook_up_vfunc_symbol) {
if (Gi.hook_up_vfunc_symbol && func) {
//gjs > 1.53.3
proto[Gi.hook_up_vfunc_symbol](symbol, func);
} else {