shell-global: add a "display" property
and update callers to fetch that rather than doing "global.screen.get_display()" https://bugzilla.gnome.org/show_bug.cgi?id=654639
This commit is contained in:
@ -223,7 +223,7 @@ AltTabPopup.prototype = {
|
||||
let keysym = event.get_key_symbol();
|
||||
let event_state = Shell.get_event_state(event);
|
||||
let backwards = event_state & Clutter.ModifierType.SHIFT_MASK;
|
||||
let action = global.screen.get_display().get_keybinding_action(event.get_key_code(), event_state);
|
||||
let action = global.display.get_keybinding_action(event.get_key_code(), event_state);
|
||||
|
||||
this._disableHover();
|
||||
|
||||
|
@ -135,9 +135,7 @@ LayoutManager.prototype = {
|
||||
},
|
||||
|
||||
get focusIndex() {
|
||||
let screen = global.screen;
|
||||
let display = screen.get_display();
|
||||
let focusWindow = display.focus_window;
|
||||
let focusWindow = global.display.focus_window;
|
||||
|
||||
if (focusWindow) {
|
||||
let wrect = focusWindow.get_outer_rect();
|
||||
|
@ -222,10 +222,9 @@ function WindowList() {
|
||||
WindowList.prototype = {
|
||||
_init : function () {
|
||||
this.actor = new St.BoxLayout({ name: 'Windows', vertical: true, style: 'spacing: 8px' });
|
||||
let display = global.screen.get_display();
|
||||
let tracker = Shell.WindowTracker.get_default();
|
||||
this._updateId = Main.initializeDeferredWork(this.actor, Lang.bind(this, this._updateWindowList));
|
||||
display.connect('window-created', Lang.bind(this, this._updateWindowList));
|
||||
global.display.connect('window-created', Lang.bind(this, this._updateWindowList));
|
||||
tracker.connect('tracked-windows-changed', Lang.bind(this, this._updateWindowList));
|
||||
},
|
||||
|
||||
|
@ -194,8 +194,7 @@ function start() {
|
||||
panel.startStatusArea();
|
||||
panel.startupAnimation();
|
||||
|
||||
let display = global.screen.get_display();
|
||||
display.connect('overlay-key', Lang.bind(overview, overview.toggle));
|
||||
global.display.connect('overlay-key', Lang.bind(overview, overview.toggle));
|
||||
|
||||
global.stage.connect('captured-event', _globalKeyPressHandler);
|
||||
|
||||
@ -524,9 +523,8 @@ function _globalKeyPressHandler(actor, event) {
|
||||
let keyCode = event.get_key_code();
|
||||
let modifierState = Shell.get_event_state(event);
|
||||
|
||||
let display = global.screen.get_display();
|
||||
// This relies on the fact that Clutter.ModifierType is the same as Gdk.ModifierType
|
||||
let action = display.get_keybinding_action(keyCode, modifierState);
|
||||
let action = global.display.get_keybinding_action(keyCode, modifierState);
|
||||
|
||||
// The screenshot action should always be available (even if a
|
||||
// modal dialog is present)
|
||||
|
@ -234,9 +234,7 @@ FocusGrabber.prototype = {
|
||||
|
||||
this.actor = actor;
|
||||
|
||||
let metaDisplay = global.screen.get_display();
|
||||
|
||||
this._prevFocusedWindow = metaDisplay.focus_window;
|
||||
this._prevFocusedWindow = global.display.focus_window;
|
||||
this._prevKeyFocusActor = global.stage.get_key_focus();
|
||||
|
||||
if (!Main.overview.visible)
|
||||
@ -290,8 +288,6 @@ FocusGrabber.prototype = {
|
||||
if (!this._hasFocus)
|
||||
return;
|
||||
|
||||
let metaDisplay = global.screen.get_display();
|
||||
|
||||
if (this._focusActorChangedId > 0) {
|
||||
global.stage.disconnect(this._focusActorChangedId);
|
||||
this._focusActorChangedId = 0;
|
||||
@ -310,8 +306,8 @@ FocusGrabber.prototype = {
|
||||
this._hasFocus = false;
|
||||
this.emit('focus-ungrabbed');
|
||||
|
||||
if (this._prevFocusedWindow && !metaDisplay.focus_window) {
|
||||
metaDisplay.set_input_focus_window(this._prevFocusedWindow, false, global.get_current_time());
|
||||
if (this._prevFocusedWindow && !global.display.focus_window) {
|
||||
global.display.set_input_focus_window(this._prevFocusedWindow, false, global.get_current_time());
|
||||
this._prevFocusedWindow = null;
|
||||
}
|
||||
if (this._prevKeyFocusActor) {
|
||||
|
@ -237,7 +237,6 @@ AppMenuButton.prototype = {
|
||||
|
||||
_init: function() {
|
||||
PanelMenu.Button.prototype._init.call(this, 0.0);
|
||||
this._metaDisplay = global.screen.get_display();
|
||||
this._startingApps = [];
|
||||
|
||||
this._targetApp = null;
|
||||
|
@ -16,8 +16,7 @@ WindowAttentionHandler.prototype = {
|
||||
this._tracker = Shell.WindowTracker.get_default();
|
||||
this._tracker.connect('startup-sequence-changed', Lang.bind(this, this._onStartupSequenceChanged));
|
||||
|
||||
let display = global.screen.get_display();
|
||||
display.connect('window-demands-attention', Lang.bind(this, this._onWindowDemandsAttention));
|
||||
global.display.connect('window-demands-attention', Lang.bind(this, this._onWindowDemandsAttention));
|
||||
},
|
||||
|
||||
_onStartupSequenceChanged : function(tracker) {
|
||||
|
@ -161,7 +161,7 @@ WindowClone.prototype = {
|
||||
// will look funny.
|
||||
|
||||
if (!this._selected &&
|
||||
this.metaWindow != global.screen.get_display().focus_window)
|
||||
this.metaWindow != global.display.focus_window)
|
||||
this._zoomEnd();
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user