From 15e7625c80738906ec0770c337e5a86564987173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 31 Jan 2019 22:07:38 +0100 Subject: [PATCH] cleanup: Remove erroneous vfunc parameters Unlike in C or signal handlers, vfuncs don't include the this-object in their arguments. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/388 --- HACKING.md | 6 +++--- js/ui/dateMenu.js | 4 ++-- js/ui/edgeDragAction.js | 6 +++--- js/ui/magnifier.js | 4 ++-- js/ui/panel.js | 2 +- js/ui/viewSelector.js | 6 +++--- js/ui/windowManager.js | 6 +++--- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/HACKING.md b/HACKING.md index d8d940d04..f1b3d3765 100644 --- a/HACKING.md +++ b/HACKING.md @@ -158,15 +158,15 @@ you to inherit from a type to use it, you can do so: var MyClutterActor = GObject.registerClass( class MyClutterActor extends Clutter.Actor { - vfunc_get_preferred_width(actor, forHeight) { + vfunc_get_preferred_width(forHeight) { return [100, 100]; } - vfunc_get_preferred_height(actor, forWidth) { + vfunc_get_preferred_height(forWidth) { return [100, 100]; } - vfunc_paint(actor) { + vfunc_paint() { let alloc = this.get_allocation_box(); Cogl.set_source_color4ub(255, 0, 0, 255); Cogl.rectangle(alloc.x1, alloc.y1, diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js index 5d6938960..a04efb2f3 100644 --- a/js/ui/dateMenu.js +++ b/js/ui/dateMenu.js @@ -377,13 +377,13 @@ class IndicatorPad extends St.Widget { super._init(); } - vfunc_get_preferred_width(container, forHeight) { + vfunc_get_preferred_width(forHeight) { if (this._source.visible) return this._source.get_preferred_width(forHeight); return [0, 0]; } - vfunc_get_preferred_height(container, forWidth) { + vfunc_get_preferred_height(forWidth) { if (this._source.visible) return this._source.get_preferred_height(forWidth); return [0, 0]; diff --git a/js/ui/edgeDragAction.js b/js/ui/edgeDragAction.js index ec94c1b42..0cad5da34 100644 --- a/js/ui/edgeDragAction.js +++ b/js/ui/edgeDragAction.js @@ -30,7 +30,7 @@ var EdgeDragAction = GObject.registerClass({ return global.display.get_monitor_geometry(monitorIndex); } - vfunc_gesture_prepare(action, actor) { + vfunc_gesture_prepare(actor) { if (this.get_n_current_points() == 0) return false; @@ -46,7 +46,7 @@ var EdgeDragAction = GObject.registerClass({ (this._side == St.Side.BOTTOM && y > monitorRect.y + monitorRect.height - EDGE_THRESHOLD)); } - vfunc_gesture_progress(action, actor) { + vfunc_gesture_progress(actor) { let [startX, startY] = this.get_press_coords(0); let [x, y] = this.get_motion_coords(0); let offsetX = Math.abs (x - startX); @@ -66,7 +66,7 @@ var EdgeDragAction = GObject.registerClass({ return true; } - vfunc_gesture_end(action, actor) { + vfunc_gesture_end(actor) { let [startX, startY] = this.get_press_coords(0); let [x, y] = this.get_motion_coords(0); let monitorRect = this._getMonitorRect(startX, startY); diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js index 0b480f117..b33c300c6 100644 --- a/js/ui/magnifier.js +++ b/js/ui/magnifier.js @@ -62,14 +62,14 @@ var MouseSpriteContent = GObject.registerClass({ this._texture = null; } - vfunc_get_preferred_size(content) { + vfunc_get_preferred_size() { if (!this._texture) return [0, 0]; return [this._texture.get_width(), this._texture.get_height()]; } - vfunc_paint_content(content, actor, node) { + vfunc_paint_content(actor, node) { if (!this._texture) return; diff --git a/js/ui/panel.js b/js/ui/panel.js index 9b264d9b0..9c1954841 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -835,7 +835,7 @@ class Panel extends St.Widget { this._updateSolidStyle(); } - vfunc_get_preferred_width(actor, forHeight) { + vfunc_get_preferred_width(forHeight) { let primaryMonitor = Main.layoutManager.primaryMonitor; if (primaryMonitor) diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js index f19d67b12..3f690982f 100644 --- a/js/ui/viewSelector.js +++ b/js/ui/viewSelector.js @@ -81,7 +81,7 @@ var ShowOverviewAction = GObject.registerClass({ }); } - vfunc_gesture_prepare(action, actor) { + vfunc_gesture_prepare(actor) { return Main.actionMode == Shell.ActionMode.NORMAL && this.get_n_current_points() == this.get_n_touch_points(); } @@ -115,12 +115,12 @@ var ShowOverviewAction = GObject.registerClass({ height: maxY - minY }); } - vfunc_gesture_begin(action, actor) { + vfunc_gesture_begin(actor) { this._initialRect = this._getBoundingRect(false); return true; } - vfunc_gesture_end(action, actor) { + vfunc_gesture_end(actor) { let rect = this._getBoundingRect(true); let oldArea = this._initialRect.width * this._initialRect.height; let newArea = rect.width * rect.height; diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 8c4cb36d8..2cb8dfb31 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -599,7 +599,7 @@ var AppSwitchAction = GObject.registerClass({ }); } - vfunc_gesture_prepare(action, actor) { + vfunc_gesture_prepare(actor) { if (Main.actionMode != Shell.ActionMode.NORMAL) { this.cancel(); return false; @@ -608,7 +608,7 @@ var AppSwitchAction = GObject.registerClass({ return this.get_n_current_points() <= 4; } - vfunc_gesture_begin(action, actor) { + vfunc_gesture_begin(actor) { // in milliseconds const LONG_PRESS_TIMEOUT = 250; @@ -632,7 +632,7 @@ var AppSwitchAction = GObject.registerClass({ return this.get_n_current_points() <= 4; } - vfunc_gesture_progress(action, actor) { + vfunc_gesture_progress(actor) { const MOTION_THRESHOLD = 30; if (this.get_n_current_points() == 3) {