cleanup: Rename signals/methods that will conflict with Clutter.Actor

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/559
This commit is contained in:
Marco Trevisan (Treviño) 2019-08-28 23:06:14 +03:00 committed by Florian Müllner
parent ab6a629955
commit 0353a5bf2c
8 changed files with 66 additions and 50 deletions

View File

@ -1106,7 +1106,7 @@ var CalendarMessageList = class CalendarMessageList {
visibleId: 0, visibleId: 0,
emptyChangedId: 0, emptyChangedId: 0,
canClearChangedId: 0, canClearChangedId: 0,
keyFocusId: 0 messageFocusedId: 0
}; };
obj.destroyId = section.actor.connect('destroy', () => { obj.destroyId = section.actor.connect('destroy', () => {
this._removeSection(section); this._removeSection(section);
@ -1117,8 +1117,8 @@ var CalendarMessageList = class CalendarMessageList {
this._sync.bind(this)); this._sync.bind(this));
obj.canClearChangedId = section.connect('can-clear-changed', obj.canClearChangedId = section.connect('can-clear-changed',
this._sync.bind(this)); this._sync.bind(this));
obj.keyFocusId = section.connect('key-focus-in', obj.messageFocusedId = section.connect('message-focused',
this._onKeyFocusIn.bind(this)); this._onMessageFocused.bind(this));
this._sections.set(section, obj); this._sections.set(section, obj);
this._sectionList.add_actor(section.actor); this._sectionList.add_actor(section.actor);
@ -1131,15 +1131,15 @@ var CalendarMessageList = class CalendarMessageList {
section.actor.disconnect(obj.visibleId); section.actor.disconnect(obj.visibleId);
section.disconnect(obj.emptyChangedId); section.disconnect(obj.emptyChangedId);
section.disconnect(obj.canClearChangedId); section.disconnect(obj.canClearChangedId);
section.disconnect(obj.keyFocusId); section.disconnect(obj.messageFocusedId);
this._sections.delete(section); this._sections.delete(section);
this._sectionList.remove_actor(section.actor); this._sectionList.remove_actor(section.actor);
this._sync(); this._sync();
} }
_onKeyFocusIn(section, actor) { _onMessageFocused(_section, messageActor) {
Util.ensureActorVisibleInScrollView(this._scrollView, actor); Util.ensureActorVisibleInScrollView(this._scrollView, messageActor);
} }
_sync() { _sync() {

View File

@ -977,7 +977,7 @@ var EmojiSelection = class EmojiSelection {
key.keyButton.add_style_class_name('default-key'); key.keyButton.add_style_class_name('default-key');
key.keyButton.add_style_class_name('hide-key'); key.keyButton.add_style_class_name('hide-key');
key.connect('released', () => { key.connect('released', () => {
this.emit('hide'); this.emit('close-request');
}); });
row.appendKey(key.actor); row.appendKey(key.actor);
row.layoutButtons(); row.layoutButtons();
@ -1076,9 +1076,9 @@ var Keyboard = class Keyboard {
return; return;
if (focused) if (focused)
this.show(Main.layoutManager.focusIndex); this.open(Main.layoutManager.focusIndex);
else else
this.hide(); this.close();
}); });
Meta.get_backend().connect('last-device-changed', Meta.get_backend().connect('last-device-changed',
@ -1187,7 +1187,7 @@ var Keyboard = class Keyboard {
this._emojiSelection = new EmojiSelection(); this._emojiSelection = new EmojiSelection();
this._emojiSelection.connect('toggle', this._toggleEmoji.bind(this)); this._emojiSelection.connect('toggle', this._toggleEmoji.bind(this));
this._emojiSelection.connect('hide', () => this.hide()); this._emojiSelection.connect('close-request', () => this.close());
this._emojiSelection.connect('emoji-selected', (selection, emoji) => { this._emojiSelection.connect('emoji-selected', (selection, emoji) => {
this._keyboardController.commitString(emoji); this._keyboardController.commitString(emoji);
}); });
@ -1235,13 +1235,13 @@ var Keyboard = class Keyboard {
return; return;
if (!(focus instanceof Clutter.Text)) { if (!(focus instanceof Clutter.Text)) {
this.hide(); this.close();
return; return;
} }
if (!this._showIdleId) { if (!this._showIdleId) {
this._showIdleId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => { this._showIdleId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => {
this.show(Main.layoutManager.focusIndex); this.open(Main.layoutManager.focusIndex);
this._showIdleId = 0; this._showIdleId = 0;
return GLib.SOURCE_REMOVE; return GLib.SOURCE_REMOVE;
}); });
@ -1357,7 +1357,7 @@ var Keyboard = class Keyboard {
if (keyval != null) if (keyval != null)
this._keyboardController.keyvalRelease(keyval); this._keyboardController.keyvalRelease(keyval);
else if (action == 'hide') else if (action == 'hide')
this.hide(); this.close();
else if (action == 'languageMenu') else if (action == 'languageMenu')
this._popupLanguageMenu(actor); this._popupLanguageMenu(actor);
else if (action == 'emoji') else if (action == 'emoji')
@ -1523,9 +1523,9 @@ var Keyboard = class Keyboard {
return; return;
if (enabled) if (enabled)
this.show(Main.layoutManager.focusIndex); this.open(Main.layoutManager.focusIndex);
else else
this.hide(); this.close();
} }
_setActiveLayer(activeLevel) { _setActiveLayer(activeLevel) {
@ -1565,7 +1565,7 @@ var Keyboard = class Keyboard {
this._keyboardRestingId = 0; this._keyboardRestingId = 0;
} }
show(monitor) { open(monitor) {
if (!this._enabled) if (!this._enabled)
return; return;
@ -1585,13 +1585,13 @@ var Keyboard = class Keyboard {
KEYBOARD_REST_TIME, KEYBOARD_REST_TIME,
() => { () => {
this._clearKeyboardRestTimer(); this._clearKeyboardRestTimer();
this._show(monitor); this._open(monitor);
return GLib.SOURCE_REMOVE; return GLib.SOURCE_REMOVE;
}); });
GLib.Source.set_name_by_id(this._keyboardRestingId, '[gnome-shell] this._clearKeyboardRestTimer'); GLib.Source.set_name_by_id(this._keyboardRestingId, '[gnome-shell] this._clearKeyboardRestTimer');
} }
_show(monitor) { _open(monitor) {
if (!this._keyboardRequested) if (!this._keyboardRequested)
return; return;
@ -1607,7 +1607,7 @@ var Keyboard = class Keyboard {
} }
} }
hide() { close() {
if (!this._enabled) if (!this._enabled)
return; return;
@ -1622,13 +1622,13 @@ var Keyboard = class Keyboard {
KEYBOARD_REST_TIME, KEYBOARD_REST_TIME,
() => { () => {
this._clearKeyboardRestTimer(); this._clearKeyboardRestTimer();
this._hide(); this._close();
return GLib.SOURCE_REMOVE; return GLib.SOURCE_REMOVE;
}); });
GLib.Source.set_name_by_id(this._keyboardRestingId, '[gnome-shell] this._clearKeyboardRestTimer'); GLib.Source.set_name_by_id(this._keyboardRestingId, '[gnome-shell] this._clearKeyboardRestTimer');
} }
_hide() { _close() {
if (this._keyboardRequested) if (this._keyboardRequested)
return; return;

View File

@ -116,6 +116,7 @@ var Lightbox = class Lightbox {
radialEffect: false, radialEffect: false,
}); });
this._active = false;
this._container = container; this._container = container;
this._children = container.get_children(); this._children = container.get_children();
this._fadeFactor = params.fadeFactor; this._fadeFactor = params.fadeFactor;
@ -131,7 +132,6 @@ var Lightbox = class Lightbox {
container.add_actor(this.actor); container.add_actor(this.actor);
this.actor.raise_top(); this.actor.raise_top();
this.actor.hide(); this.actor.hide();
this.shown = false;
this.actor.connect('destroy', this._onDestroy.bind(this)); this.actor.connect('destroy', this._onDestroy.bind(this));
@ -150,6 +150,10 @@ var Lightbox = class Lightbox {
this._highlighted = null; this._highlighted = null;
} }
get active() {
return this._active;
}
_actorAdded(container, newChild) { _actorAdded(container, newChild) {
let children = this._container.get_children(); let children = this._container.get_children();
let myIndex = children.indexOf(this.actor); let myIndex = children.indexOf(this.actor);
@ -172,7 +176,7 @@ var Lightbox = class Lightbox {
} }
} }
show(fadeInTime) { lightOn(fadeInTime) {
this.actor.remove_all_transitions(); this.actor.remove_all_transitions();
let easeProps = { let easeProps = {
@ -181,8 +185,8 @@ var Lightbox = class Lightbox {
}; };
let onComplete = () => { let onComplete = () => {
this.shown = true; this._active = true;
this.emit('shown'); this.emit('active-changed');
}; };
this.actor.show(); this.actor.show();
@ -201,10 +205,12 @@ var Lightbox = class Lightbox {
} }
} }
hide(fadeOutTime) { lightOff(fadeOutTime) {
this.shown = false;
this.actor.remove_all_transitions(); this.actor.remove_all_transitions();
this._active = false;
this.emit('active-changed');
let easeProps = { let easeProps = {
duration: fadeOutTime || 0, duration: fadeOutTime || 0,
mode: Clutter.AnimationMode.EASE_OUT_QUAD mode: Clutter.AnimationMode.EASE_OUT_QUAD

View File

@ -539,8 +539,8 @@ var MessageListSection = class MessageListSection {
this._sync(); this._sync();
} }
_onKeyFocusIn(actor) { _onKeyFocusIn(messageActor) {
this.emit('key-focus-in', actor); this.emit('message-focused', messageActor);
} }
get allowed() { get allowed() {

View File

@ -121,7 +121,7 @@ var ModalDialog = GObject.registerClass({
this.dialogLayout.opacity = 255; this.dialogLayout.opacity = 255;
if (this._lightbox) if (this._lightbox)
this._lightbox.show(); this._lightbox.lightOn();
this.opacity = 0; this.opacity = 0;
this.show(); this.show();
this.ease({ this.ease({

View File

@ -559,11 +559,11 @@ var ScreenShield = class {
this._longLightbox = new Lightbox.Lightbox(Main.uiGroup, this._longLightbox = new Lightbox.Lightbox(Main.uiGroup,
{ inhibitEvents: true, { inhibitEvents: true,
fadeFactor: 1 }); fadeFactor: 1 });
this._longLightbox.connect('shown', this._onLongLightboxShown.bind(this)); this._longLightbox.connect('active-changed', this._onLongLightbox.bind(this));
this._shortLightbox = new Lightbox.Lightbox(Main.uiGroup, this._shortLightbox = new Lightbox.Lightbox(Main.uiGroup,
{ inhibitEvents: true, { inhibitEvents: true,
fadeFactor: 1 }); fadeFactor: 1 });
this._shortLightbox.connect('shown', this._onShortLightboxShown.bind(this)); this._shortLightbox.connect('active-changed', this._onShortLightbox.bind(this));
this.idleMonitor = Meta.IdleMonitor.get_core(); this.idleMonitor = Meta.IdleMonitor.get_core();
this._cursorTracker = Meta.CursorTracker.get_for_display(global.display); this._cursorTracker = Meta.CursorTracker.get_for_display(global.display);
@ -852,7 +852,7 @@ var ScreenShield = class {
_activateFade(lightbox, time) { _activateFade(lightbox, time) {
Main.uiGroup.set_child_above_sibling(lightbox.actor, null); Main.uiGroup.set_child_above_sibling(lightbox.actor, null);
lightbox.show(time); lightbox.lightOn(time);
if (this._becameActiveId == 0) if (this._becameActiveId == 0)
this._becameActiveId = this.idleMonitor.add_user_active_watch(this._onUserBecameActive.bind(this)); this._becameActiveId = this.idleMonitor.add_user_active_watch(this._onUserBecameActive.bind(this));
@ -881,18 +881,20 @@ var ScreenShield = class {
this._becameActiveId = 0; this._becameActiveId = 0;
if (this._isActive || this._isLocked) { if (this._isActive || this._isLocked) {
this._longLightbox.hide(); this._longLightbox.lightOff();
this._shortLightbox.hide(); this._shortLightbox.lightOff();
} else { } else {
this.deactivate(false); this.deactivate(false);
} }
} }
_onLongLightboxShown() { _onLongLightbox(lightBox) {
if (lightBox.active)
this.activate(false); this.activate(false);
} }
_onShortLightboxShown() { _onShortLightbox(lightBox) {
if (lightBox.active)
this._completeLockScreenShown(); this._completeLockScreenShown();
} }
@ -1235,8 +1237,8 @@ var ScreenShield = class {
this._dialog = null; this._dialog = null;
} }
this._longLightbox.hide(); this._longLightbox.lightOff();
this._shortLightbox.hide(); this._shortLightbox.lightOff();
this.actor.hide(); this.actor.hide();
if (this._becameActiveId != 0) { if (this._becameActiveId != 0) {

View File

@ -148,6 +148,7 @@ var SearchResultsBase = class {
this._resultsView = resultsView; this._resultsView = resultsView;
this._terms = []; this._terms = [];
this._focusChild = null;
this.actor = new St.BoxLayout({ style_class: 'search-section', this.actor = new St.BoxLayout({ style_class: 'search-section',
vertical: true }); vertical: true });
@ -190,8 +191,15 @@ var SearchResultsBase = class {
this.actor.hide(); this.actor.hide();
} }
get focusChild() {
return this._focusChild;
}
_keyFocusIn(actor) { _keyFocusIn(actor) {
this.emit('key-focus-in', actor); if (this._focusChild == actor)
return;
this._focusChild = actor;
this.emit('focus-child-changed');
} }
_setMoreCount(_count) { _setMoreCount(_count) {
@ -595,8 +603,8 @@ var SearchResultsView = class {
return false; return false;
} }
_keyFocusIn(provider, actor) { _focusChildChanged(provider) {
Util.ensureActorVisibleInScrollView(this._scrollView, actor); Util.ensureActorVisibleInScrollView(this._scrollView, provider.focusChild);
} }
_ensureProviderDisplay(provider) { _ensureProviderDisplay(provider) {
@ -609,7 +617,7 @@ var SearchResultsView = class {
else else
providerDisplay = new GridSearchResults(provider, this); providerDisplay = new GridSearchResults(provider, this);
providerDisplay.connect('key-focus-in', this._keyFocusIn.bind(this)); providerDisplay.connect('focus-child-changed', this._focusChildChanged.bind(this));
providerDisplay.actor.hide(); providerDisplay.actor.hide();
this._content.add(providerDisplay.actor); this._content.add(providerDisplay.actor);
provider.display = providerDisplay; provider.display = providerDisplay;

View File

@ -388,7 +388,7 @@ var TilePreview = class {
this._showing = false; this._showing = false;
} }
show(window, tileRect, monitorIndex) { open(window, tileRect, monitorIndex) {
let windowActor = window.get_compositor_private(); let windowActor = window.get_compositor_private();
if (!windowActor) if (!windowActor)
return; return;
@ -432,7 +432,7 @@ var TilePreview = class {
}); });
} }
hide() { close() {
if (!this._showing) if (!this._showing)
return; return;
@ -1089,7 +1089,7 @@ var WindowManager = class {
let mode = Shell.ActionMode.ALL & ~Shell.ActionMode.LOCK_SCREEN; let mode = Shell.ActionMode.ALL & ~Shell.ActionMode.LOCK_SCREEN;
let bottomDragAction = new EdgeDragAction.EdgeDragAction(St.Side.BOTTOM, mode); let bottomDragAction = new EdgeDragAction.EdgeDragAction(St.Side.BOTTOM, mode);
bottomDragAction.connect('activated', () => { bottomDragAction.connect('activated', () => {
Main.keyboard.show(Main.layoutManager.bottomIndex); Main.keyboard.open(Main.layoutManager.bottomIndex);
}); });
Main.layoutManager.connect('keyboard-visible-changed', (manager, visible) => { Main.layoutManager.connect('keyboard-visible-changed', (manager, visible) => {
bottomDragAction.cancel(); bottomDragAction.cancel();
@ -2045,13 +2045,13 @@ var WindowManager = class {
_showTilePreview(shellwm, window, tileRect, monitorIndex) { _showTilePreview(shellwm, window, tileRect, monitorIndex) {
if (!this._tilePreview) if (!this._tilePreview)
this._tilePreview = new TilePreview(); this._tilePreview = new TilePreview();
this._tilePreview.show(window, tileRect, monitorIndex); this._tilePreview.open(window, tileRect, monitorIndex);
} }
_hideTilePreview() { _hideTilePreview() {
if (!this._tilePreview) if (!this._tilePreview)
return; return;
this._tilePreview.hide(); this._tilePreview.close();
} }
_showWindowMenu(shellwm, window, menu, rect) { _showWindowMenu(shellwm, window, menu, rect) {