Skip to content

Commit

Permalink
window overview, menu applet: Fix invalid object access cases (linuxm…
Browse files Browse the repository at this point in the history
…int#7880)

* menu applet: fix invalid object access while dragging favorites over app menu items

* workspaceView: fix invalid object access when entering window selection/scale view

Also fixes a const variable in overview.js being used in another module.

* tooltips: Fix invalid object access case
  • Loading branch information
jaszhix authored and Ingo Lafrenz committed Jan 2, 2019
1 parent a48cc29 commit 09dddeb
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion files/usr/share/cinnamon/applets/menu@cinnamon.org/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1958,7 +1958,9 @@ class CinnamonMenuApplet extends Applet.TextIconApplet {
}

_clearPrevSelection(actor) {
if (this._previousSelectedActor && this._previousSelectedActor != actor) {
if (this._previousSelectedActor
&& !this._previousSelectedActor.is_finalized()
&& this._previousSelectedActor != actor) {
if (this._previousSelectedActor._delegate instanceof ApplicationButton ||
this._previousSelectedActor._delegate instanceof RecentButton ||
this._previousSelectedActor._delegate instanceof SearchProviderResultButton ||
Expand Down
2 changes: 1 addition & 1 deletion js/ui/dnd.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ var _Draggable = new Lang.Class({
event.get_time())) {
// If it accepted the drop without taking the actor,
// handle it ourselves.
if (this._dragActor.get_parent() == Main.uiGroup) {
if (!this._dragActor.is_finalized() && this._dragActor.get_parent() === Main.uiGroup) {
if (this._restoreOnSuccess) {
this._restoreDragActor(event.get_time());
return true;
Expand Down
2 changes: 1 addition & 1 deletion js/ui/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Tweener = imports.ui.tweener;
const WorkspacesView = imports.ui.workspacesView;

// Time for initial animation going into Overview mode
const ANIMATION_TIME = 0.25;
var ANIMATION_TIME = 0.25;

const SwipeScrollDirection = WorkspacesView.SwipeScrollDirection;

Expand Down
1 change: 1 addition & 0 deletions js/ui/tooltips.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ Tooltip.prototype = {
},

hide: function() {
if (this._tooltip.is_finalized()) return;
this._tooltip.hide();

this.visible = false;
Expand Down
2 changes: 1 addition & 1 deletion js/ui/workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ WorkspaceMonitor.prototype = {
},

showWindowsOverlays: function() {
if (this.leavingOverview)
if (this.leavingOverview || this._windowOverlaysGroup.is_finalized())
return;

this._windowOverlaysGroup.show();
Expand Down
4 changes: 2 additions & 2 deletions js/ui/workspacesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ WorkspacesView.prototype = {
});
}
Tweener.addTween(workspace.actor, params);
} else {
} else if (!workspace.actor.is_finalized()) {
workspace.actor.set_position(x, 0);
if (w == 0)
this._updateVisibility();
Expand All @@ -219,7 +219,7 @@ WorkspacesView.prototype = {
if (this._animating || this._scrolling) {
workspace.hideWindowsOverlays();
workspace.actor.show();
} else {
} else if (!workspace.actor.is_finalized()) {
workspace.showWindowsOverlays();
workspace.actor.visible = (w == active);
}
Expand Down

0 comments on commit 09dddeb

Please # to comment.