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
This commit is contained in:
parent
cdd2803498
commit
15e7625c80
@ -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,
|
||||
|
@ -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];
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user