[gnome-shell] grabHelper: Throw an error if the owner is not an actor



commit 238b87d3864dacf73ffb888aaf9fddc9bcb02c98
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Wed May 29 14:43:27 2019 -0500

    grabHelper: Throw an error if the owner is not an actor
    
    Starting from commit 7bb84dae, GrabHelper requires the owner to be an Actor as
    we pass this to pushModal that assumes it to be as well.
    
    So check that GrabHelper owner is an actor and throws an error if it is not the
    case. This helps in tracking down issues such as gnome-shell-extensions!68
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/565

 js/ui/grabHelper.js | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/js/ui/grabHelper.js b/js/ui/grabHelper.js
index 4ba0b1b56..509915019 100644
--- a/js/ui/grabHelper.js
+++ b/js/ui/grabHelper.js
@@ -43,6 +43,9 @@ function _popGrabHelper(grabHelper) {
 // call grab().
 var GrabHelper = class GrabHelper {
     constructor(owner, params) {
+        if (!(owner instanceof Clutter.Actor))
+            throw new Error('GrabHelper owner must be a Clutter.Actor');
+
         this._owner = owner;
         this._modalParams = params;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]