Skip to content

Commit

Permalink
Fix "Show Applications" button
Browse files Browse the repository at this point in the history
The "Show Applications" button fails because the
Overview.ANIMATION_TIME property is now read-only (it has a
"const" prefix), so it's not possible to overwrite it to show
the applications list "instantaneously".

This patch removes the option of disabling the animation, thus
fixing the problem.
  • Loading branch information
sergio-costas committed Aug 28, 2024
1 parent 5a61b50 commit c6074b7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 40 deletions.
34 changes: 3 additions & 31 deletions docking.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
AppDisplay,
Layout,
Main,
Overview,
OverviewControls,
PointerWatcher,
Workspace,
Expand Down Expand Up @@ -2483,37 +2482,10 @@ export class DockManager {

if (!Main.overview.visible) {
this.mainDock.dash.showAppsButton._fromDesktop = true;
if (this._settings.animateShowApps) {
Main.overview.show(OverviewControls.ControlsState.APP_GRID);
} else {
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
const oldAnimationTime = OverviewControls.SIDE_CONTROLS_ANIMATION_TIME;
Overview.ANIMATION_TIME = 1;
const id = Main.overview.connect('shown', () => {
Overview.ANIMATION_TIME = oldAnimationTime;
Main.overview.disconnect(id);
});
Main.overview.show(OverviewControls.ControlsState.APP_GRID);
return GLib.SOURCE_REMOVE;
});
}
Main.overview.show(OverviewControls.ControlsState.APP_GRID);
} else if (!checked && this.mainDock.dash.showAppsButton._fromDesktop) {
if (this._settings.animateShowApps) {
Main.overview.hide();
this.mainDock.dash.showAppsButton._fromDesktop = false;
} else {
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
const oldAnimationTime = Overview.ANIMATION_TIME;
Overview.ANIMATION_TIME = 1;
const id = Main.overview.connect('hidden', () => {
Overview.ANIMATION_TIME = oldAnimationTime;
Main.overview.disconnect(id);
});
Main.overview.hide();
this.mainDock.dash.showAppsButton._fromDesktop = false;
return GLib.SOURCE_REMOVE;
});
}
Main.overview.hide();
this.mainDock.dash.showAppsButton._fromDesktop = false;
} else {
// TODO: I'm not sure how reliable this is, we might need to move the
// _onShowAppsButtonToggled logic into the extension.
Expand Down
4 changes: 0 additions & 4 deletions prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -752,10 +752,6 @@ const DockSettings = GObject.registerClass({
this._builder.get_object('application_button_first_button'),
'sensitive',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('animate-show-apps',
this._builder.get_object('application_button_animation_button'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('show-show-apps-button',
this._builder.get_object('application_button_animation_button'),
'sensitive',
Expand Down
5 changes: 0 additions & 5 deletions schemas/org.gnome.shell.extensions.dash-to-dock.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,6 @@
<default>true</default>
<summary>Show application button on the edge when using centered panel mode</summary>
</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="b" name="bolt-support">
<default>true</default>
<summary>Basic compatibility with bolt extensions</summary>
Expand Down

0 comments on commit c6074b7

Please sign in to comment.