Make "global" global.
Rather than doing "let global = Shell.Global.get()" everywhere we need it, just create a global variable called "global". http://bugzilla.gnome.org/show_bug.cgi?id=594546
This commit is contained in:
parent
0882da0a71
commit
d0d79c5b3e
@ -36,8 +36,6 @@ function AltTabPopup() {
|
|||||||
|
|
||||||
AltTabPopup.prototype = {
|
AltTabPopup.prototype = {
|
||||||
_init : function() {
|
_init : function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
this.actor = new Big.Box({ background_color : POPUP_BG_COLOR,
|
this.actor = new Big.Box({ background_color : POPUP_BG_COLOR,
|
||||||
corner_radius: POPUP_GRID_SPACING,
|
corner_radius: POPUP_GRID_SPACING,
|
||||||
padding: POPUP_GRID_SPACING,
|
padding: POPUP_GRID_SPACING,
|
||||||
@ -140,8 +138,6 @@ AltTabPopup.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
show : function(initialSelection) {
|
show : function(initialSelection) {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
global.window_group.add_actor(this._overlay);
|
global.window_group.add_actor(this._overlay);
|
||||||
this._overlay.raise_top();
|
this._overlay.raise_top();
|
||||||
this._overlay.show();
|
this._overlay.show();
|
||||||
@ -234,8 +230,6 @@ AltTabPopup.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_adjust_overlay : function() {
|
_adjust_overlay : function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
if (this._selected && this._selected.icon_rect) {
|
if (this._selected && this._selected.icon_rect) {
|
||||||
// We want to highlight a specific rectangle within the
|
// We want to highlight a specific rectangle within the
|
||||||
// task bar, so rearrange the pieces of the overlay to
|
// task bar, so rearrange the pieces of the overlay to
|
||||||
|
@ -1089,8 +1089,6 @@ AppWell.prototype = {
|
|||||||
|
|
||||||
// Draggable target interface
|
// Draggable target interface
|
||||||
acceptDrop : function(source, actor, x, y, time) {
|
acceptDrop : function(source, actor, x, y, time) {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
let appSystem = Shell.AppSystem.get_default();
|
let appSystem = Shell.AppSystem.get_default();
|
||||||
|
|
||||||
let app = null;
|
let app = null;
|
||||||
|
@ -18,8 +18,6 @@ function Chrome() {
|
|||||||
|
|
||||||
Chrome.prototype = {
|
Chrome.prototype = {
|
||||||
_init: function() {
|
_init: function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
// The group itself has zero size so it doesn't interfere with DND
|
// The group itself has zero size so it doesn't interfere with DND
|
||||||
this.actor = new Clutter.Group({ width: 0, height: 0 });
|
this.actor = new Clutter.Group({ width: 0, height: 0 });
|
||||||
global.stage.add_actor(this.actor);
|
global.stage.add_actor(this.actor);
|
||||||
@ -238,7 +236,6 @@ Chrome.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_windowsRestacked: function() {
|
_windowsRestacked: function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
let windows = global.get_windows();
|
let windows = global.get_windows();
|
||||||
|
|
||||||
// The chrome layer should be visible unless there is a window
|
// The chrome layer should be visible unless there is a window
|
||||||
@ -280,7 +277,6 @@ Chrome.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_updateRegions: function() {
|
_updateRegions: function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
let rects = [], struts = [], i;
|
let rects = [], struts = [], i;
|
||||||
|
|
||||||
delete this._updateRegionIdle;
|
delete this._updateRegionIdle;
|
||||||
|
@ -92,7 +92,6 @@ Pane.prototype = {
|
|||||||
let chromeTop = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL,
|
let chromeTop = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL,
|
||||||
spacing: 6 });
|
spacing: 6 });
|
||||||
|
|
||||||
let global = Shell.Global.get();
|
|
||||||
let closeIconUri = "file://" + global.imagedir + "close.svg";
|
let closeIconUri = "file://" + global.imagedir + "close.svg";
|
||||||
let closeIcon = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
|
let closeIcon = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
|
||||||
closeIconUri,
|
closeIconUri,
|
||||||
@ -288,7 +287,6 @@ SearchEntry.prototype = {
|
|||||||
padding_right: 4 });
|
padding_right: 4 });
|
||||||
box.append(this._iconBox, Big.BoxPackFlags.END);
|
box.append(this._iconBox, Big.BoxPackFlags.END);
|
||||||
|
|
||||||
let global = Shell.Global.get();
|
|
||||||
let magnifierUri = "file://" + global.imagedir + "magnifier.svg";
|
let magnifierUri = "file://" + global.imagedir + "magnifier.svg";
|
||||||
this._magnifierIcon = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
|
this._magnifierIcon = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
|
||||||
magnifierUri, 18, 18);
|
magnifierUri, 18, 18);
|
||||||
@ -408,7 +406,6 @@ BackLink.prototype = {
|
|||||||
border_right: SECTION_BORDER,
|
border_right: SECTION_BORDER,
|
||||||
border_color: SECTION_BORDER_COLOR });
|
border_color: SECTION_BORDER_COLOR });
|
||||||
|
|
||||||
let global = Shell.Global.get();
|
|
||||||
let backIconUri = "file://" + global.imagedir + "back.svg";
|
let backIconUri = "file://" + global.imagedir + "back.svg";
|
||||||
let backIcon = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
|
let backIcon = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
|
||||||
backIconUri,
|
backIconUri,
|
||||||
@ -557,8 +554,6 @@ function Dash() {
|
|||||||
|
|
||||||
Dash.prototype = {
|
Dash.prototype = {
|
||||||
_init : function() {
|
_init : function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
// dash and the popup panes need to be reactive so that the clicks in unoccupied places on them
|
// dash and the popup panes need to be reactive so that the clicks in unoccupied places on them
|
||||||
// are not passed to the transparent background underneath them. This background is used for the workspaces area when
|
// are not passed to the transparent background underneath them. This background is used for the workspaces area when
|
||||||
// the additional dash panes are being shown and it handles clicks by closing the additional panes, so that the user
|
// the additional dash panes are being shown and it handles clicks by closing the additional panes, so that the user
|
||||||
@ -786,7 +781,6 @@ Dash.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
show: function() {
|
show: function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
global.stage.set_key_focus(this._searchEntry.entry);
|
global.stage.set_key_focus(this._searchEntry.entry);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -88,7 +88,6 @@ GenericDisplayItem.prototype = {
|
|||||||
spacing: DEFAULT_PADDING });
|
spacing: DEFAULT_PADDING });
|
||||||
this._infoContent.append(this._infoText, Big.BoxPackFlags.EXPAND);
|
this._infoContent.append(this._infoText, Big.BoxPackFlags.EXPAND);
|
||||||
|
|
||||||
let global = Shell.Global.get();
|
|
||||||
let infoIconUri = "file://" + global.imagedir + "info.svg";
|
let infoIconUri = "file://" + global.imagedir + "info.svg";
|
||||||
let infoIcon = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
|
let infoIcon = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
|
||||||
infoIconUri,
|
infoIconUri,
|
||||||
@ -502,7 +501,6 @@ GenericDisplay.prototype = {
|
|||||||
Mainloop.idle_add(Lang.bind(this,
|
Mainloop.idle_add(Lang.bind(this,
|
||||||
function() {
|
function() {
|
||||||
let [child, x, y, mask] = Gdk.Screen.get_default().get_root_window().get_pointer();
|
let [child, x, y, mask] = Gdk.Screen.get_default().get_root_window().get_pointer();
|
||||||
let global = Shell.Global.get();
|
|
||||||
let actor = global.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE,
|
let actor = global.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE,
|
||||||
x, y);
|
x, y);
|
||||||
if (actor != null) {
|
if (actor != null) {
|
||||||
|
@ -249,7 +249,6 @@ function Inspector() {
|
|||||||
|
|
||||||
Inspector.prototype = {
|
Inspector.prototype = {
|
||||||
_init: function() {
|
_init: function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
let width = 150;
|
let width = 150;
|
||||||
let eventHandler = new Big.Box({ background_color: LG_BACKGROUND_COLOR,
|
let eventHandler = new Big.Box({ background_color: LG_BACKGROUND_COLOR,
|
||||||
border: 1,
|
border: 1,
|
||||||
@ -274,7 +273,6 @@ Inspector.prototype = {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
eventHandler.connect('button-press-event', Lang.bind(this, function (actor, event) {
|
eventHandler.connect('button-press-event', Lang.bind(this, function (actor, event) {
|
||||||
let global = Shell.Global.get();
|
|
||||||
Clutter.ungrab_pointer(eventHandler);
|
Clutter.ungrab_pointer(eventHandler);
|
||||||
|
|
||||||
let [stageX, stageY] = event.get_coords();
|
let [stageX, stageY] = event.get_coords();
|
||||||
@ -288,7 +286,6 @@ Inspector.prototype = {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
eventHandler.connect('motion-event', Lang.bind(this, function (actor, event) {
|
eventHandler.connect('motion-event', Lang.bind(this, function (actor, event) {
|
||||||
let global = Shell.Global.get();
|
|
||||||
let [stageX, stageY] = event.get_coords();
|
let [stageX, stageY] = event.get_coords();
|
||||||
let target = global.stage.get_actor_at_pos(Clutter.PickMode.ALL,
|
let target = global.stage.get_actor_at_pos(Clutter.PickMode.ALL,
|
||||||
stageX,
|
stageX,
|
||||||
@ -312,8 +309,6 @@ function LookingGlass() {
|
|||||||
|
|
||||||
LookingGlass.prototype = {
|
LookingGlass.prototype = {
|
||||||
_init : function() {
|
_init : function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
this._idleHistorySaveId = 0;
|
this._idleHistorySaveId = 0;
|
||||||
let historyPath = global.configdir + "/lookingglass-history.txt";
|
let historyPath = global.configdir + "/lookingglass-history.txt";
|
||||||
this._historyFile = Gio.file_new_for_path(historyPath);
|
this._historyFile = Gio.file_new_for_path(historyPath);
|
||||||
@ -558,7 +553,6 @@ LookingGlass.prototype = {
|
|||||||
if (!Main.beginModal())
|
if (!Main.beginModal())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let global = Shell.Global.get();
|
|
||||||
global.stage.set_key_focus(this._entry);
|
global.stage.set_key_focus(this._entry);
|
||||||
|
|
||||||
Tweener.addTween(this.actor, { time: 0.5,
|
Tweener.addTween(this.actor, { time: 0.5,
|
||||||
|
@ -33,7 +33,10 @@ let recorder = null;
|
|||||||
let inModal = false;
|
let inModal = false;
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
let global = Shell.Global.get();
|
// Add a binding for "global" in the global JS namespace; (gjs
|
||||||
|
// keeps the web browser convention of having that namespace be
|
||||||
|
// called "window".)
|
||||||
|
window.global = Shell.Global.get();
|
||||||
|
|
||||||
Gio.DesktopAppInfo.set_desktop_env("GNOME");
|
Gio.DesktopAppInfo.set_desktop_env("GNOME");
|
||||||
|
|
||||||
@ -102,7 +105,6 @@ function start() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _relayout() {
|
function _relayout() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
panel.actor.set_size(global.screen_width, Panel.PANEL_HEIGHT);
|
panel.actor.set_size(global.screen_width, Panel.PANEL_HEIGHT);
|
||||||
overview.relayout();
|
overview.relayout();
|
||||||
}
|
}
|
||||||
@ -114,8 +116,6 @@ function _relayout() {
|
|||||||
// is called.)
|
// is called.)
|
||||||
function _removeUnusedWorkspaces() {
|
function _removeUnusedWorkspaces() {
|
||||||
|
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
let windows = global.get_windows();
|
let windows = global.get_windows();
|
||||||
let maxWorkspace = 0;
|
let maxWorkspace = 0;
|
||||||
for (let i = 0; i < windows.length; i++) {
|
for (let i = 0; i < windows.length; i++) {
|
||||||
@ -187,7 +187,6 @@ function _globalKeyPressHandler(actor, event) {
|
|||||||
// the stage. Returns true if we successfully grabbed the keyboard and
|
// the stage. Returns true if we successfully grabbed the keyboard and
|
||||||
// went modal, false otherwise
|
// went modal, false otherwise
|
||||||
function beginModal() {
|
function beginModal() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
let timestamp = global.screen.get_display().get_current_time();
|
let timestamp = global.screen.get_display().get_current_time();
|
||||||
|
|
||||||
if (!global.begin_modal(timestamp))
|
if (!global.begin_modal(timestamp))
|
||||||
@ -200,7 +199,6 @@ function beginModal() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function endModal() {
|
function endModal() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
let timestamp = global.screen.get_display().get_current_time();
|
let timestamp = global.screen.get_display().get_current_time();
|
||||||
|
|
||||||
global.end_modal(timestamp);
|
global.end_modal(timestamp);
|
||||||
@ -217,7 +215,6 @@ function createLookingGlass() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createAppLaunchContext() {
|
function createAppLaunchContext() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
let screen = global.screen;
|
let screen = global.screen;
|
||||||
let display = screen.get_display();
|
let display = screen.get_display();
|
||||||
|
|
||||||
|
@ -82,8 +82,6 @@ Overview.prototype = {
|
|||||||
_init : function() {
|
_init : function() {
|
||||||
let me = this;
|
let me = this;
|
||||||
|
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
this._group = new Clutter.Group();
|
this._group = new Clutter.Group();
|
||||||
this._group._delegate = this;
|
this._group._delegate = this;
|
||||||
|
|
||||||
@ -131,8 +129,6 @@ Overview.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_recalculateGridSizes: function () {
|
_recalculateGridSizes: function () {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
wideScreen = (global.screen_width/global.screen_height > WIDE_SCREEN_CUT_OFF_RATIO);
|
wideScreen = (global.screen_width/global.screen_height > WIDE_SCREEN_CUT_OFF_RATIO);
|
||||||
|
|
||||||
// We divide the screen into an imaginary grid which helps us determine the layout of
|
// We divide the screen into an imaginary grid which helps us determine the layout of
|
||||||
@ -147,8 +143,6 @@ Overview.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
relayout: function () {
|
relayout: function () {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
let screenHeight = global.screen_height;
|
let screenHeight = global.screen_height;
|
||||||
let screenWidth = global.screen_width;
|
let screenWidth = global.screen_width;
|
||||||
|
|
||||||
@ -277,8 +271,6 @@ Overview.prototype = {
|
|||||||
this.visible = true;
|
this.visible = true;
|
||||||
this.animationInProgress = true;
|
this.animationInProgress = true;
|
||||||
|
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
this._dash.show();
|
this._dash.show();
|
||||||
|
|
||||||
/* TODO: make this stuff dynamic */
|
/* TODO: make this stuff dynamic */
|
||||||
@ -334,8 +326,6 @@ Overview.prototype = {
|
|||||||
if (!this.visible || this._hideInProgress)
|
if (!this.visible || this._hideInProgress)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
this.animationInProgress = true;
|
this.animationInProgress = true;
|
||||||
this._hideInProgress = true;
|
this._hideInProgress = true;
|
||||||
if (this._activeDisplayPane != null)
|
if (this._activeDisplayPane != null)
|
||||||
@ -425,8 +415,6 @@ Overview.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_hideDone: function() {
|
_hideDone: function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
global.window_group.show();
|
global.window_group.show();
|
||||||
|
|
||||||
this._workspaces.destroy();
|
this._workspaces.destroy();
|
||||||
|
@ -168,8 +168,6 @@ function Panel() {
|
|||||||
|
|
||||||
Panel.prototype = {
|
Panel.prototype = {
|
||||||
_init : function() {
|
_init : function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
|
|
||||||
this.actor = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL
|
this.actor = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL
|
||||||
});
|
});
|
||||||
|
@ -32,8 +32,6 @@ function RunDialog() {
|
|||||||
|
|
||||||
RunDialog.prototype = {
|
RunDialog.prototype = {
|
||||||
_init : function() {
|
_init : function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
this._isOpen = false;
|
this._isOpen = false;
|
||||||
|
|
||||||
this._internalCommands = { 'lg':
|
this._internalCommands = { 'lg':
|
||||||
@ -43,13 +41,11 @@ RunDialog.prototype = {
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
'r': Lang.bind(this, function() {
|
'r': Lang.bind(this, function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
global.reexec_self();
|
global.reexec_self();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// Developer brain backwards compatibility
|
// Developer brain backwards compatibility
|
||||||
'restart': Lang.bind(this, function() {
|
'restart': Lang.bind(this, function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
global.reexec_self();
|
global.reexec_self();
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
@ -181,7 +177,6 @@ RunDialog.prototype = {
|
|||||||
this._isOpen = true;
|
this._isOpen = true;
|
||||||
this._group.show();
|
this._group.show();
|
||||||
|
|
||||||
let global = Shell.Global.get();
|
|
||||||
global.stage.set_key_focus(this._entry);
|
global.stage.set_key_focus(this._entry);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -34,8 +34,6 @@ function Sidebar() {
|
|||||||
|
|
||||||
Sidebar.prototype = {
|
Sidebar.prototype = {
|
||||||
_init : function() {
|
_init : function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
// The top-left corner of the sidebar is fixed at:
|
// The top-left corner of the sidebar is fixed at:
|
||||||
// x = -WidgetBox.WIDGETBOX_PADDING, y = Panel.PANEL_HEIGHT.
|
// x = -WidgetBox.WIDGETBOX_PADDING, y = Panel.PANEL_HEIGHT.
|
||||||
// (The negative X is so that we don't see the rounded
|
// (The negative X is so that we don't see the rounded
|
||||||
|
@ -163,7 +163,6 @@ ClockWidget.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_updateCairo: function(time) {
|
_updateCairo: function(time) {
|
||||||
let global = Shell.Global.get();
|
|
||||||
Shell.draw_clock(this.collapsedActor,
|
Shell.draw_clock(this.collapsedActor,
|
||||||
time.getHours() % 12,
|
time.getHours() % 12,
|
||||||
time.getMinutes());
|
time.getMinutes());
|
||||||
|
@ -258,7 +258,6 @@ DesktopClone.prototype = {
|
|||||||
this.actor = new Clutter.Clone({ source: window.get_texture(),
|
this.actor = new Clutter.Clone({ source: window.get_texture(),
|
||||||
reactive: true });
|
reactive: true });
|
||||||
} else {
|
} else {
|
||||||
let global = Shell.Global.get();
|
|
||||||
this.actor = new Clutter.Rectangle({ color: global.stage.color,
|
this.actor = new Clutter.Rectangle({ color: global.stage.color,
|
||||||
reactive: true,
|
reactive: true,
|
||||||
width: global.screen_width,
|
width: global.screen_width,
|
||||||
@ -290,7 +289,6 @@ function Workspace(workspaceNum, parentActor) {
|
|||||||
Workspace.prototype = {
|
Workspace.prototype = {
|
||||||
_init : function(workspaceNum, parentActor) {
|
_init : function(workspaceNum, parentActor) {
|
||||||
let me = this;
|
let me = this;
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
this.workspaceNum = workspaceNum;
|
this.workspaceNum = workspaceNum;
|
||||||
this._metaWorkspace = global.screen.get_workspace_by_index(workspaceNum);
|
this._metaWorkspace = global.screen.get_workspace_by_index(workspaceNum);
|
||||||
@ -364,7 +362,6 @@ Workspace.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
updateRemovable : function() {
|
updateRemovable : function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
let removable = (this._windows.length == 1 /* just desktop */ &&
|
let removable = (this._windows.length == 1 /* just desktop */ &&
|
||||||
this.workspaceNum != 0 &&
|
this.workspaceNum != 0 &&
|
||||||
this.workspaceNum == global.screen.n_workspaces - 1);
|
this.workspaceNum == global.screen.n_workspaces - 1);
|
||||||
@ -466,7 +463,6 @@ Workspace.prototype = {
|
|||||||
|
|
||||||
// Mark the workspace selected/not-selected
|
// Mark the workspace selected/not-selected
|
||||||
setSelected : function(selected) {
|
setSelected : function(selected) {
|
||||||
let global = Shell.Global.get();
|
|
||||||
// Don't draw a frame if we only have one workspace
|
// Don't draw a frame if we only have one workspace
|
||||||
if (selected && global.screen.n_workspaces > 1) {
|
if (selected && global.screen.n_workspaces > 1) {
|
||||||
if (this._frame)
|
if (this._frame)
|
||||||
@ -502,8 +498,6 @@ Workspace.prototype = {
|
|||||||
// is true, then the workspace is moving at the same time and we need to take
|
// is true, then the workspace is moving at the same time and we need to take
|
||||||
// that into account
|
// that into account
|
||||||
positionWindows : function(workspaceZooming) {
|
positionWindows : function(workspaceZooming) {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
let totalVisible = 0;
|
let totalVisible = 0;
|
||||||
|
|
||||||
for (let i = 1; i < this._windows.length; i++) {
|
for (let i = 1; i < this._windows.length; i++) {
|
||||||
@ -611,7 +605,6 @@ Workspace.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_windowRemoved : function(metaWorkspace, metaWin) {
|
_windowRemoved : function(metaWorkspace, metaWin) {
|
||||||
let global = Shell.Global.get();
|
|
||||||
let win = metaWin.get_compositor_private();
|
let win = metaWin.get_compositor_private();
|
||||||
|
|
||||||
// find the position of the window in our list
|
// find the position of the window in our list
|
||||||
@ -763,8 +756,6 @@ Workspace.prototype = {
|
|||||||
|
|
||||||
// Animates the addition of a new (empty) workspace
|
// Animates the addition of a new (empty) workspace
|
||||||
slideIn : function(oldScale) {
|
slideIn : function(oldScale) {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
if (this.gridCol > this.gridRow) {
|
if (this.gridCol > this.gridRow) {
|
||||||
this.actor.set_position(global.screen_width, this.gridY);
|
this.actor.set_position(global.screen_width, this.gridY);
|
||||||
this.actor.set_scale(oldScale, oldScale);
|
this.actor.set_scale(oldScale, oldScale);
|
||||||
@ -786,7 +777,6 @@ Workspace.prototype = {
|
|||||||
|
|
||||||
// Animates the removal of a workspace
|
// Animates the removal of a workspace
|
||||||
slideOut : function(onComplete) {
|
slideOut : function(onComplete) {
|
||||||
let global = Shell.Global.get();
|
|
||||||
let destX = this.actor.x, destY = this.actor.y;
|
let destX = this.actor.x, destY = this.actor.y;
|
||||||
|
|
||||||
this._hideAllIcons();
|
this._hideAllIcons();
|
||||||
@ -813,8 +803,6 @@ Workspace.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
destroy : function() {
|
destroy : function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
Tweener.removeTweens(this.actor);
|
Tweener.removeTweens(this.actor);
|
||||||
this.actor.destroy();
|
this.actor.destroy();
|
||||||
this.actor = null;
|
this.actor = null;
|
||||||
@ -911,7 +899,6 @@ Workspace.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_removeSelf : function(actor, event) {
|
_removeSelf : function(actor, event) {
|
||||||
let global = Shell.Global.get();
|
|
||||||
let screen = global.screen;
|
let screen = global.screen;
|
||||||
let workspace = screen.get_workspace_by_index(this.workspaceNum);
|
let workspace = screen.get_workspace_by_index(this.workspaceNum);
|
||||||
|
|
||||||
@ -921,8 +908,6 @@ Workspace.prototype = {
|
|||||||
|
|
||||||
// Draggable target interface
|
// Draggable target interface
|
||||||
acceptDrop : function(source, actor, x, y, time) {
|
acceptDrop : function(source, actor, x, y, time) {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
if (source instanceof WindowClone) {
|
if (source instanceof WindowClone) {
|
||||||
let win = source.realWindow;
|
let win = source.realWindow;
|
||||||
if (this._isMyWindow(win))
|
if (this._isMyWindow(win))
|
||||||
@ -959,8 +944,6 @@ function Workspaces(width, height, x, y, addButtonSize, addButtonX, addButtonY)
|
|||||||
|
|
||||||
Workspaces.prototype = {
|
Workspaces.prototype = {
|
||||||
_init : function(width, height, x, y, addButtonSize, addButtonX, addButtonY) {
|
_init : function(width, height, x, y, addButtonSize, addButtonX, addButtonY) {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
this.actor = new Clutter.Group();
|
this.actor = new Clutter.Group();
|
||||||
|
|
||||||
this._appIdFilter = null;
|
this._appIdFilter = null;
|
||||||
@ -1074,7 +1057,6 @@ Workspaces.prototype = {
|
|||||||
|
|
||||||
// Should only be called from active Overview context
|
// Should only be called from active Overview context
|
||||||
activateWindowFromOverview: function (metaWindow, time) {
|
activateWindowFromOverview: function (metaWindow, time) {
|
||||||
let global = Shell.Global.get();
|
|
||||||
let activeWorkspaceNum = global.screen.get_active_workspace_index();
|
let activeWorkspaceNum = global.screen.get_active_workspace_index();
|
||||||
let windowWorkspaceNum = metaWindow.get_workspace().index();
|
let windowWorkspaceNum = metaWindow.get_workspace().index();
|
||||||
|
|
||||||
@ -1090,7 +1072,6 @@ Workspaces.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
hide : function() {
|
hide : function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
let activeWorkspaceIndex = global.screen.get_active_workspace_index();
|
let activeWorkspaceIndex = global.screen.get_active_workspace_index();
|
||||||
let activeWorkspace = this._workspaces[activeWorkspaceIndex];
|
let activeWorkspace = this._workspaces[activeWorkspaceIndex];
|
||||||
|
|
||||||
@ -1102,8 +1083,6 @@ Workspaces.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
destroy : function() {
|
destroy : function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
for (let w = 0; w < this._workspaces.length; w++)
|
for (let w = 0; w < this._workspaces.length; w++)
|
||||||
this._workspaces[w].destroy();
|
this._workspaces[w].destroy();
|
||||||
this._workspaces = [];
|
this._workspaces = [];
|
||||||
@ -1121,7 +1100,6 @@ Workspaces.prototype = {
|
|||||||
|
|
||||||
// Get the grid position of the active workspace.
|
// Get the grid position of the active workspace.
|
||||||
getActiveWorkspacePosition : function() {
|
getActiveWorkspacePosition : function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
let activeWorkspaceIndex = global.screen.get_active_workspace_index();
|
let activeWorkspaceIndex = global.screen.get_active_workspace_index();
|
||||||
let activeWorkspace = this._workspaces[activeWorkspaceIndex];
|
let activeWorkspace = this._workspaces[activeWorkspaceIndex];
|
||||||
|
|
||||||
@ -1176,8 +1154,6 @@ Workspaces.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_workspacesChanged : function() {
|
_workspacesChanged : function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
let oldNumWorkspaces = this._workspaces.length;
|
let oldNumWorkspaces = this._workspaces.length;
|
||||||
let newNumWorkspaces = global.screen.n_workspaces;
|
let newNumWorkspaces = global.screen.n_workspaces;
|
||||||
|
|
||||||
@ -1262,8 +1238,6 @@ Workspaces.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_appendNewWorkspace : function() {
|
_appendNewWorkspace : function() {
|
||||||
let global = Shell.Global.get();
|
|
||||||
|
|
||||||
global.screen.append_new_workspace(false, global.screen.get_display().get_current_time());
|
global.screen.append_new_workspace(false, global.screen.get_display().get_current_time());
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1286,7 +1260,6 @@ AddWorkspaceButton.prototype = {
|
|||||||
height: buttonSize,
|
height: buttonSize,
|
||||||
reactive: true });
|
reactive: true });
|
||||||
this._acceptDropCallback = acceptDropCallback;
|
this._acceptDropCallback = acceptDropCallback;
|
||||||
let global = Shell.Global.get();
|
|
||||||
this.actor._delegate = this;
|
this.actor._delegate = this;
|
||||||
this.actor.set_from_file(global.imagedir + 'add-workspace.svg');
|
this.actor.set_from_file(global.imagedir + 'add-workspace.svg');
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user