Update upstream source from tag 'upstream/52'
Update to upstream version '52'
with Debian dir 4a62a5cc0e0f952af1f98bf77b4266867009232c
Raphaƫl Hertzog
4 years ago
281 | 281 | |
282 | 282 | Change Log: |
283 | 283 | ----------- |
284 | **Version 52 (Oct 1, 2019)** | |
285 | - Support for Gnome 3.34 | |
286 | ||
284 | 287 | **Version 51 (Jul 25, 2019)** |
285 | 288 | - Bug fixes |
286 | 289 |
59 | 59 | cat extension.js | grep -v '_DEBUG_' > "$temp_dir/extension.js" |
60 | 60 | cat intellihide.js | grep -v '_DEBUG_' > "$temp_dir/intellihide.js" |
61 | 61 | cat myPressureBarrier.js | grep -v '_DEBUG_' > "$temp_dir/myPressureBarrier.js" |
62 | cat myWorkspaceSwitcherPopup.js | grep -v '_DEBUG_' > "$temp_dir/myWorkspaceSwitcherPopup.js" | |
62 | cat myWorkspaceSwitcher.js | grep -v '_DEBUG_' > "$temp_dir/myWorkspaceSwitcher.js" | |
63 | 63 | cat myWorkspaceThumbnail.js | grep -v '_DEBUG_' > "$temp_dir/myWorkspaceThumbnail.js" |
64 | 64 | cat placeDisplay.js | grep -v '_DEBUG_' > "$temp_dir/placeDisplay.js" |
65 | 65 | cat prefs.js | grep -v '_DEBUG_' > "$temp_dir/prefs.js" |
26 | 26 | const Main = imports.ui.main; |
27 | 27 | const WorkspacesView = imports.ui.workspacesView; |
28 | 28 | const WorkspaceThumbnail = imports.ui.workspaceThumbnail; |
29 | const Tweener = imports.ui.tweener; | |
30 | 29 | const WorkspaceSwitcherPopup = imports.ui.workspaceSwitcherPopup; |
31 | 30 | const Overview = imports.ui.overview; |
32 | 31 | const OverviewControls = imports.ui.overviewControls; |
33 | 32 | const Layout = imports.ui.layout; |
34 | 33 | const MessageTray = imports.ui.messageTray; |
35 | 34 | |
36 | const ExtensionSystem = imports.ui.extensionSystem; | |
37 | 35 | const ExtensionUtils = imports.misc.extensionUtils; |
38 | 36 | const Config = imports.misc.config; |
39 | 37 | const Me = ExtensionUtils.getCurrentExtension(); |
41 | 39 | const Convenience = Me.imports.convenience; |
42 | 40 | const MyWorkspaceThumbnail = Me.imports.myWorkspaceThumbnail; |
43 | 41 | const ShortcutsPanel = Me.imports.shortcutsPanel; |
44 | const MyWorkspaceSwitcherPopup = Me.imports.myWorkspaceSwitcherPopup; | |
42 | const MyWorkspaceSwitcher = Me.imports.myWorkspaceSwitcher; | |
45 | 43 | const MyPressureBarrier = Me.imports.myPressureBarrier; |
46 | 44 | |
47 | 45 | const DashToDock_UUID = "dash-to-dock@micxgx.gmail.com"; |
104 | 102 | return desc; |
105 | 103 | } |
106 | 104 | |
107 | var MyThumbnailsSlider = GObject.registerClass( | |
108 | class WorkspacesToDock_MyThumbnailsSlider extends St.Widget { | |
109 | _init(params) { | |
110 | this._settings = Convenience.getSettings('org.gnome.shell.extensions.workspaces-to-dock'); | |
111 | let initialTriggerWidth = 1; | |
112 | ||
113 | // Default local params | |
114 | let localDefaults = { | |
115 | side: St.Side.LEFT, | |
116 | initialSlideValue: 1, | |
117 | initialSlideoutSize: initialTriggerWidth | |
118 | } | |
119 | ||
120 | let localParams = Params.parse(params, localDefaults, true); | |
121 | ||
122 | if (params){ | |
123 | // Remove local params before passing the params to the parent | |
124 | // constructor to avoid errors. | |
125 | let prop; | |
126 | for (prop in localDefaults) { | |
127 | if ((prop in params)) | |
128 | delete params[prop]; | |
129 | } | |
130 | } | |
105 | var MyThumbnailsSlider = GObject.registerClass({ | |
106 | Properties: { | |
107 | 'side': GObject.ParamSpec.enum( | |
108 | 'side', 'side', 'side', | |
109 | GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY, | |
110 | St.Side, St.Side.RIGHT), | |
111 | 'slidex': GObject.ParamSpec.double( | |
112 | 'slidex', 'slidex', 'slidex', | |
113 | GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT, | |
114 | 0, 1, 1), | |
115 | 'slideout-size': GObject.ParamSpec.double( | |
116 | 'slideout-size', 'slideout-size', 'slideout-size', | |
117 | GObject.ParamFlags.READWRITE, | |
118 | 0, Infinity, 1), | |
119 | 'partial-slideout-size': GObject.ParamSpec.double( | |
120 | 'partial-slideout-size', 'partial-slideout-size', 'partial-slideout-size', | |
121 | GObject.ParamFlags.READWRITE, | |
122 | 0, Infinity, DOCK_EDGE_VISIBLE_OVERVIEW_WIDTH + 1) | |
123 | } | |
124 | }, class WorkspacesToDock_MyThumbnailsSlider extends St.Widget { | |
125 | _init(params = {}) { | |
126 | // slide parameter: 1 = visible, 0 = hidden. | |
127 | this._side = params.side; | |
128 | this._slidex = params.slidex; | |
129 | this._slideoutSize = 1; | |
130 | this._partialSlideoutSize = DOCK_EDGE_VISIBLE_OVERVIEW_WIDTH + 1; | |
131 | 131 | |
132 | 132 | super._init(params); |
133 | 133 | this._child = null; |
134 | ||
135 | // slide parameter: 1 = visible, 0 = hidden. | |
136 | this._slidex = localParams.initialSlideValue; | |
137 | this._side = localParams.side; | |
138 | this._slideoutSize = localParams.initialSlideoutSize; // minimum size when slid out | |
139 | this._partialSlideoutSize = initialTriggerWidth + DOCK_EDGE_VISIBLE_OVERVIEW_WIDTH; | |
140 | 134 | } |
141 | 135 | |
142 | 136 | vfunc_allocate(box, flags) { |
222 | 216 | } |
223 | 217 | |
224 | 218 | set slidex(value) { |
219 | if (this._slidex == value) | |
220 | return; | |
221 | ||
225 | 222 | this._slidex = value; |
226 | this._child.queue_relayout(); | |
223 | this.notify('slidex'); | |
224 | if (this._child) | |
225 | this._child.queue_relayout(); | |
227 | 226 | } |
228 | 227 | |
229 | 228 | get slidex() { |
231 | 230 | } |
232 | 231 | |
233 | 232 | set slideoutSize(value) { |
233 | if (this._slideoutSize == value) | |
234 | return; | |
235 | ||
234 | 236 | this._slideoutSize = value; |
237 | this.notify('slideout-size'); | |
235 | 238 | } |
236 | 239 | |
237 | 240 | get slideoutSize() { |
239 | 242 | } |
240 | 243 | |
241 | 244 | set partialSlideoutSize(value) { |
245 | if (this._partialSlideoutSize == value) | |
246 | return; | |
247 | ||
242 | 248 | this._partialSlideoutSize = value; |
249 | this.notify('partial-slideout-size'); | |
243 | 250 | } |
244 | 251 | |
245 | 252 | get partialSlideoutSize() { |
269 | 276 | |
270 | 277 | // Set position of dock |
271 | 278 | this._position = getPosition(this._settings); |
279 | if (_DEBUG_) global.log("dockedWorkspaces: init POSITION is " + this._position); | |
272 | 280 | this._isHorizontal = (this._position == St.Side.TOP || |
273 | 281 | this._position == St.Side.BOTTOM); |
274 | 282 | |
310 | 318 | this._shortcutsPanel.connect("update-favorite-apps", this._onShortcutsPanelUpdated.bind(this)); |
311 | 319 | this._shortcutsPanel.connect("update-running-apps", this._onShortcutsPanelUpdated.bind(this)); |
312 | 320 | |
313 | // Create custom workspace switcher popup | |
321 | // Create custom workspace switcher | |
314 | 322 | this._workspaceSwitcher = null; |
315 | 323 | if (this._isHorizontal && this._settings.get_boolean('horizontal-workspace-switching')) |
316 | this._workspaceSwitcher = new MyWorkspaceSwitcherPopup.WorkspaceSwitcher(); | |
324 | this._workspaceSwitcher = new MyWorkspaceSwitcher.WorkspaceSwitcher(); | |
317 | 325 | |
318 | 326 | // Create position styles for dock container |
319 | 327 | let positionStyleClass = ['top', 'right', 'bottom', 'left']; |
426 | 434 | if (shortcutsPanelOrientation == 1) { |
427 | 435 | if (this._centerContainer && this._centerPanelsIndependently) { |
428 | 436 | this._panelsContainer.add(this._shortcutsPanel.actor,{x_fill: false, y_fill: false, x_align: St.Align.MIDDLE, y_align: St.Align.MIDDLE}); |
429 | this._panelsContainer.add(this._thumbnailsBox.actor,{x_fill: false, y_fill: false, x_align: St.Align.MIDDLE, y_align: St.Align.MIDDLE}); | |
437 | this._panelsContainer.add(this._thumbnailsBox,{x_fill: false, y_fill: false, x_align: St.Align.MIDDLE, y_align: St.Align.MIDDLE}); | |
430 | 438 | } else { |
431 | 439 | this._panelsContainer.add_actor(this._shortcutsPanel.actor); |
432 | this._panelsContainer.add_actor(this._thumbnailsBox.actor); | |
440 | this._panelsContainer.add_actor(this._thumbnailsBox); | |
433 | 441 | } |
434 | 442 | } else { |
435 | 443 | if (this._centerContainer && this._centerPanelsIndependently) { |
436 | this._panelsContainer.add(this._thumbnailsBox.actor,{x_fill: false, y_fill: false, x_align: St.Align.MIDDLE, y_align: St.Align.MIDDLE}); | |
444 | this._panelsContainer.add(this._thumbnailsBox,{x_fill: false, y_fill: false, x_align: St.Align.MIDDLE, y_align: St.Align.MIDDLE}); | |
437 | 445 | this._panelsContainer.add(this._shortcutsPanel.actor,{x_fill: false, y_fill: false, x_align: St.Align.MIDDLE, y_align: St.Align.MIDDLE}); |
438 | 446 | } else { |
439 | this._panelsContainer.add_actor(this._thumbnailsBox.actor); | |
447 | this._panelsContainer.add_actor(this._thumbnailsBox); | |
440 | 448 | this._panelsContainer.add_actor(this._shortcutsPanel.actor); |
441 | 449 | } |
442 | 450 | } |
443 | 451 | |
444 | 452 | // Create the sliding actor whose allocation is to be tracked for input regions |
445 | let slideoutSize = this._settings.get_boolean('dock-edge-visible') ? this._triggerWidth + DOCK_EDGE_VISIBLE_WIDTH : this._triggerWidth; | |
446 | this._slider = new MyThumbnailsSlider({side: this._position, initialSlideoutSize: slideoutSize}); | |
453 | //let slideoutSize = this._settings.get_boolean('dock-edge-visible') ? this._triggerWidth + DOCK_EDGE_VISIBLE_WIDTH : this._triggerWidth; | |
454 | //this._slider = new MyThumbnailsSlider({side: this._position, slideout-size: slideoutSize}); | |
455 | this._slider = new MyThumbnailsSlider({side: this._position}); | |
447 | 456 | |
448 | 457 | // Create the dock main actor |
449 | 458 | this.actor = new St.Bin({ name: 'workspacestodockMainActor', |
463 | 472 | let workspaceManager = global.workspace_manager; |
464 | 473 | this._signalHandler.push( |
465 | 474 | [ |
466 | this._thumbnailsBox.actor, | |
475 | this._thumbnailsBox, | |
467 | 476 | 'notify::width', |
468 | 477 | this._thumbnailsBoxResized.bind(this) |
469 | 478 | ], |
470 | 479 | [ |
471 | this._thumbnailsBox.actor, | |
480 | this._thumbnailsBox, | |
472 | 481 | 'notify::height', |
473 | 482 | this._thumbnailsBoxResized.bind(this) |
474 | 483 | ], |
488 | 497 | this._onIconsChanged.bind(this) |
489 | 498 | ], |
490 | 499 | [ |
491 | ExtensionSystem._signals, | |
500 | Main.extensionManager, | |
492 | 501 | 'extension-state-changed', |
493 | 502 | this._onExtensionSystemStateChanged.bind(this) |
494 | 503 | ], |
521 | 530 | |
522 | 531 | // Connect DashToDock hover signal if the extension is already loaded and enabled |
523 | 532 | this._hoveringDash = false; |
524 | DashToDockExtension = ExtensionUtils.extensions[DashToDock_UUID]; | |
533 | DashToDockExtension = Main.extensionManager.lookup(DashToDock_UUID); | |
525 | 534 | if (DashToDockExtension) { |
526 | if (DashToDockExtension.state == ExtensionSystem.ExtensionState.ENABLED) { | |
535 | if (DashToDockExtension.state == ExtensionUtils.ExtensionState.ENABLED) { | |
527 | 536 | if (_DEBUG_) global.log("dockeWorkspaces: init - DashToDock extension is installed and enabled"); |
528 | 537 | DashToDock = DashToDockExtension.imports.extension; |
529 | 538 | if (DashToDock) { |
753 | 762 | let allocation = this.actor.allocation; |
754 | 763 | let width = allocation.x2 - allocation.x1; |
755 | 764 | let height = allocation.y2 - allocation.y1; |
765 | if (_DEBUG_) global.log("WORKSPACESDISPLAY - ALLOCATION X = "+x+" Y = "+y+" W = "+width+" H = "+height); | |
756 | 766 | |
757 | 767 | let spacing = Main.overview._controls.actor.get_theme_node().get_length('spacing'); |
758 | 768 | let monitors = Main.layoutManager.monitors; |
778 | 788 | |
779 | 789 | // Iterate through monitors |
780 | 790 | for (let i = 0; i < monitors.length; i++) { |
791 | if (_DEBUG_) global.log("WORKSPACESDISPLAY - MONITOR = "+i); | |
792 | ||
781 | 793 | let geometry = { x: monitors[i].x, y: monitors[i].y, width: monitors[i].width, height: monitors[i].height }; |
794 | if (_DEBUG_) global.log("WORKSPACESDISPLAY - INIT GEOMETRY.X = "+geometry.x+" Y = "+geometry.y+" W = "+geometry.width+" H = "+geometry.height); | |
782 | 795 | |
783 | 796 | // Adjust index to point to correct dock |
784 | 797 | // Only needed when using DashToDock.dockManager |
937 | 950 | // Adjust y and height for workspacesView geometry for primary monitor (top panel, etc.) |
938 | 951 | if (i == this._primaryIndex) { |
939 | 952 | geometry.y = y; |
940 | geometry.height = height; | |
941 | } | |
953 | if (height > 0) | |
954 | geometry.height = height; | |
955 | } | |
956 | ||
957 | if (_DEBUG_) global.log("WORKSPACESDISPLAY - INTERMEDIATE GEOMETRY.X = "+geometry.x+" Y = "+geometry.y+" W = "+geometry.width+" H = "+geometry.height); | |
942 | 958 | |
943 | 959 | // What if dash and thumbnailsBox are not on the primary monitor? |
944 | 960 | let controlsHeight = dashHeight + thumbnailsHeight; |
986 | 1002 | } |
987 | 1003 | } |
988 | 1004 | geometry.height -= controlsHeight; |
989 | ||
990 | ||
991 | if (_DEBUG_) global.log("MONITOR = "+i); | |
1005 | if (_DEBUG_) global.log("WORKSPACESDISPLAY - FINAL GEOMETRY.X = "+geometry.x+" Y = "+geometry.y+" W = "+geometry.width+" H = "+geometry.height); | |
1006 | ||
992 | 1007 | this._workspacesViews[i].setMyActualGeometry(geometry); |
993 | 1008 | } |
994 | 1009 | }; |
1408 | 1423 | } |
1409 | 1424 | } |
1410 | 1425 | |
1426 | if (this._dockState == DockState.SHOWING) { | |
1427 | // Prevent dock from getting stuck animated in when mouse is no longer hovering | |
1428 | if (this._checkHoverStatusId > 0) { | |
1429 | Mainloop.source_remove(this._checkHoverStatusId); | |
1430 | this._checkHoverStatusId = 0; | |
1431 | } | |
1432 | this._checkHoverStatusId = Mainloop.timeout_add(100, this._checkHoverStatus.bind(this)); | |
1433 | return; | |
1434 | } | |
1435 | ||
1411 | 1436 | if (this._settings.get_boolean('require-click-to-show')) { |
1412 | 1437 | // check if metaWin is maximized |
1413 | 1438 | let workspaceManager = global.workspace_manager; |
1617 | 1642 | |
1618 | 1643 | _onDashToDockBoxDestroy() { |
1619 | 1644 | if (_DEBUG_) global.log("dockedWorkspaces: _onDashToDockBoxDestroy for DASHTODOCK"); |
1620 | this._signalHandler.disconnectWithLabel('DashToDockBoxHoverSignal'); | |
1645 | this._hoveringDash = false; | |
1646 | this._disconnectDashToDockSignals(); | |
1647 | ||
1648 | // Restore dock if still enabled | |
1649 | if (this._checkDashToDockStatusId > 0) { | |
1650 | Mainloop.source_remove(this._checkDashToDockStatusId); | |
1651 | this._checkDashToDockStatusId = 0; | |
1652 | } | |
1653 | this._checkDashToDockStatusId = Mainloop.timeout_add(500, this._checkDashToDockStatus.bind(this)); | |
1654 | } | |
1655 | ||
1656 | _checkDashToDockStatus() { | |
1657 | if (DashToDock) | |
1658 | this._connectDashToDockSignals(); | |
1659 | ||
1660 | this._checkDashToDockStatusId = 0; | |
1621 | 1661 | } |
1622 | 1662 | |
1623 | 1663 | _disconnectDashToDockSignals() { |
1669 | 1709 | ] |
1670 | 1710 | ); |
1671 | 1711 | } |
1672 | } else { | |
1673 | this._signalHandler.pushWithLabel( | |
1674 | 'DashToDockHoverSignal', | |
1675 | [ | |
1676 | DashToDock.dock._box, | |
1677 | 'notify::hover', | |
1678 | this._onDashToDockHoverChanged.bind(this) | |
1679 | ], | |
1680 | [ | |
1681 | DashToDock.dock._box, | |
1682 | 'leave-event', | |
1683 | this._onDashToDockLeave.bind(this) | |
1684 | ], | |
1685 | [ | |
1686 | DashToDock.dock, | |
1687 | 'showing', | |
1688 | this._onDashToDockShowing.bind(this) | |
1689 | ], | |
1690 | [ | |
1691 | DashToDock.dock, | |
1692 | 'hiding', | |
1693 | this._onDashToDockHiding.bind(this) | |
1694 | ] | |
1695 | ); | |
1696 | 1712 | } |
1697 | 1713 | } |
1698 | 1714 | } |
1703 | 1719 | if (extension.uuid == DashToDock_UUID) { |
1704 | 1720 | if (_DEBUG_) global.log("dockedWorkspaces: _onExtensionSystemStateChanged for "+extension.uuid+" state= "+extension.state); |
1705 | 1721 | DashToDockExtension = extension; |
1706 | if (DashToDockExtension.state == ExtensionSystem.ExtensionState.ENABLED) { | |
1722 | if (DashToDockExtension.state == ExtensionUtils.ExtensionState.ENABLED) { | |
1707 | 1723 | DashToDock = DashToDockExtension.imports.extension; |
1708 | 1724 | if (DashToDock) { |
1709 | 1725 | DashToDockExtension.hasDockPositionKey = false; |
1717 | 1733 | } |
1718 | 1734 | this._connectDashToDockSignals(); |
1719 | 1735 | } |
1720 | } else if (extension.state == ExtensionSystem.ExtensionState.DISABLED || extension.state == ExtensionSystem.ExtensionState.UNINSTALLED) { | |
1736 | } else if (extension.state == ExtensionUtils.ExtensionState.DISABLED || extension.state == ExtensionUtils.ExtensionState.UNINSTALLED) { | |
1721 | 1737 | DashToDock = null; |
1722 | 1738 | this._hoveringDash = false; |
1723 | 1739 | this._disconnectDashToDockSignals(); |
1787 | 1803 | let ws = activeWs.get_neighbor(direction); |
1788 | 1804 | |
1789 | 1805 | if (Main.wm._workspaceSwitcherPopup == null) { |
1790 | if (this._isHorizontal && this._settings.get_boolean('horizontal-workspace-switching')) { | |
1791 | Main.wm._workspaceSwitcherPopup = new MyWorkspaceSwitcherPopup.MyWorkspaceSwitcherPopup(); | |
1792 | } else { | |
1793 | Main.wm._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup(); | |
1794 | } | |
1806 | Main.wm._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup(); | |
1795 | 1807 | } |
1796 | 1808 | |
1797 | 1809 | // Set the workspaceSwitcherPopup actor to non reactive, |
1798 | 1810 | // to prevent it from grabbing focus away from the dock |
1799 | Main.wm._workspaceSwitcherPopup.actor.reactive = false; | |
1811 | Main.wm._workspaceSwitcherPopup.reactive = false; | |
1800 | 1812 | Main.wm._workspaceSwitcherPopup.connect('destroy', function() { |
1801 | 1813 | Main.wm._workspaceSwitcherPopup = null; |
1802 | 1814 | }); |
1915 | 1927 | this._dockState = DockState.SHOWING; |
1916 | 1928 | } |
1917 | 1929 | |
1918 | Tweener.addTween(this._slider, { | |
1919 | slidex: sliderVariable, | |
1920 | time: time, | |
1921 | delay: delay, | |
1922 | transition: 'easeOutQuad', | |
1930 | if (_DEBUG_) global.log("... animateIN: BEGIN SLIDING. Set dockstate = "+getDockStateDesc(this._dockState)); | |
1931 | this._slider.ease_property('slidex', sliderVariable, { | |
1932 | duration: time * 1000, | |
1933 | delay: delay * 1000, | |
1934 | mode: Clutter.AnimationMode.EASE_OUT_QUAD, | |
1923 | 1935 | onComplete: () => { |
1924 | 1936 | if (_DEBUG_) global.log("dockedWorkspaces: _animateIN onComplete"); |
1925 | 1937 | if (!force && !fixedPosition) { |
1999 | 2011 | } |
2000 | 2012 | } |
2001 | 2013 | |
2002 | Tweener.addTween(this._slider, { | |
2003 | slidex: sliderVariable, | |
2004 | time: time, | |
2005 | delay: delay, | |
2006 | transition: 'easeOutQuad', | |
2014 | this._slider.ease_property('slidex', sliderVariable, { | |
2015 | duration: time * 1000, | |
2016 | delay: delay * 1000, | |
2017 | mode: Clutter.AnimationMode.EASE_OUT_QUAD, | |
2007 | 2018 | onComplete: () => { |
2008 | 2019 | if (_DEBUG_) global.log("dockedWorkspaces: _animateOUT onComplete"); |
2009 | 2020 | this._dockState = DockState.HIDDEN; |
2015 | 2026 | // autohide function to remove show-hide animations |
2016 | 2027 | _removeAnimations() { |
2017 | 2028 | if (_DEBUG_) global.log("dockedWorkspaces: _removeAnimations"); |
2018 | Tweener.removeTweens(this._slider); | |
2029 | this._slider.remove_all_transitions(); | |
2019 | 2030 | } |
2020 | 2031 | |
2021 | 2032 | // autohide function to fade out opaque background |
2022 | 2033 | _fadeOutBackground(time, delay) { |
2023 | 2034 | if (_DEBUG_) global.log("dockedWorkspaces: _fadeOutBackground"); |
2024 | 2035 | // CSS time is in ms |
2025 | this._thumbnailsBox.actor.set_style('transition-duration:' + time*1000 + ';' + | |
2036 | this._thumbnailsBox.set_style('transition-duration:' + time*1000 + ';' + | |
2026 | 2037 | 'transition-delay:' + delay*1000 + ';' + |
2027 | 2038 | 'background-color: rgba(0,0,0,0);' + |
2028 | 2039 | 'border-color:' + this._defaultBorder); |
2042 | 2053 | _fadeInBackground(time, delay) { |
2043 | 2054 | if (_DEBUG_) global.log("dockedWorkspaces: _fadeInBackground"); |
2044 | 2055 | // CSS time is in ms |
2045 | this._thumbnailsBox.actor.set_style('transition-duration:' + time*1000 + ';' + | |
2056 | this._thumbnailsBox.set_style('transition-duration:' + time*1000 + ';' + | |
2046 | 2057 | 'transition-delay:' + delay*1000 + ';' + |
2047 | 2058 | 'background-color: rgba(0,0,0,0);' + |
2048 | 2059 | 'border-color:' + this._customBorder); |
2072 | 2083 | // Fixed dock has opacity set to 0 but is still reactive. |
2073 | 2084 | this._dock.reactive = false; |
2074 | 2085 | this._shortcutsPanel.setReactiveState(false); |
2075 | this._thumbnailsBox.actor.reactive = false; | |
2086 | this._thumbnailsBox.reactive = false; | |
2076 | 2087 | for (let i = 0; i < this._thumbnailsBox._thumbnails.length; i++) { |
2077 | 2088 | let thumbnail = this._thumbnailsBox._thumbnails[i]; |
2078 | 2089 | thumbnail.setCaptionReactiveState(false); |
2089 | 2100 | // Return thumbnail windowclones to reactive state |
2090 | 2101 | this._dock.reactive = true; |
2091 | 2102 | this._shortcutsPanel.setReactiveState(true); |
2092 | this._thumbnailsBox.actor.reactive = true; | |
2103 | this._thumbnailsBox.reactive = true; | |
2093 | 2104 | for (let i = 0; i < this._thumbnailsBox._thumbnails.length; i++) { |
2094 | 2105 | let thumbnail = this._thumbnailsBox._thumbnails[i]; |
2095 | 2106 | thumbnail.setCaptionReactiveState(true); |
2106 | 2117 | _getBackgroundColor() { |
2107 | 2118 | if (_DEBUG_) global.log("dockedWorkspaces: _getBackgroundColor"); |
2108 | 2119 | // Remove custom style |
2109 | let oldStyle = this._thumbnailsBox.actor.get_style(); | |
2110 | this._thumbnailsBox.actor.set_style(null); | |
2120 | let oldStyle = this._thumbnailsBox.get_style(); | |
2121 | this._thumbnailsBox.set_style(null); | |
2111 | 2122 | |
2112 | 2123 | // Prevent shell crash if the actor is not on the stage |
2113 | 2124 | // It happens enabling/disabling repeatedly the extension |
2114 | if (!this._thumbnailsBox.actor.get_stage()) | |
2125 | if (!this._thumbnailsBox.get_stage()) | |
2115 | 2126 | return null; |
2116 | 2127 | |
2117 | let themeNode = this._thumbnailsBox.actor.get_theme_node(); | |
2118 | this._thumbnailsBox.actor.set_style(oldStyle); | |
2128 | let themeNode = this._thumbnailsBox.get_theme_node(); | |
2129 | this._thumbnailsBox.set_style(oldStyle); | |
2119 | 2130 | |
2120 | 2131 | // Just in case the theme has different border colors .. |
2121 | 2132 | // We want to find the inside border-color of the dock because it is |
2378 | 2389 | |
2379 | 2390 | } else { |
2380 | 2391 | let controlsTop = 45; |
2381 | y = this._monitor.y + Main.panel.actor.height + controlsTop + Main.overview._searchEntryBin.height; | |
2392 | y = this._monitor.y + Main.panel.height + controlsTop + Main.overview._searchEntryBin.height; | |
2382 | 2393 | height = this._monitor.height - (y + Main.overview._searchEntryBin.height); |
2383 | 2394 | } |
2384 | 2395 | } |
2399 | 2410 | // allows us to control the trigger space for showing/hiding and scrolling |
2400 | 2411 | if (this._isHorizontal) { |
2401 | 2412 | if (this._settings.get_boolean('customize-height')) { |
2402 | let [minThumbnailsBoxWidth, minThumbnailsBoxHeight, natThumbnailsBoxWidth, natThumbnailsBoxHeight] = this._thumbnailsBox.actor.get_preferred_size(); | |
2413 | let [minThumbnailsBoxWidth, minThumbnailsBoxHeight, natThumbnailsBoxWidth, natThumbnailsBoxHeight] = this._thumbnailsBox.get_preferred_size(); | |
2403 | 2414 | let minShortcutsPanelWidth = 0, minShortcutsPanelHeight = 0, natShortcutsPanelWidth = 0, natShortcutsPanelHeight = 0; |
2404 | 2415 | if (this._settings.get_boolean('show-shortcuts-panel')) { |
2405 | 2416 | [minShortcutsPanelWidth, minShortcutsPanelHeight, natShortcutsPanelWidth, natShortcutsPanelHeight] = this._shortcutsPanel.actor.get_preferred_size(); |
2434 | 2445 | } |
2435 | 2446 | } else { |
2436 | 2447 | if (this._settings.get_boolean('customize-height')) { |
2437 | let [minThumbnailsBoxWidth, minThumbnailsBoxHeight, natThumbnailsBoxWidth, natThumbnailsBoxHeight] = this._thumbnailsBox.actor.get_preferred_size(); | |
2448 | let [minThumbnailsBoxWidth, minThumbnailsBoxHeight, natThumbnailsBoxWidth, natThumbnailsBoxHeight] = this._thumbnailsBox.get_preferred_size(); | |
2438 | 2449 | let minShortcutsPanelWidth = 0, minShortcutsPanelHeight = 0, natShortcutsPanelWidth = 0, natShortcutsPanelHeight = 0; |
2439 | 2450 | if (this._settings.get_boolean('show-shortcuts-panel')) { |
2440 | 2451 | [minShortcutsPanelWidth, minShortcutsPanelHeight, natShortcutsPanelWidth, natShortcutsPanelHeight] = this._shortcutsPanel.actor.get_preferred_size(); |
2492 | 2503 | if (this._settings.get_boolean('customize-thumbnail-visible-width')) { |
2493 | 2504 | slidePartialVisibleWidth = this._settings.get_double('thumbnail-visible-width'); |
2494 | 2505 | } else { |
2495 | let themeVisibleWidth = this._thumbnailsBox.actor.get_theme_node().get_length('visible-width'); | |
2506 | let themeVisibleWidth = this._thumbnailsBox.get_theme_node().get_length('visible-width'); | |
2496 | 2507 | if (themeVisibleWidth > 0) |
2497 | 2508 | slidePartialVisibleWidth = themeVisibleWidth; |
2498 | 2509 | } |
1 | 1 | "name": "Workspaces to Dock", |
2 | 2 | "description": "Transform Gnome Shell's overview workspaces into an intelligent dock.", |
3 | 3 | "original-author": "passingthru67@gmail.com", |
4 | "shell-version": ["3.32"], | |
4 | "shell-version": ["3.34"], | |
5 | 5 | "url": "https://github.com/passingthru67/workspaces-to-dock", |
6 | 6 | "uuid": "workspaces-to-dock@passingthru67.gmail.com", |
7 | 7 | "gettext-domain": "workspacestodock", |
8 | "version": 51 | |
8 | "version": 52 | |
9 | 9 | } |
0 | /* ======================================================================================================== | |
1 | * dockedWorkspaces.js - dock object that holds the workspaces thumbnailsBox | |
2 | * -------------------------------------------------------------------------------------------------------- | |
3 | * CREDITS: This code was copied from the Frippery Bottom Panel extension http://frippery.org/extensions/ | |
4 | * and modified to create a workspaces switcher popup. Copyright (C) 2011-2015 R M Yorston. | |
5 | * | |
6 | * Part of this code also comes from gnome-shell-extensions: | |
7 | * http://git.gnome.org/browse/gnome-shell-extensions/ | |
8 | * ======================================================================================================== | |
9 | */ | |
10 | ||
11 | const _DEBUG_ = false; | |
12 | ||
13 | const { Clutter, GLib, GObject, Meta, St, Shell } = imports.gi; | |
14 | const Lang = imports.lang; | |
15 | const Mainloop = imports.mainloop; | |
16 | ||
17 | const Main = imports.ui.main; | |
18 | const WorkspacesView = imports.ui.workspacesView; | |
19 | const WindowManager = imports.ui.windowManager; | |
20 | const Tweener = imports.ui.tweener; | |
21 | ||
22 | const Me = imports.misc.extensionUtils.getCurrentExtension(); | |
23 | const Convenience = Me.imports.convenience; | |
24 | ||
25 | let nrows = 1; | |
26 | ||
27 | var WorkspaceSwitcher = class WorkspacesToDock_WorkspaceSwitcher { | |
28 | constructor(params) { | |
29 | this._resetBindings(); | |
30 | global.workspace_manager.override_workspace_layout(Meta.DisplayCorner.TOPLEFT, false, nrows, -1); | |
31 | } | |
32 | ||
33 | destroy() { | |
34 | this._resetBindings(); | |
35 | global.workspace_manager.override_workspace_layout(Meta.DisplayCorner.TOPLEFT, false, -1, 1); | |
36 | } | |
37 | ||
38 | _resetBindings() { | |
39 | // Reset bindings to active showWorkspaceSwitcher function | |
40 | let wm = Main.wm; | |
41 | ||
42 | wm.setCustomKeybindingHandler('switch-to-workspace-left', | |
43 | Shell.ActionMode.NORMAL | | |
44 | Shell.ActionMode.OVERVIEW, | |
45 | wm._showWorkspaceSwitcher.bind(wm)); | |
46 | wm.setCustomKeybindingHandler('switch-to-workspace-right', | |
47 | Shell.ActionMode.NORMAL | | |
48 | Shell.ActionMode.OVERVIEW, | |
49 | wm._showWorkspaceSwitcher.bind(wm)); | |
50 | wm.setCustomKeybindingHandler('switch-to-workspace-up', | |
51 | Shell.ActionMode.NORMAL | | |
52 | Shell.ActionMode.OVERVIEW, | |
53 | wm._showWorkspaceSwitcher.bind(wm)); | |
54 | wm.setCustomKeybindingHandler('switch-to-workspace-down', | |
55 | Shell.ActionMode.NORMAL | | |
56 | Shell.ActionMode.OVERVIEW, | |
57 | wm._showWorkspaceSwitcher.bind(wm)); | |
58 | wm.setCustomKeybindingHandler('switch-to-workspace-last', | |
59 | Shell.ActionMode.NORMAL | | |
60 | Shell.ActionMode.OVERVIEW, | |
61 | wm._showWorkspaceSwitcher.bind(wm)); | |
62 | wm.setCustomKeybindingHandler('move-to-workspace-left', | |
63 | Shell.ActionMode.NORMAL | | |
64 | Shell.ActionMode.OVERVIEW, | |
65 | wm._showWorkspaceSwitcher.bind(wm)); | |
66 | wm.setCustomKeybindingHandler('move-to-workspace-right', | |
67 | Shell.ActionMode.NORMAL | | |
68 | Shell.ActionMode.OVERVIEW, | |
69 | wm._showWorkspaceSwitcher.bind(wm)); | |
70 | wm.setCustomKeybindingHandler('move-to-workspace-up', | |
71 | Shell.ActionMode.NORMAL | | |
72 | Shell.ActionMode.OVERVIEW, | |
73 | wm._showWorkspaceSwitcher.bind(wm)); | |
74 | wm.setCustomKeybindingHandler('move-to-workspace-down', | |
75 | Shell.ActionMode.NORMAL | | |
76 | Shell.ActionMode.OVERVIEW, | |
77 | wm._showWorkspaceSwitcher.bind(wm)); | |
78 | wm.setCustomKeybindingHandler('switch-to-workspace-1', | |
79 | Shell.ActionMode.NORMAL | | |
80 | Shell.ActionMode.OVERVIEW, | |
81 | wm._showWorkspaceSwitcher.bind(wm)); | |
82 | wm.setCustomKeybindingHandler('switch-to-workspace-2', | |
83 | Shell.ActionMode.NORMAL | | |
84 | Shell.ActionMode.OVERVIEW, | |
85 | wm._showWorkspaceSwitcher.bind(wm)); | |
86 | wm.setCustomKeybindingHandler('switch-to-workspace-3', | |
87 | Shell.ActionMode.NORMAL | | |
88 | Shell.ActionMode.OVERVIEW, | |
89 | wm._showWorkspaceSwitcher.bind(wm)); | |
90 | wm.setCustomKeybindingHandler('switch-to-workspace-4', | |
91 | Shell.ActionMode.NORMAL | | |
92 | Shell.ActionMode.OVERVIEW, | |
93 | wm._showWorkspaceSwitcher.bind(wm)); | |
94 | wm.setCustomKeybindingHandler('switch-to-workspace-5', | |
95 | Shell.ActionMode.NORMAL | | |
96 | Shell.ActionMode.OVERVIEW, | |
97 | wm._showWorkspaceSwitcher.bind(wm)); | |
98 | wm.setCustomKeybindingHandler('switch-to-workspace-6', | |
99 | Shell.ActionMode.NORMAL | | |
100 | Shell.ActionMode.OVERVIEW, | |
101 | wm._showWorkspaceSwitcher.bind(wm)); | |
102 | wm.setCustomKeybindingHandler('switch-to-workspace-7', | |
103 | Shell.ActionMode.NORMAL | | |
104 | Shell.ActionMode.OVERVIEW, | |
105 | wm._showWorkspaceSwitcher.bind(wm)); | |
106 | wm.setCustomKeybindingHandler('switch-to-workspace-8', | |
107 | Shell.ActionMode.NORMAL | | |
108 | Shell.ActionMode.OVERVIEW, | |
109 | wm._showWorkspaceSwitcher.bind(wm)); | |
110 | wm.setCustomKeybindingHandler('switch-to-workspace-9', | |
111 | Shell.ActionMode.NORMAL | | |
112 | Shell.ActionMode.OVERVIEW, | |
113 | wm._showWorkspaceSwitcher.bind(wm)); | |
114 | wm.setCustomKeybindingHandler('switch-to-workspace-10', | |
115 | Shell.ActionMode.NORMAL | | |
116 | Shell.ActionMode.OVERVIEW, | |
117 | wm._showWorkspaceSwitcher.bind(wm)); | |
118 | wm.setCustomKeybindingHandler('switch-to-workspace-11', | |
119 | Shell.ActionMode.NORMAL | | |
120 | Shell.ActionMode.OVERVIEW, | |
121 | wm._showWorkspaceSwitcher.bind(wm)); | |
122 | wm.setCustomKeybindingHandler('switch-to-workspace-12', | |
123 | Shell.ActionMode.NORMAL | | |
124 | Shell.ActionMode.OVERVIEW, | |
125 | wm._showWorkspaceSwitcher.bind(wm)); | |
126 | wm.setCustomKeybindingHandler('move-to-workspace-1', | |
127 | Shell.ActionMode.NORMAL, | |
128 | wm._showWorkspaceSwitcher.bind(wm)); | |
129 | wm.setCustomKeybindingHandler('move-to-workspace-2', | |
130 | Shell.ActionMode.NORMAL, | |
131 | wm._showWorkspaceSwitcher.bind(wm)); | |
132 | wm.setCustomKeybindingHandler('move-to-workspace-3', | |
133 | Shell.ActionMode.NORMAL, | |
134 | wm._showWorkspaceSwitcher.bind(wm)); | |
135 | wm.setCustomKeybindingHandler('move-to-workspace-4', | |
136 | Shell.ActionMode.NORMAL, | |
137 | wm._showWorkspaceSwitcher.bind(wm)); | |
138 | wm.setCustomKeybindingHandler('move-to-workspace-5', | |
139 | Shell.ActionMode.NORMAL, | |
140 | wm._showWorkspaceSwitcher.bind(wm)); | |
141 | wm.setCustomKeybindingHandler('move-to-workspace-6', | |
142 | Shell.ActionMode.NORMAL, | |
143 | wm._showWorkspaceSwitcher.bind(wm)); | |
144 | wm.setCustomKeybindingHandler('move-to-workspace-7', | |
145 | Shell.ActionMode.NORMAL, | |
146 | wm._showWorkspaceSwitcher.bind(wm)); | |
147 | wm.setCustomKeybindingHandler('move-to-workspace-8', | |
148 | Shell.ActionMode.NORMAL, | |
149 | wm._showWorkspaceSwitcher.bind(wm)); | |
150 | wm.setCustomKeybindingHandler('move-to-workspace-9', | |
151 | Shell.ActionMode.NORMAL, | |
152 | wm._showWorkspaceSwitcher.bind(wm)); | |
153 | wm.setCustomKeybindingHandler('move-to-workspace-10', | |
154 | Shell.ActionMode.NORMAL, | |
155 | wm._showWorkspaceSwitcher.bind(wm)); | |
156 | wm.setCustomKeybindingHandler('move-to-workspace-11', | |
157 | Shell.ActionMode.NORMAL, | |
158 | wm._showWorkspaceSwitcher.bind(wm)); | |
159 | wm.setCustomKeybindingHandler('move-to-workspace-12', | |
160 | Shell.ActionMode.NORMAL, | |
161 | wm._showWorkspaceSwitcher.bind(wm)); | |
162 | wm.setCustomKeybindingHandler('move-to-workspace-last', | |
163 | Shell.ActionMode.NORMAL, | |
164 | wm._showWorkspaceSwitcher.bind(wm)); | |
165 | ||
166 | wm._workspaceSwitcherPopup = null; | |
167 | } | |
168 | }; |
0 | /* ======================================================================================================== | |
1 | * dockedWorkspaces.js - dock object that holds the workspaces thumbnailsBox | |
2 | * -------------------------------------------------------------------------------------------------------- | |
3 | * CREDITS: This code was copied from the Frippery Bottom Panel extension http://frippery.org/extensions/ | |
4 | * and modified to create a workspaces switcher popup. Copyright (C) 2011-2015 R M Yorston. | |
5 | * | |
6 | * Part of this code also comes from gnome-shell-extensions: | |
7 | * http://git.gnome.org/browse/gnome-shell-extensions/ | |
8 | * ======================================================================================================== | |
9 | */ | |
10 | ||
11 | const _DEBUG_ = false; | |
12 | ||
13 | const { Clutter, GLib, GObject, Meta, St, Shell } = imports.gi; | |
14 | const Lang = imports.lang; | |
15 | const Mainloop = imports.mainloop; | |
16 | ||
17 | const Main = imports.ui.main; | |
18 | const WorkspacesView = imports.ui.workspacesView; | |
19 | const WindowManager = imports.ui.windowManager; | |
20 | const Tweener = imports.ui.tweener; | |
21 | ||
22 | const Me = imports.misc.extensionUtils.getCurrentExtension(); | |
23 | const Convenience = Me.imports.convenience; | |
24 | ||
25 | var ANIMATION_TIME = 0.1; | |
26 | var DISPLAY_TIMEOUT = 600; | |
27 | ||
28 | let GSFunctions = {}; | |
29 | let nrows = 1; | |
30 | ||
31 | function get_ncols() { | |
32 | let workspaceManager = global.workspace_manager; | |
33 | let ncols = Math.floor(workspaceManager.n_workspaces/nrows); | |
34 | if ( workspaceManager.n_workspaces%nrows != 0 ) | |
35 | ++ncols | |
36 | ||
37 | return ncols; | |
38 | } | |
39 | ||
40 | var MyWorkspaceSwitcherPopupList = GObject.registerClass( | |
41 | class WorkspacesToDock_MyWorkspaceSwitcherPopupList extends St.Widget { | |
42 | _init() { | |
43 | super._init({ style_class: 'workspace-switcher' }); | |
44 | ||
45 | this._itemSpacing = 0; | |
46 | this._childHeight = 0; | |
47 | this._childWidth = 0; | |
48 | ||
49 | this.connect('style-changed', () => { | |
50 | this._itemSpacing = this.get_theme_node().get_length('spacing'); | |
51 | }); | |
52 | } | |
53 | ||
54 | // vfunc_get_preferred_height(forWidth) { | |
55 | // let workArea = Main.layoutManager.getWorkAreaForMonitor(Main.layoutManager.primaryIndex); | |
56 | // let themeNode = this.get_theme_node(); | |
57 | // | |
58 | // let availHeight = workArea.height; | |
59 | // availHeight -= themeNode.get_vertical_padding(); | |
60 | // | |
61 | // let height = 0; | |
62 | // for (let child of this.get_children()) { | |
63 | // let [childMinHeight, childNaturalHeight] = child.get_preferred_height(-1); | |
64 | // let [childMinWidth, childNaturalWidth] = child.get_preferred_width(childNaturalHeight); | |
65 | // height += childNaturalHeight * workArea.width / workArea.height; | |
66 | // } | |
67 | // | |
68 | // let workspaceManager = global.workspace_manager; | |
69 | // let spacing = this._itemSpacing * (workspaceManager.n_workspaces - 1); | |
70 | // height += spacing; | |
71 | // height = Math.min(height, availHeight); | |
72 | // | |
73 | // this._childHeight = (height - spacing) / workspaceManager.n_workspaces; | |
74 | // | |
75 | // return themeNode.adjust_preferred_height(height, height); | |
76 | // } | |
77 | // | |
78 | // vfunc_get_preferred_width(forHeight) { | |
79 | // let workArea = Main.layoutManager.getWorkAreaForMonitor(Main.layoutManager.primaryIndex); | |
80 | // this._childWidth = Math.round(this._childHeight * workArea.width / workArea.height); | |
81 | // | |
82 | // return [this._childWidth, this._childWidth]; | |
83 | // } | |
84 | ||
85 | vfunc_get_preferred_width(forHeight) { | |
86 | let workArea = Main.layoutManager.getWorkAreaForMonitor(Main.layoutManager.primaryIndex); | |
87 | let themeNode = this.get_theme_node(); | |
88 | ||
89 | let availWidth = workArea.width; | |
90 | availWidth -= themeNode.get_horizontal_padding(); | |
91 | ||
92 | let width = 0; | |
93 | for (let child of this.get_children()) { | |
94 | let [childMinHeight, childNaturalHeight] = child.get_preferred_height(-1); | |
95 | let [childMinWidth, childNaturalWidth] = child.get_preferred_width(childNaturalHeight); | |
96 | width += childNaturalHeight * workArea.width / workArea.height; | |
97 | } | |
98 | ||
99 | let workspaceManager = global.workspace_manager; | |
100 | let spacing = this._itemSpacing * (workspaceManager.n_workspaces - 1); | |
101 | width += spacing; | |
102 | width = Math.min(width, availWidth); | |
103 | ||
104 | this._childWidth = (width - spacing) / workspaceManager.n_workspaces; | |
105 | ||
106 | return themeNode.adjust_preferred_height(width, width); | |
107 | } | |
108 | ||
109 | vfunc_get_preferred_height(forWidth) { | |
110 | let workArea = Main.layoutManager.getWorkAreaForMonitor(Main.layoutManager.primaryIndex); | |
111 | this._childHeight = Math.round(this._childWidth * workArea.height / workArea.width); | |
112 | ||
113 | return [this._childHeight, this._childHeight]; | |
114 | } | |
115 | ||
116 | vfunc_allocate(box, flags) { | |
117 | this.set_allocation(box, flags); | |
118 | ||
119 | let themeNode = this.get_theme_node(); | |
120 | box = themeNode.get_content_box(box); | |
121 | ||
122 | let childBox = new Clutter.ActorBox(); | |
123 | ||
124 | // let y = box.y1; | |
125 | // let prevChildBoxY2 = box.y1 - this._itemSpacing; | |
126 | // for (let child of this.get_children()) { | |
127 | // childBox.x1 = box.x1; | |
128 | // childBox.x2 = box.x1 + this._childWidth; | |
129 | // childBox.y1 = prevChildBoxY2 + this._itemSpacing; | |
130 | // childBox.y2 = Math.round(y + this._childHeight); | |
131 | // y += this._childHeight + this._itemSpacing; | |
132 | // prevChildBoxY2 = childBox.y2; | |
133 | // child.allocate(childBox, flags); | |
134 | // } | |
135 | let x = box.x1; | |
136 | let prevChildBoxX2 = box.x1 - this._itemSpacing; | |
137 | for (let child of this.get_children()) { | |
138 | childBox.y1 = box.y1; | |
139 | childBox.y2 = box.y1 + this._childHeight; | |
140 | childBox.x1 = prevChildBoxX2 + this._itemSpacing; | |
141 | childBox.x2 = Math.round(x + this._childWidth); | |
142 | x += this._childWidth + this._itemSpacing; | |
143 | prevChildBoxX2 = childBox.x2; | |
144 | child.allocate(childBox, flags); | |
145 | } | |
146 | } | |
147 | }); | |
148 | ||
149 | var MyWorkspaceSwitcherPopup = GObject.registerClass( | |
150 | class WorkspacesToDock_MyWorkspaceSwitcherPopup extends St.Widget { | |
151 | _init() { | |
152 | super._init({ x: 0, | |
153 | y: 0, | |
154 | width: global.screen_width, | |
155 | height: global.screen_height, | |
156 | style_class: 'workspace-switcher-group' }); | |
157 | ||
158 | this.actor = this; | |
159 | ||
160 | Main.uiGroup.add_actor(this); | |
161 | ||
162 | this._timeoutId = 0; | |
163 | ||
164 | this._container = new St.BoxLayout({ style_class: 'workspace-switcher-container' }); | |
165 | this.add_child(this._container); | |
166 | ||
167 | this._list = new MyWorkspaceSwitcherPopupList(); | |
168 | this._container.add_child(this._list); | |
169 | ||
170 | this._redisplay(); | |
171 | ||
172 | this.hide(); | |
173 | ||
174 | let workspaceManager = global.workspace_manager; | |
175 | this._workspaceManagerSignals = []; | |
176 | this._workspaceManagerSignals.push(workspaceManager.connect('workspace-added', | |
177 | this._redisplay.bind(this))); | |
178 | this._workspaceManagerSignals.push(workspaceManager.connect('workspace-removed', | |
179 | this._redisplay.bind(this))); | |
180 | ||
181 | this.connect('destroy', this._onDestroy.bind(this)); | |
182 | ||
183 | this._settings = Convenience.getSettings('org.gnome.shell.extensions.workspaces-to-dock'); | |
184 | } | |
185 | ||
186 | _redisplay() { | |
187 | let workspaceManager = global.workspace_manager; | |
188 | ||
189 | this._list.destroy_all_children(); | |
190 | ||
191 | for (let i = 0; i < workspaceManager.n_workspaces; i++) { | |
192 | let indicator = null; | |
193 | ||
194 | if (i == this._activeWorkspaceIndex && this._direction == Meta.MotionDirection.LEFT) | |
195 | indicator = new St.Bin({ style_class: 'ws-switcher-active-up' }); | |
196 | else if(i == this._activeWorkspaceIndex && this._direction == Meta.MotionDirection.RIGHT) | |
197 | indicator = new St.Bin({ style_class: 'ws-switcher-active-down' }); | |
198 | else if (i == this._activeWorkspaceIndex && this._direction == Meta.MotionDirection.UP) | |
199 | indicator = new St.Bin({ style_class: 'ws-switcher-active-up' }); | |
200 | else if(i == this._activeWorkspaceIndex && this._direction == Meta.MotionDirection.DOWN) | |
201 | indicator = new St.Bin({ style_class: 'ws-switcher-active-down' }); | |
202 | else | |
203 | indicator = new St.Bin({ style_class: 'ws-switcher-box' }); | |
204 | ||
205 | this._list.add_actor(indicator); | |
206 | ||
207 | } | |
208 | ||
209 | let workArea = Main.layoutManager.getWorkAreaForMonitor(Main.layoutManager.primaryIndex); | |
210 | let [containerMinHeight, containerNatHeight] = this._container.get_preferred_height(global.screen_width); | |
211 | let [containerMinWidth, containerNatWidth] = this._container.get_preferred_width(containerNatHeight); | |
212 | this._container.x = workArea.x + Math.floor((workArea.width - containerNatWidth) / 2); | |
213 | this._container.y = workArea.y + Math.floor((workArea.height - containerNatHeight) / 2); | |
214 | } | |
215 | ||
216 | _show() { | |
217 | if (this._settings.get_boolean('hide-workspace-switcher-popup')) | |
218 | return; | |
219 | ||
220 | Tweener.addTween(this._container, { opacity: 255, | |
221 | time: ANIMATION_TIME, | |
222 | transition: 'easeOutQuad' | |
223 | }); | |
224 | this.actor.show(); | |
225 | } | |
226 | ||
227 | display(direction, activeWorkspaceIndex) { | |
228 | this._direction = direction; | |
229 | this._activeWorkspaceIndex = activeWorkspaceIndex; | |
230 | ||
231 | this._redisplay(); | |
232 | if (this._timeoutId != 0) | |
233 | Mainloop.source_remove(this._timeoutId); | |
234 | this._timeoutId = Mainloop.timeout_add(DISPLAY_TIMEOUT, this._onTimeout.bind(this)); | |
235 | GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] this._onTimeout'); | |
236 | this._show(); | |
237 | } | |
238 | ||
239 | _onTimeout() { | |
240 | Mainloop.source_remove(this._timeoutId); | |
241 | this._timeoutId = 0; | |
242 | Tweener.addTween(this._container, { opacity: 0.0, | |
243 | time: ANIMATION_TIME, | |
244 | transition: 'easeOutQuad', | |
245 | onComplete() { this.destroy(); }, | |
246 | onCompleteScope: this | |
247 | }); | |
248 | return GLib.SOURCE_REMOVE; | |
249 | } | |
250 | ||
251 | _onDestroy() { | |
252 | // Disconnect GSettings signals | |
253 | this._settings.run_dispose(); | |
254 | ||
255 | if (this._timeoutId) | |
256 | Mainloop.source_remove(this._timeoutId); | |
257 | this._timeoutId = 0; | |
258 | ||
259 | let workspaceManager = global.workspace_manager; | |
260 | for (let i = 0; i < this._workspaceManagerSignals.length; i++) | |
261 | workspaceManager.disconnect(this._workspaceManagerSignals[i]); | |
262 | ||
263 | this._workspaceManagerSignals = []; | |
264 | } | |
265 | }); | |
266 | ||
267 | var WorkspaceSwitcher = class WorkspacesToDock_WorkspaceSwitcher { | |
268 | constructor(params) { | |
269 | // Override Gnome Shell functions | |
270 | this._overrideGnomeShellFunctions(); | |
271 | this._resetBindings(); | |
272 | ||
273 | global.workspace_manager.override_workspace_layout(Meta.DisplayCorner.TOPLEFT, false, nrows, -1); | |
274 | } | |
275 | ||
276 | destroy() { | |
277 | // Restor Gnome Shell functions | |
278 | this._restoreGnomeShellFunctions(); | |
279 | this._resetBindings(); | |
280 | ||
281 | global.workspace_manager.override_workspace_layout(Meta.DisplayCorner.TOPLEFT, false, -1, 1); | |
282 | } | |
283 | ||
284 | _overrideGnomeShellFunctions() { | |
285 | // Override showWorkspacesSwitcher to show custom horizontal workspace switcher popup | |
286 | GSFunctions['WindowManager_showWorkspaceSwitcher'] = WindowManager.WindowManager.prototype._showWorkspaceSwitcher; | |
287 | WindowManager.WindowManager.prototype._showWorkspaceSwitcher = function(display, window, binding) { | |
288 | let workspaceManager = display.get_workspace_manager(); | |
289 | ||
290 | if (!Main.sessionMode.hasWorkspaces) | |
291 | return; | |
292 | ||
293 | if (workspaceManager.n_workspaces == 1) | |
294 | return; | |
295 | ||
296 | let [action,,,target] = binding.get_name().split('-'); | |
297 | let newWs; | |
298 | let direction; | |
299 | ||
300 | if (action == 'move') { | |
301 | // "Moving" a window to another workspace doesn't make sense when | |
302 | // it cannot be unstuck, and is potentially confusing if a new | |
303 | // workspaces is added at the start/end | |
304 | if (window.is_always_on_all_workspaces() || | |
305 | (Meta.prefs_get_workspaces_only_on_primary() && | |
306 | window.get_monitor() != Main.layoutManager.primaryIndex)) | |
307 | return; | |
308 | } | |
309 | ||
310 | if (target == 'last') { | |
311 | direction = Meta.MotionDirection.RIGHT; | |
312 | newWs = workspaceManager.get_workspace_by_index(workspaceManager.n_workspaces - 1); | |
313 | } else if (isNaN(target)) { | |
314 | // Prepend a new workspace dynamically | |
315 | if (workspaceManager.get_active_workspace_index() == 0 && | |
316 | action == 'move' && target == 'left' && this._isWorkspacePrepended == false) { | |
317 | this.insertWorkspace(0); | |
318 | this._isWorkspacePrepended = true; | |
319 | } | |
320 | ||
321 | direction = Meta.MotionDirection[target.toUpperCase()]; | |
322 | newWs = workspaceManager.get_active_workspace().get_neighbor(direction); | |
323 | } else if (target > 0) { | |
324 | target--; | |
325 | newWs = workspaceManager.get_workspace_by_index(target); | |
326 | ||
327 | if (workspaceManager.get_active_workspace().index() > target) | |
328 | direction = Meta.MotionDirection.LEFT; | |
329 | else | |
330 | direction = Meta.MotionDirection.RIGHT; | |
331 | } | |
332 | ||
333 | if (direction != Meta.MotionDirection.LEFT && | |
334 | direction != Meta.MotionDirection.RIGHT) | |
335 | return; | |
336 | ||
337 | if (action == 'switch') | |
338 | this.actionMoveWorkspace(newWs); | |
339 | else | |
340 | this.actionMoveWindow(window, newWs); | |
341 | ||
342 | if (!Main.overview.visible) { | |
343 | if (this._workspaceSwitcherPopup == null) { | |
344 | this._workspaceSwitcherPopup = new MyWorkspaceSwitcherPopup(); | |
345 | this._workspaceSwitcherPopup.connect('destroy', () => { | |
346 | this._workspaceTracker.unblockUpdates(); | |
347 | this._workspaceSwitcherPopup = null; | |
348 | this._isWorkspacePrepended = false; | |
349 | }); | |
350 | } | |
351 | this._workspaceSwitcherPopup.display(direction, newWs.index()); | |
352 | } | |
353 | }; | |
354 | ||
355 | // Override updateWorkspaceActors for horizontal animation of overview windows | |
356 | GSFunctions['WorkspacesView_updateWorkspaceActors'] = WorkspacesView.WorkspacesView.prototype._updateWorkspaceActors; | |
357 | WorkspacesView.WorkspacesView.prototype._updateWorkspaceActors = function(showAnimation) { | |
358 | let workspaceManager = global.workspace_manager; | |
359 | let active = workspaceManager.get_active_workspace_index(); | |
360 | ||
361 | this._animating = showAnimation; | |
362 | ||
363 | for (let w = 0; w < this._workspaces.length; w++) { | |
364 | let workspace = this._workspaces[w]; | |
365 | ||
366 | Tweener.removeTweens(workspace.actor); | |
367 | ||
368 | let x = (w - active) * this._fullGeometry.width; | |
369 | ||
370 | if (showAnimation) { | |
371 | let params = { x: x, | |
372 | time: WorkspacesView.WORKSPACE_SWITCH_TIME, | |
373 | transition: 'easeOutQuad' | |
374 | }; | |
375 | // we have to call _updateVisibility() once before the | |
376 | // animation and once afterwards - it does not really | |
377 | // matter which tween we use, so we pick the first one ... | |
378 | if (w == 0) { | |
379 | this._updateVisibility(); | |
380 | params.onComplete = () => { | |
381 | this._animating = false; | |
382 | this._updateVisibility(); | |
383 | }; | |
384 | } | |
385 | Tweener.addTween(workspace.actor, params); | |
386 | } else { | |
387 | workspace.actor.set_position(x, 0); | |
388 | if (w == 0) | |
389 | this._updateVisibility(); | |
390 | } | |
391 | } | |
392 | }; | |
393 | ||
394 | // Override overview scroll event for horizontal scrolling of workspaces | |
395 | GSFunctions['WorkspacesDisplay_onScrollEvent'] = WorkspacesView.WorkspacesDisplay.prototype._onScrollEvent; | |
396 | WorkspacesView.WorkspacesDisplay.prototype._onScrollEvent = function(actor, event) { | |
397 | if (!this.actor.mapped) | |
398 | return Clutter.EVENT_PROPAGATE; | |
399 | ||
400 | if (this._workspacesOnlyOnPrimary && | |
401 | this._getMonitorIndexForEvent(event) != this._primaryIndex) | |
402 | return Clutter.EVENT_PROPAGATE; | |
403 | ||
404 | let workspaceManager = global.workspace_manager; | |
405 | let activeWs = workspaceManager.get_active_workspace(); | |
406 | let ws; | |
407 | switch (event.get_scroll_direction()) { | |
408 | case Clutter.ScrollDirection.UP: | |
409 | ws = activeWs.get_neighbor(Meta.MotionDirection.LEFT); | |
410 | break; | |
411 | case Clutter.ScrollDirection.DOWN: | |
412 | ws = activeWs.get_neighbor(Meta.MotionDirection.RIGHT); | |
413 | break; | |
414 | case Clutter.ScrollDirection.LEFT: | |
415 | ws = activeWs.get_neighbor(Meta.MotionDirection.LEFT); | |
416 | break; | |
417 | case Clutter.ScrollDirection.RIGHT: | |
418 | ws = activeWs.get_neighbor(Meta.MotionDirection.RIGHT); | |
419 | break; | |
420 | default: | |
421 | return Clutter.EVENT_PROPAGATE; | |
422 | } | |
423 | Main.wm.actionMoveWorkspace(ws); | |
424 | return Clutter.EVENT_STOP; | |
425 | }; | |
426 | ||
427 | } | |
428 | ||
429 | _restoreGnomeShellFunctions() { | |
430 | // Restore showWorkspacesSwitcher to show normal workspace switcher popup | |
431 | WindowManager.WindowManager.prototype._showWorkspaceSwitcher = GSFunctions['WindowManager_showWorkspaceSwitcher']; | |
432 | ||
433 | // Restore updateWorkspaceActors to original vertical animation of overview windows | |
434 | WorkspacesView.WorkspacesView.prototype._updateWorkspaceActors = GSFunctions['WorkspacesView_updateWorkspaceActors']; | |
435 | ||
436 | // Restore onScrollEvent to original vertical scrolling of workspaces | |
437 | WorkspacesView.WorkspacesDisplay.prototype._onScrollEvent = GSFunctions['WorkspacesDisplay_onScrollEvent'] | |
438 | } | |
439 | ||
440 | _resetBindings() { | |
441 | // Reset bindings to active showWorkspaceSwitcher function | |
442 | let wm = Main.wm; | |
443 | ||
444 | wm.setCustomKeybindingHandler('switch-to-workspace-left', | |
445 | Shell.ActionMode.NORMAL | | |
446 | Shell.ActionMode.OVERVIEW, | |
447 | wm._showWorkspaceSwitcher.bind(wm)); | |
448 | wm.setCustomKeybindingHandler('switch-to-workspace-right', | |
449 | Shell.ActionMode.NORMAL | | |
450 | Shell.ActionMode.OVERVIEW, | |
451 | wm._showWorkspaceSwitcher.bind(wm)); | |
452 | wm.setCustomKeybindingHandler('switch-to-workspace-up', | |
453 | Shell.ActionMode.NORMAL | | |
454 | Shell.ActionMode.OVERVIEW, | |
455 | wm._showWorkspaceSwitcher.bind(wm)); | |
456 | wm.setCustomKeybindingHandler('switch-to-workspace-down', | |
457 | Shell.ActionMode.NORMAL | | |
458 | Shell.ActionMode.OVERVIEW, | |
459 | wm._showWorkspaceSwitcher.bind(wm)); | |
460 | wm.setCustomKeybindingHandler('switch-to-workspace-last', | |
461 | Shell.ActionMode.NORMAL | | |
462 | Shell.ActionMode.OVERVIEW, | |
463 | wm._showWorkspaceSwitcher.bind(wm)); | |
464 | wm.setCustomKeybindingHandler('move-to-workspace-left', | |
465 | Shell.ActionMode.NORMAL | | |
466 | Shell.ActionMode.OVERVIEW, | |
467 | wm._showWorkspaceSwitcher.bind(wm)); | |
468 | wm.setCustomKeybindingHandler('move-to-workspace-right', | |
469 | Shell.ActionMode.NORMAL | | |
470 | Shell.ActionMode.OVERVIEW, | |
471 | wm._showWorkspaceSwitcher.bind(wm)); | |
472 | wm.setCustomKeybindingHandler('move-to-workspace-up', | |
473 | Shell.ActionMode.NORMAL | | |
474 | Shell.ActionMode.OVERVIEW, | |
475 | wm._showWorkspaceSwitcher.bind(wm)); | |
476 | wm.setCustomKeybindingHandler('move-to-workspace-down', | |
477 | Shell.ActionMode.NORMAL | | |
478 | Shell.ActionMode.OVERVIEW, | |
479 | wm._showWorkspaceSwitcher.bind(wm)); | |
480 | wm.setCustomKeybindingHandler('switch-to-workspace-1', | |
481 | Shell.ActionMode.NORMAL | | |
482 | Shell.ActionMode.OVERVIEW, | |
483 | wm._showWorkspaceSwitcher.bind(wm)); | |
484 | wm.setCustomKeybindingHandler('switch-to-workspace-2', | |
485 | Shell.ActionMode.NORMAL | | |
486 | Shell.ActionMode.OVERVIEW, | |
487 | wm._showWorkspaceSwitcher.bind(wm)); | |
488 | wm.setCustomKeybindingHandler('switch-to-workspace-3', | |
489 | Shell.ActionMode.NORMAL | | |
490 | Shell.ActionMode.OVERVIEW, | |
491 | wm._showWorkspaceSwitcher.bind(wm)); | |
492 | wm.setCustomKeybindingHandler('switch-to-workspace-4', | |
493 | Shell.ActionMode.NORMAL | | |
494 | Shell.ActionMode.OVERVIEW, | |
495 | wm._showWorkspaceSwitcher.bind(wm)); | |
496 | wm.setCustomKeybindingHandler('switch-to-workspace-5', | |
497 | Shell.ActionMode.NORMAL | | |
498 | Shell.ActionMode.OVERVIEW, | |
499 | wm._showWorkspaceSwitcher.bind(wm)); | |
500 | wm.setCustomKeybindingHandler('switch-to-workspace-6', | |
501 | Shell.ActionMode.NORMAL | | |
502 | Shell.ActionMode.OVERVIEW, | |
503 | wm._showWorkspaceSwitcher.bind(wm)); | |
504 | wm.setCustomKeybindingHandler('switch-to-workspace-7', | |
505 | Shell.ActionMode.NORMAL | | |
506 | Shell.ActionMode.OVERVIEW, | |
507 | wm._showWorkspaceSwitcher.bind(wm)); | |
508 | wm.setCustomKeybindingHandler('switch-to-workspace-8', | |
509 | Shell.ActionMode.NORMAL | | |
510 | Shell.ActionMode.OVERVIEW, | |
511 | wm._showWorkspaceSwitcher.bind(wm)); | |
512 | wm.setCustomKeybindingHandler('switch-to-workspace-9', | |
513 | Shell.ActionMode.NORMAL | | |
514 | Shell.ActionMode.OVERVIEW, | |
515 | wm._showWorkspaceSwitcher.bind(wm)); | |
516 | wm.setCustomKeybindingHandler('switch-to-workspace-10', | |
517 | Shell.ActionMode.NORMAL | | |
518 | Shell.ActionMode.OVERVIEW, | |
519 | wm._showWorkspaceSwitcher.bind(wm)); | |
520 | wm.setCustomKeybindingHandler('switch-to-workspace-11', | |
521 | Shell.ActionMode.NORMAL | | |
522 | Shell.ActionMode.OVERVIEW, | |
523 | wm._showWorkspaceSwitcher.bind(wm)); | |
524 | wm.setCustomKeybindingHandler('switch-to-workspace-12', | |
525 | Shell.ActionMode.NORMAL | | |
526 | Shell.ActionMode.OVERVIEW, | |
527 | wm._showWorkspaceSwitcher.bind(wm)); | |
528 | wm.setCustomKeybindingHandler('move-to-workspace-1', | |
529 | Shell.ActionMode.NORMAL, | |
530 | wm._showWorkspaceSwitcher.bind(wm)); | |
531 | wm.setCustomKeybindingHandler('move-to-workspace-2', | |
532 | Shell.ActionMode.NORMAL, | |
533 | wm._showWorkspaceSwitcher.bind(wm)); | |
534 | wm.setCustomKeybindingHandler('move-to-workspace-3', | |
535 | Shell.ActionMode.NORMAL, | |
536 | wm._showWorkspaceSwitcher.bind(wm)); | |
537 | wm.setCustomKeybindingHandler('move-to-workspace-4', | |
538 | Shell.ActionMode.NORMAL, | |
539 | wm._showWorkspaceSwitcher.bind(wm)); | |
540 | wm.setCustomKeybindingHandler('move-to-workspace-5', | |
541 | Shell.ActionMode.NORMAL, | |
542 | wm._showWorkspaceSwitcher.bind(wm)); | |
543 | wm.setCustomKeybindingHandler('move-to-workspace-6', | |
544 | Shell.ActionMode.NORMAL, | |
545 | wm._showWorkspaceSwitcher.bind(wm)); | |
546 | wm.setCustomKeybindingHandler('move-to-workspace-7', | |
547 | Shell.ActionMode.NORMAL, | |
548 | wm._showWorkspaceSwitcher.bind(wm)); | |
549 | wm.setCustomKeybindingHandler('move-to-workspace-8', | |
550 | Shell.ActionMode.NORMAL, | |
551 | wm._showWorkspaceSwitcher.bind(wm)); | |
552 | wm.setCustomKeybindingHandler('move-to-workspace-9', | |
553 | Shell.ActionMode.NORMAL, | |
554 | wm._showWorkspaceSwitcher.bind(wm)); | |
555 | wm.setCustomKeybindingHandler('move-to-workspace-10', | |
556 | Shell.ActionMode.NORMAL, | |
557 | wm._showWorkspaceSwitcher.bind(wm)); | |
558 | wm.setCustomKeybindingHandler('move-to-workspace-11', | |
559 | Shell.ActionMode.NORMAL, | |
560 | wm._showWorkspaceSwitcher.bind(wm)); | |
561 | wm.setCustomKeybindingHandler('move-to-workspace-12', | |
562 | Shell.ActionMode.NORMAL, | |
563 | wm._showWorkspaceSwitcher.bind(wm)); | |
564 | wm.setCustomKeybindingHandler('move-to-workspace-last', | |
565 | Shell.ActionMode.NORMAL, | |
566 | wm._showWorkspaceSwitcher.bind(wm)); | |
567 | ||
568 | wm._workspaceSwitcherPopup = null; | |
569 | } | |
570 | }; |
15 | 15 | const Background = imports.ui.background; |
16 | 16 | const DND = imports.ui.dnd; |
17 | 17 | const Main = imports.ui.main; |
18 | const Tweener = imports.ui.tweener; | |
19 | 18 | const Workspace = imports.ui.workspace; |
20 | 19 | const WorkspacesView = imports.ui.workspacesView; |
21 | 20 | |
27 | 26 | const _ = Gettext.gettext; |
28 | 27 | |
29 | 28 | // The maximum size of a thumbnail is 1/10 the width and height of the screen |
30 | let MAX_THUMBNAIL_SCALE = 1/10.; | |
31 | ||
32 | var RESCALE_ANIMATION_TIME = 0.2; | |
33 | var SLIDE_ANIMATION_TIME = 0.2; | |
29 | let MAX_THUMBNAIL_SCALE = 1 / 10.; | |
30 | ||
31 | var RESCALE_ANIMATION_TIME = 200; | |
32 | var SLIDE_ANIMATION_TIME = 200; | |
34 | 33 | |
35 | 34 | // When we create workspaces by dragging, we add a "cut" into the top and |
36 | 35 | // bottom of each workspace so that the user doesn't have to hit the |
40 | 39 | var WORKSPACE_KEEP_ALIVE_TIME = 100; |
41 | 40 | |
42 | 41 | var MUTTER_SCHEMA = 'org.gnome.mutter'; |
43 | //var OVERRIDE_SCHEMA = 'org.gnome.shell.overrides'; | |
44 | 42 | |
45 | 43 | /* Return the actual position reverseing left and right in rtl */ |
46 | 44 | function getPosition(settings) { |
238 | 236 | return Clutter.EVENT_STOP; |
239 | 237 | } |
240 | 238 | |
241 | _onDragBegin(draggable, time) { | |
239 | _onDragBegin(_draggable, _time) { | |
242 | 240 | this.inDrag = true; |
243 | 241 | this.emit('drag-begin'); |
244 | 242 | } |
245 | 243 | |
246 | _onDragCancelled(draggable, time) { | |
244 | _onDragCancelled(_draggable, _time) { | |
247 | 245 | this.emit('drag-cancelled'); |
248 | 246 | } |
249 | 247 | |
250 | _onDragEnd(draggable, time, snapback) { | |
248 | _onDragEnd(_draggable, _time, _snapback) { | |
251 | 249 | this.inDrag = false; |
252 | 250 | |
253 | 251 | // We may not have a parent if DnD completed successfully, in |
268 | 266 | |
269 | 267 | |
270 | 268 | var ThumbnailState = { |
271 | NEW : 0, | |
272 | ANIMATING_IN : 1, | |
269 | NEW: 0, | |
270 | ANIMATING_IN: 1, | |
273 | 271 | NORMAL: 2, |
274 | REMOVING : 3, | |
275 | ANIMATING_OUT : 4, | |
276 | ANIMATED_OUT : 5, | |
277 | COLLAPSING : 6, | |
278 | DESTROYED : 7 | |
272 | REMOVING: 3, | |
273 | ANIMATING_OUT: 4, | |
274 | ANIMATED_OUT: 5, | |
275 | COLLAPSING: 6, | |
276 | DESTROYED: 7 | |
279 | 277 | }; |
280 | 278 | |
281 | 279 | /** |
282 | 280 | * @metaWorkspace: a #Meta.Workspace |
283 | 281 | */ |
284 | var MyWorkspaceThumbnail = class WorkspacesToDock_MyWorkspaceThumbnail { | |
285 | constructor(metaWorkspace, thumbnailsBox) { | |
282 | var MyWorkspaceThumbnail = GObject.registerClass({ | |
283 | Properties: { | |
284 | 'collapse-fraction': GObject.ParamSpec.double( | |
285 | 'collapse-fraction', 'collapse-fraction', 'collapse-fraction', | |
286 | GObject.ParamFlags.READWRITE, | |
287 | 0, 1, 0), | |
288 | 'slide-position': GObject.ParamSpec.double( | |
289 | 'slide-position', 'slide-position', 'slide-position', | |
290 | GObject.ParamFlags.READWRITE, | |
291 | 0, 1, 0), | |
292 | } | |
293 | }, class WorkspacesToDock_MyWorkspaceThumbnail extends St.Widget { | |
294 | _init(metaWorkspace, thumbnailsBox) { | |
295 | super._init({ | |
296 | clip_to_allocation: true, | |
297 | style_class: 'workspace-thumbnail' | |
298 | }); | |
299 | this._delegate = this; | |
300 | ||
286 | 301 | this.metaWorkspace = metaWorkspace; |
287 | 302 | this.monitorIndex = Main.layoutManager.primaryIndex; |
288 | 303 | |
289 | this._getWinTextureIdleId = 0; | |
290 | 304 | this._thumbnailsBox = thumbnailsBox; |
291 | 305 | |
292 | 306 | this._removed = false; |
293 | 307 | |
294 | this.actor = new St.Widget({ clip_to_allocation: true, | |
295 | style_class: 'workspace-thumbnail' }); | |
296 | this.actor._delegate = this; | |
297 | ||
298 | 308 | this._contents = new Clutter.Actor(); |
299 | this.actor.add_child(this._contents); | |
300 | ||
301 | this.actor.connect('destroy', this._onDestroy.bind(this)); | |
309 | this.add_child(this._contents); | |
310 | ||
311 | this.connect('destroy', this._onDestroy.bind(this)); | |
302 | 312 | |
303 | 313 | this.caption = new ThumbnailCaption.ThumbnailCaption(this); |
304 | 314 | |
330 | 340 | |
331 | 341 | // Track window changes |
332 | 342 | this._windowAddedId = this.metaWorkspace.connect('window-added', |
333 | this._windowAdded.bind(this)); | |
343 | this._windowAdded.bind(this)); | |
334 | 344 | this._windowRemovedId = this.metaWorkspace.connect('window-removed', |
335 | 345 | this._windowRemoved.bind(this)); |
336 | 346 | this._windowEnteredMonitorId = global.display.connect('window-entered-monitor', |
350 | 360 | } |
351 | 361 | |
352 | 362 | setPorthole(x, y, width, height) { |
353 | this.actor.set_size(width, height); | |
363 | this.set_size(width, height); | |
354 | 364 | this._contents.set_position(-x, -y); |
355 | 365 | } |
356 | 366 | |
367 | 377 | |
368 | 378 | for (let i = 0; i < this._windows.length; i++) { |
369 | 379 | let clone = this._windows[i]; |
370 | let metaWindow = clone.metaWindow; | |
371 | 380 | if (i == 0) { |
372 | 381 | clone.setStackAbove(this._bgManager.backgroundActor); |
373 | 382 | } else { |
377 | 386 | } |
378 | 387 | } |
379 | 388 | |
380 | set slidePosition(slidePosition) { | |
389 | // eslint-disable-next-line camelcase | |
390 | set slide_position(slidePosition) { | |
391 | if (this._slidePosition == slidePosition) | |
392 | return; | |
381 | 393 | this._slidePosition = slidePosition; |
382 | this.actor.queue_relayout(); | |
383 | } | |
384 | ||
385 | get slidePosition() { | |
394 | this.notify('slide-position'); | |
395 | this.queue_relayout(); | |
396 | } | |
397 | ||
398 | // eslint-disable-next-line camelcase | |
399 | get slide_position() { | |
386 | 400 | return this._slidePosition; |
387 | 401 | } |
388 | 402 | |
389 | set collapseFraction(collapseFraction) { | |
403 | // eslint-disable-next-line camelcase | |
404 | set collapse_fraction(collapseFraction) { | |
405 | if (this._collapseFraction == collapseFraction) | |
406 | return; | |
390 | 407 | this._collapseFraction = collapseFraction; |
391 | this.actor.queue_relayout(); | |
392 | } | |
393 | ||
394 | get collapseFraction() { | |
408 | this.notify('collapse-fraction'); | |
409 | this.queue_relayout(); | |
410 | } | |
411 | ||
412 | // eslint-disable-next-line camelcase | |
413 | get collapse_fraction() { | |
395 | 414 | return this._collapseFraction; |
396 | 415 | } |
397 | 416 | |
453 | 472 | return; |
454 | 473 | } |
455 | 474 | |
456 | if (this._allWindows.indexOf(metaWin) == -1) { | |
475 | if (!this._allWindows.includes(metaWin)) { | |
457 | 476 | let minimizedChangedId = metaWin.connect('notify::minimized', |
458 | 477 | this._updateMinimized.bind(this)); |
459 | 478 | this._allWindows.push(metaWin); |
523 | 542 | this._doAddWindow(metaWin); |
524 | 543 | } |
525 | 544 | |
526 | destroy() { | |
527 | if (this.actor) | |
528 | this.actor.destroy(); | |
529 | } | |
530 | ||
531 | 545 | workspaceRemoved() { |
532 | 546 | if (this._removed) |
533 | 547 | return; |
544 | 558 | this._allWindows[i].disconnect(this._minimizedChangedIds[i]); |
545 | 559 | } |
546 | 560 | |
547 | _onDestroy(actor) { | |
561 | _onDestroy() { | |
548 | 562 | this.caption.destroy(); |
549 | 563 | this.workspaceRemoved(); |
550 | 564 | |
551 | 565 | if (this._bgManager) { |
552 | this._bgManager.destroy(); | |
553 | this._bgManager = null; | |
566 | this._bgManager.destroy(); | |
567 | this._bgManager = null; | |
554 | 568 | } |
555 | 569 | |
556 | 570 | this._windows = []; |
557 | this.actor = null; | |
558 | 571 | } |
559 | 572 | |
560 | 573 | // Tests if @actor belongs to this workspace and monitor |
577 | 590 | |
578 | 591 | // Create a clone of a (non-desktop) window and add it to the window list |
579 | 592 | _addWindowClone(win, refresh) { |
580 | // We may have to wait for the window texture to be available. | |
581 | // Such is the case with Chrome browser in Wayland | |
582 | if (this._getWinTextureIdleId > 0) { | |
583 | Mainloop.source_remove(this._getWinTextureIdleId); | |
584 | this._getWinTextureIdleId = 0; | |
585 | } | |
586 | if (!win.get_texture()) { | |
587 | if (_DEBUG_) global.log("myWorkspaceThumbnail: _addWindowClone - WINDOW TEXTURE NOT YET AVAILABLE"); | |
588 | this._getWinTextureIdleId = Mainloop.idle_add(() => { | |
589 | this._addWindowClone(win, refresh); | |
590 | }); | |
591 | return; | |
592 | } | |
593 | ||
594 | 593 | let clone = new MyWindowClone(win); |
595 | 594 | |
596 | 595 | clone.connect('selected', (clone, time) => { |
734 | 733 | |
735 | 734 | return false; |
736 | 735 | } |
737 | }; | |
738 | Signals.addSignalMethods(MyWorkspaceThumbnail.prototype); | |
739 | ||
740 | var MyThumbnailsBox = GObject.registerClass( | |
741 | class WorkspacesToDock_MyThumbnailsBox extends St.Widget { | |
736 | }); | |
737 | ||
738 | ||
739 | var MyThumbnailsBox = GObject.registerClass({ | |
740 | Properties: { | |
741 | 'indicator-x': GObject.ParamSpec.double( | |
742 | 'indicator-x', 'indicator-x', 'indicator-x', | |
743 | GObject.ParamFlags.READWRITE, | |
744 | 0, Infinity, 0), | |
745 | 'indicator-y': GObject.ParamSpec.double( | |
746 | 'indicator-y', 'indicator-y', 'indicator-y', | |
747 | GObject.ParamFlags.READWRITE, | |
748 | 0, Infinity, 0), | |
749 | 'scale': GObject.ParamSpec.double( | |
750 | 'scale', 'scale', 'scale', | |
751 | GObject.ParamFlags.READWRITE, | |
752 | 0, Infinity, 0) | |
753 | } | |
754 | }, class WorkspacesToDock_MyThumbnailsBox extends St.Widget { | |
742 | 755 | _init(dock) { |
743 | 756 | this._dock = dock; |
744 | 757 | this._gsCurrentVersion = Config.PACKAGE_VERSION.split('.'); |
759 | 772 | request_mode: Clutter.RequestMode.WIDTH_FOR_HEIGHT }); |
760 | 773 | } |
761 | 774 | |
762 | this.actor = this; | |
763 | this.actor._delegate = this; | |
775 | this._delegate = this; | |
764 | 776 | |
765 | 777 | // Add addtional style class when workspace is fixed and set to full height |
766 | 778 | if (this._mySettings.get_boolean('customize-height') && this._mySettings.get_int('customize-height-option') == 1) { |
767 | 779 | if (this._mySettings.get_double('top-margin') == 0 || this._mySettings.get_double('bottom-margin') == 0) { |
768 | this.actor.add_style_class_name('workspace-thumbnails-fullheight'); | |
780 | this.add_style_class_name('workspace-thumbnails-fullheight'); | |
769 | 781 | } |
770 | 782 | } |
771 | 783 | |
823 | 835 | // this._onDragEnd.bind(this)); |
824 | 836 | //Main.overview.connect('window-drag-cancelled', |
825 | 837 | // this._onDragCancelled.bind(this)); |
826 | ||
827 | //Main.layoutManager.connect('monitors-changed', () => { | |
828 | // this._destroyThumbnails(); | |
829 | // if (Main.overview.visible) | |
830 | // this._createThumbnails(); | |
831 | //}); | |
832 | ||
833 | //global.display.connect('workareas-changed', | |
834 | // this._updatePorthole.bind(this)); | |
835 | 838 | |
836 | 839 | // Connect global signals |
837 | 840 | let workspaceManager = global.workspace_manager; |
898 | 901 | this._settings.connect('changed::dynamic-workspaces', |
899 | 902 | this._updateSwitcherVisibility.bind(this)); |
900 | 903 | |
904 | //Main.layoutManager.connect('monitors-changed', () => { | |
905 | // this._destroyThumbnails(); | |
906 | // if (Main.overview.visible) | |
907 | // this._createThumbnails(); | |
908 | //}); | |
909 | ||
910 | //global.display.connect('workareas-changed', | |
911 | // this._updatePorthole.bind(this)); | |
912 | ||
901 | 913 | this._switchWorkspaceNotifyId = 0; |
902 | 914 | this._nWorkspacesNotifyId = 0; |
903 | 915 | this._syncStackingId = 0; |
915 | 927 | // Destroy thumbnails |
916 | 928 | this._destroyThumbnails(); |
917 | 929 | |
918 | this.actor = null; | |
919 | 930 | this._indicator = null; |
920 | 931 | |
921 | 932 | if (_DEBUG_) global.log("myWorkspaceThumbnail: dispose settings"); |
933 | 944 | } |
934 | 945 | |
935 | 946 | _activateThumbnailAtPoint(stageX, stageY, time) { |
936 | let [r, x, y] = this.transform_stage_point(stageX, stageY); | |
947 | let [r_, x, y] = this.transform_stage_point(stageX, stageY); | |
937 | 948 | |
938 | 949 | for (let i = 0; i < this._thumbnails.length; i++) { |
939 | let thumbnail = this._thumbnails[i] | |
940 | let [w, h] = thumbnail.actor.get_transformed_size(); | |
950 | let thumbnail = this._thumbnails[i]; | |
951 | let [w, h] = thumbnail.get_transformed_size(); | |
941 | 952 | if (this._isHorizontal) { |
942 | if (x >= thumbnail.actor.x && x <= thumbnail.actor.x + w) { | |
953 | if (x >= thumbnail.x && x <= thumbnail.x + w) { | |
943 | 954 | thumbnail.activate(time); |
944 | 955 | break; |
945 | 956 | } |
946 | 957 | } else { |
947 | if (y >= thumbnail.actor.y && y <= thumbnail.actor.y + h) { | |
958 | if (y >= thumbnail.y && y <= thumbnail.y + h) { | |
948 | 959 | thumbnail.activate(time); |
949 | 960 | break; |
950 | 961 | } |
1058 | 1069 | if (this._dropPlaceholderPos == 0) |
1059 | 1070 | targetBase = this._dropPlaceholder.x; |
1060 | 1071 | else |
1061 | targetBase = this._thumbnails[0].actor.x; | |
1072 | targetBase = this._thumbnails[0].x; | |
1062 | 1073 | } else { |
1063 | 1074 | if (this._dropPlaceholderPos == 0) |
1064 | 1075 | targetBase = this._dropPlaceholder.y; |
1065 | 1076 | else |
1066 | targetBase = this._thumbnails[0].actor.y; | |
1077 | targetBase = this._thumbnails[0].y; | |
1067 | 1078 | } |
1068 | 1079 | let targetTop = targetBase - spacing - WORKSPACE_CUT_SIZE; |
1069 | 1080 | let length = this._thumbnails.length; |
1071 | 1082 | // Allow the reorder target to have a 10px "cut" into |
1072 | 1083 | // each side of the thumbnail, to make dragging onto the |
1073 | 1084 | // placeholder easier |
1074 | let [w, h] = this._thumbnails[i].actor.get_transformed_size(); | |
1085 | let [w, h] = this._thumbnails[i].get_transformed_size(); | |
1086 | ||
1075 | 1087 | let targetBottom, nextTargetBase, nextTargetTop; |
1076 | 1088 | if (this._isHorizontal) { |
1077 | 1089 | targetBottom = targetBase + WORKSPACE_CUT_SIZE; |
1089 | 1101 | this._dropWorkspace = i; |
1090 | 1102 | break |
1091 | 1103 | } |
1092 | targetBase = nextTargetBase; | |
1093 | targetTop = nextTargetTop; | |
1104 | //targetBase = nextTargetBase; | |
1105 | //targetTop = nextTargetTop; | |
1094 | 1106 | } else { |
1095 | 1107 | targetBottom = targetBase + WORKSPACE_CUT_SIZE; |
1096 | 1108 | nextTargetBase = targetBase + h + spacing; |
1107 | 1119 | this._dropWorkspace = i; |
1108 | 1120 | break |
1109 | 1121 | } |
1110 | targetBase = nextTargetBase; | |
1111 | targetTop = nextTargetTop; | |
1112 | } | |
1122 | //targetBase = nextTargetBase; | |
1123 | //targetTop = nextTargetTop; | |
1124 | } | |
1125 | ||
1126 | targetBase = nextTargetBase; | |
1127 | targetTop = nextTargetTop; | |
1113 | 1128 | } |
1114 | 1129 | |
1115 | 1130 | if (this._dropPlaceholderPos != placeholderPos) { |
1168 | 1183 | // an old one which just became empty) |
1169 | 1184 | let thumbnail = this._thumbnails[newWorkspaceIndex]; |
1170 | 1185 | this._setThumbnailState(thumbnail, ThumbnailState.NEW); |
1171 | thumbnail.slidePosition = 1; | |
1186 | thumbnail.slide_position = 1; | |
1172 | 1187 | |
1173 | 1188 | this._queueUpdateStates(); |
1174 | 1189 | |
1184 | 1199 | this._switchWorkspaceNotifyId = |
1185 | 1200 | global.window_manager.connect('switch-workspace', |
1186 | 1201 | this._activeWorkspaceChanged.bind(this)); |
1187 | ||
1188 | 1202 | // passingthru67: not using n-workspaces notification (workspacesChanged) but workspaceAdded and workspaceRemoved |
1189 | 1203 | // Please see myThumbnailsBox._init function signal handlers above |
1190 | 1204 | //this._nWorkspacesNotifyId = |
1192 | 1206 | // this._workspacesChanged.bind(this)); |
1193 | 1207 | this._nWorkspacesNotifyId = 0; |
1194 | 1208 | |
1209 | this._workspacesReorderedId = | |
1210 | workspaceManager.connect('workspaces-reordered', () => { | |
1211 | this._thumbnails.sort((a, b) => { | |
1212 | return a.metaWorkspace.index() - b.metaWorkspace.index(); | |
1213 | }); | |
1214 | this.queue_relayout(); | |
1215 | }); | |
1195 | 1216 | this._syncStackingId = |
1196 | 1217 | Main.overview.connect('windows-restacked', |
1197 | 1218 | this._syncStacking.bind(this)); |
1207 | 1228 | |
1208 | 1229 | this.addThumbnails(0, workspaceManager.n_workspaces); |
1209 | 1230 | |
1210 | if (this.actor) | |
1211 | this._updateSwitcherVisibility(); | |
1231 | this._updateSwitcherVisibility(); | |
1212 | 1232 | } |
1213 | 1233 | |
1214 | 1234 | _destroyThumbnails() { |
1223 | 1243 | let workspaceManager = global.workspace_manager; |
1224 | 1244 | workspaceManager.disconnect(this._nWorkspacesNotifyId); |
1225 | 1245 | this._nWorkspacesNotifyId = 0; |
1246 | } | |
1247 | if (this._workspacesReorderedId > 0) { | |
1248 | let workspaceManager = global.workspace_manager; | |
1249 | workspaceManager.disconnect(this._workspacesReorderedId); | |
1250 | this._workspacesReorderedId = 0; | |
1226 | 1251 | } |
1227 | 1252 | |
1228 | 1253 | if (this._syncStackingId > 0) { |
1241 | 1266 | let workspaceManager = global.workspace_manager; |
1242 | 1267 | let oldNumWorkspaces = validThumbnails.length; |
1243 | 1268 | let newNumWorkspaces = workspaceManager.n_workspaces; |
1244 | let active = workspaceManager.get_active_workspace_index(); | |
1245 | 1269 | |
1246 | 1270 | if (newNumWorkspaces > oldNumWorkspaces) { |
1247 | 1271 | this.addThumbnails(oldNumWorkspaces, newNumWorkspaces - oldNumWorkspaces); |
1348 | 1372 | thumbnail.setPorthole(this._porthole.x, this._porthole.y, |
1349 | 1373 | this._porthole.width, this._porthole.height); |
1350 | 1374 | this._thumbnails.push(thumbnail); |
1351 | if (this.actor) | |
1352 | this.add_actor(thumbnail.actor); | |
1375 | this.add_actor(thumbnail); | |
1353 | 1376 | |
1354 | 1377 | if (start > 0 && this._spliceIndex == -1) { |
1355 | 1378 | // not the initial fill, and not splicing via DND |
1356 | 1379 | thumbnail.state = ThumbnailState.NEW; |
1357 | thumbnail.slidePosition = 1; // start slid out | |
1380 | thumbnail.slide_position = 1; // start slid out | |
1358 | 1381 | this._haveNewThumbnails = true; |
1359 | 1382 | } else { |
1360 | 1383 | thumbnail.state = ThumbnailState.NORMAL; |
1366 | 1389 | this._queueUpdateStates(); |
1367 | 1390 | |
1368 | 1391 | // The thumbnails indicator actually needs to be on top of the thumbnails |
1369 | if (this._indicator) | |
1370 | this._indicator.raise_top(); | |
1392 | this._indicator.raise_top(); | |
1371 | 1393 | |
1372 | 1394 | // Clear the splice index, we got the message |
1373 | 1395 | this._spliceIndex = -1; |
1412 | 1434 | } |
1413 | 1435 | |
1414 | 1436 | set scale(scale) { |
1437 | if (this._scale == scale) | |
1438 | return; | |
1439 | ||
1415 | 1440 | this._scale = scale; |
1441 | this.notify('scale'); | |
1416 | 1442 | this.queue_relayout(); |
1417 | 1443 | } |
1418 | 1444 | |
1420 | 1446 | return this._scale; |
1421 | 1447 | } |
1422 | 1448 | |
1423 | set indicatorY(indicatorY) { | |
1449 | // eslint-disable-next-line camelcase | |
1450 | set indicator_y(indicatorY) { | |
1451 | if (this._indicatorY == indicatorY) | |
1452 | return; | |
1453 | ||
1424 | 1454 | this._indicatorY = indicatorY; |
1455 | this.notify('indicator-y'); | |
1425 | 1456 | this.queue_relayout(); |
1426 | 1457 | } |
1427 | 1458 | |
1428 | get indicatorY() { | |
1459 | // eslint-disable-next-line camelcase | |
1460 | get indicator_y() { | |
1429 | 1461 | return this._indicatorY; |
1430 | 1462 | } |
1431 | 1463 | |
1432 | 1464 | // passingthru67 - added set indicatorX for when position isHorizontal |
1433 | set indicatorX(indicatorX) { | |
1465 | set indicator_x(indicatorX) { | |
1466 | if (this._indicatorX == indicatorX) | |
1467 | return; | |
1468 | ||
1434 | 1469 | this._indicatorX = indicatorX; |
1470 | this.notify('indicator-x'); | |
1435 | 1471 | this.queue_relayout(); |
1436 | 1472 | } |
1437 | 1473 | |
1438 | 1474 | // passingthru67 - added get indicatorX for when position isHorizontal |
1439 | get indicatorX() { | |
1475 | get indicator_x() { | |
1440 | 1476 | return this._indicatorX; |
1441 | 1477 | } |
1442 | 1478 | |
1456 | 1492 | } |
1457 | 1493 | } |
1458 | 1494 | |
1459 | _tweenScale() { | |
1460 | Tweener.addTween(this, | |
1461 | { scale: this._targetScale, | |
1462 | time: RESCALE_ANIMATION_TIME, | |
1463 | transition: 'easeOutQuad', | |
1464 | onComplete: this._queueUpdateStates, | |
1465 | onCompleteScope: this }); | |
1466 | } | |
1467 | ||
1468 | 1495 | _updateStates() { |
1469 | 1496 | this._stateUpdateQueued = false; |
1470 | 1497 | |
1476 | 1503 | this._iterateStateThumbnails(ThumbnailState.REMOVING, thumbnail => { |
1477 | 1504 | this._setThumbnailState(thumbnail, ThumbnailState.ANIMATING_OUT); |
1478 | 1505 | |
1479 | Tweener.addTween(thumbnail, | |
1480 | { slidePosition: 1, | |
1481 | time: SLIDE_ANIMATION_TIME, | |
1482 | transition: 'linear', | |
1483 | onComplete: () => { | |
1484 | this._setThumbnailState(thumbnail, ThumbnailState.ANIMATED_OUT); | |
1485 | this._queueUpdateStates(); | |
1486 | } | |
1487 | }); | |
1506 | thumbnail.ease_property('slide-position', 1, { | |
1507 | duration: SLIDE_ANIMATION_TIME, | |
1508 | mode: Clutter.AnimationMode.LINEAR, | |
1509 | onComplete: () => { | |
1510 | this._setThumbnailState(thumbnail, ThumbnailState.ANIMATED_OUT); | |
1511 | this._queueUpdateStates(); | |
1512 | } | |
1513 | }); | |
1488 | 1514 | }); |
1489 | 1515 | |
1490 | 1516 | // As long as things are sliding out, don't proceed |
1494 | 1520 | // Once that's complete, we can start scaling to the new size and collapse any removed thumbnails |
1495 | 1521 | this._iterateStateThumbnails(ThumbnailState.ANIMATED_OUT, thumbnail => { |
1496 | 1522 | this._setThumbnailState(thumbnail, ThumbnailState.COLLAPSING); |
1497 | Tweener.addTween(thumbnail, | |
1498 | { collapseFraction: 1, | |
1499 | time: RESCALE_ANIMATION_TIME, | |
1500 | transition: 'easeOutQuad', | |
1501 | onComplete: () => { | |
1502 | this._stateCounts[thumbnail.state]--; | |
1503 | thumbnail.state = ThumbnailState.DESTROYED; | |
1504 | ||
1505 | let index = this._thumbnails.indexOf(thumbnail); | |
1506 | this._thumbnails.splice(index, 1); | |
1507 | thumbnail.destroy(); | |
1508 | ||
1509 | this._queueUpdateStates(); | |
1510 | } | |
1511 | }); | |
1523 | thumbnail.ease_property('collapse-fraction', 1, { | |
1524 | duration: RESCALE_ANIMATION_TIME, | |
1525 | mode: Clutter.AnimationMode.EASE_OUT_QUAD, | |
1526 | onComplete: () => { | |
1527 | this._stateCounts[thumbnail.state]--; | |
1528 | thumbnail.state = ThumbnailState.DESTROYED; | |
1529 | ||
1530 | let index = this._thumbnails.indexOf(thumbnail); | |
1531 | this._thumbnails.splice(index, 1); | |
1532 | thumbnail.destroy(); | |
1533 | ||
1534 | this._queueUpdateStates(); | |
1535 | } | |
1536 | }); | |
1512 | 1537 | }); |
1513 | 1538 | |
1514 | 1539 | if (this._pendingScaleUpdate) { |
1515 | this._tweenScale(); | |
1540 | this.ease_property('scale', this._targetScale, { | |
1541 | mode: Clutter.AnimationMode.EASE_OUT_QUAD, | |
1542 | duration: RESCALE_ANIMATION_TIME, | |
1543 | onComplete: () => this._queueUpdateStates() | |
1544 | }); | |
1516 | 1545 | this._pendingScaleUpdate = false; |
1517 | 1546 | } |
1518 | 1547 | |
1523 | 1552 | // And then slide in any new thumbnails |
1524 | 1553 | this._iterateStateThumbnails(ThumbnailState.NEW, thumbnail => { |
1525 | 1554 | this._setThumbnailState(thumbnail, ThumbnailState.ANIMATING_IN); |
1526 | Tweener.addTween(thumbnail, | |
1527 | { slidePosition: 0, | |
1528 | time: SLIDE_ANIMATION_TIME, | |
1529 | transition: 'easeOutQuad', | |
1530 | onComplete: () => { | |
1531 | this._setThumbnailState(thumbnail, ThumbnailState.NORMAL); | |
1532 | } | |
1533 | }); | |
1555 | thumbnail.ease_property('slide-position', 0, { | |
1556 | duration: SLIDE_ANIMATION_TIME, | |
1557 | mode: Clutter.AnimationMode.EASE_OUT_QUAD, | |
1558 | onComplete: () => { | |
1559 | this._setThumbnailState(thumbnail, ThumbnailState.NORMAL); | |
1560 | } | |
1561 | }); | |
1534 | 1562 | }); |
1535 | 1563 | } |
1536 | 1564 | |
1653 | 1681 | vfunc_allocate(box, flags) { |
1654 | 1682 | this.set_allocation(box, flags); |
1655 | 1683 | |
1656 | this._thumbnailsBoxWidth = this.actor.width; | |
1657 | this._thumbnailsBoxHeight = this.actor.height; | |
1684 | this._thumbnailsBoxWidth = this.width; | |
1685 | this._thumbnailsBoxHeight = this.height; | |
1658 | 1686 | |
1659 | 1687 | // passingthru67: we use this._position instead of rtl |
1660 | 1688 | // let rtl = (Clutter.get_default_text_direction () == Clutter.TextDirection.RTL); |
1783 | 1811 | let thumbnail = this._thumbnails[i]; |
1784 | 1812 | |
1785 | 1813 | if (i > 0) { |
1786 | // x += spacing - Math.round(thumbnail.collapseFraction * spacing); | |
1814 | // x += spacing - Math.round(thumbnail.collapse_fraction * spacing); | |
1787 | 1815 | x += spacing; |
1788 | 1816 | } |
1789 | 1817 | |
1797 | 1825 | } |
1798 | 1826 | |
1799 | 1827 | if (i == this._dropPlaceholderPos) { |
1800 | let [minWidth, placeholderWidth] = this._dropPlaceholder.get_preferred_width(-1); | |
1828 | let [, placeholderWidth] = this._dropPlaceholder.get_preferred_width(-1); | |
1801 | 1829 | childBox.y1 = y1; |
1802 | childBox.y2 = y1 + thumbnailHeight + captionBackgroundHeight; | |
1830 | childBox.y2 = y2; | |
1803 | 1831 | childBox.x1 = Math.round(x); |
1804 | 1832 | childBox.x2 = Math.round(x + placeholderWidth); |
1805 | 1833 | this._dropPlaceholder.allocate(childBox, flags); |
1806 | Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { | |
1834 | Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { | |
1807 | 1835 | this._dropPlaceholder.show(); |
1808 | 1836 | }); |
1809 | 1837 | x += placeholderWidth + spacing; |
1815 | 1843 | // we compute an actual scale separately for each thumbnail. |
1816 | 1844 | let x1 = Math.round(x); |
1817 | 1845 | let x2 = Math.round(x + thumbnailWidth); |
1846 | // passingthru67 - roundedHScale now defined above | |
1818 | 1847 | roundedHScale = (x2 - x1) / portholeWidth; |
1819 | 1848 | |
1820 | 1849 | if (thumbnail.metaWorkspace == indicatorWorkspace) { |
1830 | 1859 | // passingthru67 - size needs to include caption area |
1831 | 1860 | childBox.y2 = y1 + portholeHeight + (captionBackgroundHeight/roundedVScale); |
1832 | 1861 | |
1833 | thumbnail.actor.set_scale(roundedHScale, roundedVScale); | |
1834 | thumbnail.actor.allocate(childBox, flags); | |
1862 | thumbnail.set_scale(roundedHScale, roundedVScale); | |
1863 | thumbnail.allocate(childBox, flags); | |
1835 | 1864 | |
1836 | 1865 | // passingthru67 - set myWorkspaceThumbnail labels |
1837 | 1866 | if (this._mySettings.get_boolean('workspace-captions')) |
1840 | 1869 | // We round the collapsing portion so that we don't get thumbnails resizing |
1841 | 1870 | // during an animation due to differences in rounded, but leave the uncollapsed |
1842 | 1871 | // portion unrounded so that non-animating we end up with the right total |
1843 | x += thumbnailWidth - Math.round(thumbnailWidth * thumbnail.collapseFraction); | |
1872 | x += thumbnailWidth - Math.round(thumbnailWidth * thumbnail.collapse_fraction); | |
1844 | 1873 | } |
1845 | 1874 | |
1846 | 1875 | if (this._position == St.Side.TOP) { |
1860 | 1889 | let thumbnail = this._thumbnails[i]; |
1861 | 1890 | |
1862 | 1891 | if (i > 0) |
1863 | y += spacing + captionBackgroundHeight - Math.round(thumbnail.collapseFraction * spacing); | |
1892 | y += spacing + captionBackgroundHeight - Math.round(thumbnail.collapse_fraction * spacing); | |
1864 | 1893 | |
1865 | 1894 | let x1, x2; |
1866 | ||
1867 | 1895 | if (this._position == St.Side.LEFT) { |
1868 | x1 = box.x1 + slideOffset * thumbnail.slidePosition; | |
1896 | x1 = box.x1 + slideOffset * thumbnail.slide_position; | |
1869 | 1897 | x2 = x1 + thumbnailWidth; |
1870 | 1898 | } else { |
1871 | x1 = box.x2 - thumbnailWidth + slideOffset * thumbnail.slidePosition; | |
1899 | x1 = box.x2 - thumbnailWidth + slideOffset * thumbnail.slide_position; | |
1872 | 1900 | x2 = x1 + thumbnailWidth; |
1873 | 1901 | } |
1874 | 1902 | |
1875 | 1903 | if (i == this._dropPlaceholderPos) { |
1876 | let [minHeight, placeholderHeight] = this._dropPlaceholder.get_preferred_height(-1); | |
1904 | let [, placeholderHeight] = this._dropPlaceholder.get_preferred_height(-1); | |
1877 | 1905 | childBox.x1 = x1; |
1878 | childBox.x2 = x1 + thumbnailWidth; | |
1906 | childBox.x2 = x2; | |
1879 | 1907 | childBox.y1 = Math.round(y); |
1880 | 1908 | childBox.y2 = Math.round(y + placeholderHeight); |
1881 | 1909 | this._dropPlaceholder.allocate(childBox, flags); |
1882 | Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { | |
1910 | Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { | |
1883 | 1911 | this._dropPlaceholder.show(); |
1884 | 1912 | }); |
1913 | // passingthru67 - include captionBackgroundHeight | |
1885 | 1914 | y += placeholderHeight + spacing + captionBackgroundHeight; |
1886 | 1915 | } |
1887 | 1916 | |
1894 | 1923 | |
1895 | 1924 | // passingthru67 - roundedVScale now defined above with roundedHScale |
1896 | 1925 | roundedVScale = (y2 - y1) / portholeHeight; |
1926 | ||
1897 | 1927 | |
1898 | 1928 | if (thumbnail.metaWorkspace == indicatorWorkspace) { |
1899 | 1929 | indicatorY1 = y1; |
1908 | 1938 | // passingthru67 - size needs to include caption area |
1909 | 1939 | childBox.y2 = y1 + portholeHeight + (captionBackgroundHeight/roundedVScale); |
1910 | 1940 | |
1911 | thumbnail.actor.set_scale(roundedHScale, roundedVScale); | |
1912 | thumbnail.actor.allocate(childBox, flags); | |
1941 | thumbnail.set_scale(roundedHScale, roundedVScale); | |
1942 | thumbnail.allocate(childBox, flags); | |
1913 | 1943 | |
1914 | 1944 | // passingthru67 - set myWorkspaceThumbnail labels |
1915 | 1945 | if (this._mySettings.get_boolean('workspace-captions')) |
1918 | 1948 | // We round the collapsing portion so that we don't get thumbnails resizing |
1919 | 1949 | // during an animation due to differences in rounded, but leave the uncollapsed |
1920 | 1950 | // portion unrounded so that non-animating we end up with the right total |
1921 | y += thumbnailHeight - Math.round(thumbnailHeight * thumbnail.collapseFraction); | |
1951 | y += thumbnailHeight - Math.round(thumbnailHeight * thumbnail.collapse_fraction); | |
1922 | 1952 | } |
1923 | 1953 | |
1924 | 1954 | if (this._position == St.Side.LEFT) { |
1931 | 1961 | childBox.x1 -= indicatorLeftFullBorder; |
1932 | 1962 | childBox.x2 += indicatorRightFullBorder; |
1933 | 1963 | childBox.y1 = indicatorY1 - indicatorTopFullBorder; |
1964 | ||
1934 | 1965 | // passingthru67 - indicator needs to include caption |
1935 | 1966 | childBox.y2 = (indicatorY2 ? indicatorY2 + captionBackgroundHeight : (indicatorY1 + thumbnailHeight + captionBackgroundHeight)) + indicatorBottomFullBorder; |
1936 | 1967 | } |
1938 | 1969 | this._indicator.allocate(childBox, flags); |
1939 | 1970 | } |
1940 | 1971 | |
1941 | _activeWorkspaceChanged(wm, from, to, direction) { | |
1972 | _activeWorkspaceChanged(_wm, _from, _to, _direction) { | |
1942 | 1973 | let thumbnail; |
1943 | 1974 | let workspaceManager = global.workspace_manager; |
1944 | 1975 | let activeWorkspace = workspaceManager.get_active_workspace(); |
1953 | 1984 | if (thumbnail == null) |
1954 | 1985 | return |
1955 | 1986 | |
1956 | // passingthru67 - needed in case thumbnail.actor is null outside of overview | |
1957 | if (thumbnail.actor == null) | |
1958 | return | |
1959 | ||
1960 | 1987 | this._animatingIndicator = true; |
1961 | 1988 | let indicatorThemeNode = this._indicator.get_theme_node(); |
1962 | 1989 | |
1963 | 1990 | if (this._isHorizontal) { |
1964 | 1991 | let indicatorLeftFullBorder = indicatorThemeNode.get_padding(St.Side.LEFT) + indicatorThemeNode.get_border_width(St.Side.LEFT); |
1965 | 1992 | this.indicatorX = this._indicator.allocation.x1 + indicatorLeftFullBorder; |
1966 | Tweener.addTween(this, | |
1967 | { indicatorX: thumbnail.actor.allocation.x1, | |
1968 | time: WorkspacesView.WORKSPACE_SWITCH_TIME, | |
1969 | transition: 'easeOutQuad', | |
1970 | onComplete: () => { | |
1971 | this._animatingIndicator = false; | |
1972 | this._queueUpdateStates(); | |
1973 | }, | |
1974 | onCompleteScope: this | |
1975 | }); | |
1993 | this.ease_property('indicator-x', thumbnail.allocation.x1, { | |
1994 | progress_mode: Clutter.AnimationMode.EASE_OUT_QUAD, | |
1995 | duration: WorkspacesView.WORKSPACE_SWITCH_TIME, | |
1996 | onComplete: () => { | |
1997 | this._animatingIndicator = false; | |
1998 | this._queueUpdateStates(); | |
1999 | } | |
2000 | }); | |
1976 | 2001 | } else { |
1977 | 2002 | let indicatorTopFullBorder = indicatorThemeNode.get_padding(St.Side.TOP) + indicatorThemeNode.get_border_width(St.Side.TOP); |
1978 | this.indicatorY = this._indicator.allocation.y1 + indicatorTopFullBorder; | |
1979 | Tweener.addTween(this, | |
1980 | { indicatorY: thumbnail.actor.allocation.y1, | |
1981 | time: WorkspacesView.WORKSPACE_SWITCH_TIME, | |
1982 | transition: 'easeOutQuad', | |
1983 | onComplete: () => { | |
1984 | this._animatingIndicator = false; | |
1985 | this._queueUpdateStates(); | |
1986 | }, | |
1987 | onCompleteScope: this | |
1988 | }); | |
2003 | this.indicator_y = this._indicator.allocation.y1 + indicatorTopFullBorder; | |
2004 | this.ease_property('indicator-y', thumbnail.allocation.y1, { | |
2005 | progress_mode: Clutter.AnimationMode.EASE_OUT_QUAD, | |
2006 | duration: WorkspacesView.WORKSPACE_SWITCH_TIME, | |
2007 | onComplete: () => { | |
2008 | this._animatingIndicator = false; | |
2009 | this._queueUpdateStates(); | |
2010 | } | |
2011 | }); | |
1989 | 2012 | } |
1990 | 2013 | } |
1991 | 2014 | }); |
1352 | 1352 | }); |
1353 | 1353 | |
1354 | 1354 | let thumbnailSizeSpinner = new Gtk.SpinButton(); |
1355 | thumbnailSizeSpinner.set_range(10, 25); | |
1355 | thumbnailSizeSpinner.set_range(5, 25); | |
1356 | 1356 | thumbnailSizeSpinner.set_value(this.settings.get_double('thumbnail-size') * 100); |
1357 | 1357 | thumbnailSizeSpinner.set_digits(1); |
1358 | 1358 | thumbnailSizeSpinner.set_increments(.5, 1); |
23 | 23 | const IconGrid = imports.ui.iconGrid; |
24 | 24 | |
25 | 25 | const Util = imports.misc.util; |
26 | const ExtensionSystem = imports.ui.extensionSystem; | |
27 | 26 | const ExtensionUtils = imports.misc.extensionUtils; |
28 | 27 | const Me = imports.misc.extensionUtils.getCurrentExtension(); |
29 | 28 | |
308 | 307 | this._iconContainer.add_child(this._dot); |
309 | 308 | |
310 | 309 | this._icon = new IconGrid.BaseIcon(null, iconParams); |
311 | this._icon.actor.add_style_class_name('workspacestodock-shortcut-button-icon'); | |
310 | this._icon.add_style_class_name('workspacestodock-shortcut-button-icon'); | |
312 | 311 | if (appType == ApplicationType.PLACE) { |
313 | this._icon.actor.add_style_class_name('workspacestodock-shortcut-button-symbolic-icon'); | |
312 | this._icon.add_style_class_name('workspacestodock-shortcut-button-symbolic-icon'); | |
314 | 313 | } |
315 | 314 | this._icon.setIconSize(this._iconSize); |
316 | 315 | |
317 | this._iconContainer.add_child(this._icon.actor); | |
316 | this._iconContainer.add_child(this._icon); | |
318 | 317 | |
319 | 318 | this._menu = null; |
320 | this._menuManager = new PopupMenu.PopupMenuManager(this); | |
319 | this._menuManager = new PopupMenu.PopupMenuManager(this.actor); | |
321 | 320 | this._menuTimeoutId = 0; |
322 | 321 | |
323 | 322 | // Connect button signals |
14 | 14 | const Workspace = imports.ui.workspace; |
15 | 15 | const WorkspaceThumbnail = imports.ui.workspaceThumbnail; |
16 | 16 | const Overview = imports.ui.overview; |
17 | const Tweener = imports.ui.tweener; | |
18 | 17 | const IconGrid = imports.ui.iconGrid; |
19 | 18 | const PopupMenu = imports.ui.popupMenu; |
20 | 19 | const DND = imports.ui.dnd; |
28 | 27 | const _ = Gettext.gettext; |
29 | 28 | |
30 | 29 | var CAPTION_APP_ICON_ZOOM = 8; |
31 | let TASKBAR_TOOLTIP_SHOW_TIME = 0.15; | |
32 | let TASKBAR_TOOLTIP_HIDE_TIME = 0.1; | |
30 | let TASKBAR_TOOLTIP_SHOW_TIME = 150; | |
31 | let TASKBAR_TOOLTIP_HIDE_TIME = 100; | |
33 | 32 | let TASKBAR_TOOLTIP_HOVER_TIMEOUT = 10; |
34 | 33 | |
35 | 34 | const WindowAppsUpdateAction = { |
66 | 65 | iconParams['createIcon'] = (iconSize) => { return app.create_icon_texture(iconSize);}; |
67 | 66 | |
68 | 67 | this._icon = new IconGrid.BaseIcon(app.get_name(), iconParams); |
69 | this._icon.actor.add_style_class_name('workspacestodock-caption-windowapps-button-icon'); | |
68 | this._icon.add_style_class_name('workspacestodock-caption-windowapps-button-icon'); | |
70 | 69 | this._iconSize = this._mySettings.get_double('workspace-caption-taskbar-icon-size'); |
71 | 70 | this._icon.setIconSize(this._mySettings.get_double('workspace-caption-taskbar-icon-size')); |
72 | 71 | |
73 | 72 | this.actor = new St.Button({style_class:'workspacestodock-caption-windowapps-button'}); |
74 | this.actor.set_child(this._icon.actor); | |
73 | this.actor.set_child(this._icon); | |
75 | 74 | this.actor._delegate = this; |
76 | 75 | |
77 | 76 | // this._tooltipText = this._app.get_name(); |
80 | 79 | this.tooltip = new St.Label({ style_class: 'dash-label workspacestodock-caption-windowapps-button-tooltip'}); |
81 | 80 | this.tooltip.hide(); |
82 | 81 | Main.layoutManager.addChrome(this.tooltip); |
82 | Main.layoutManager.uiGroup.set_child_below_sibling(this.tooltip, Main.layoutManager.modalDialogGroup); | |
83 | 83 | this.tooltip_actor = this.tooltip; |
84 | 84 | |
85 | 85 | // Connect signals |
145 | 145 | // we show as the item is being dragged. |
146 | 146 | getDragActorSource() { |
147 | 147 | this.hideTooltip(); |
148 | return this._icon.actor; | |
148 | return this._icon; | |
149 | 149 | } |
150 | 150 | |
151 | 151 | showTooltip() { |
194 | 194 | } |
195 | 195 | |
196 | 196 | this.tooltip.set_position(x, y); |
197 | Tweener.addTween(this.tooltip, | |
198 | { opacity: 255, | |
199 | time: TASKBAR_TOOLTIP_SHOW_TIME, | |
200 | transition: 'easeOutQuad', | |
201 | }); | |
202 | ||
197 | this.tooltip.ease({ | |
198 | opacity: 255, | |
199 | duration: TASKBAR_TOOLTIP_SHOW_TIME, | |
200 | mode: Clutter.AnimationMode.EASE_OUT_QUAD | |
201 | }); | |
203 | 202 | } |
204 | 203 | |
205 | 204 | hideTooltip() { |
208 | 207 | this._tooltipHoverTimeoutId = 0; |
209 | 208 | } |
210 | 209 | |
211 | Tweener.addTween(this.tooltip, | |
212 | { opacity: 0, | |
213 | time: TASKBAR_TOOLTIP_HIDE_TIME, | |
214 | transition: 'easeOutQuad', | |
215 | onComplete: () => { | |
216 | this.tooltip.hide(); | |
217 | } | |
218 | }); | |
210 | this.tooltip.ease({ | |
211 | opacity: 0, | |
212 | duration: TASKBAR_TOOLTIP_HIDE_TIME, | |
213 | mode: Clutter.AnimationMode.EASE_OUT_QUAD, | |
214 | onComplete: () => { | |
215 | this.tooltip.hide(); | |
216 | } | |
217 | }); | |
219 | 218 | } |
220 | 219 | }; |
221 | 220 | |
229 | 228 | iconParams['createIcon'] = (iconSize) => { return app.create_icon_texture(iconSize);}; |
230 | 229 | |
231 | 230 | this._icon = new IconGrid.BaseIcon(app.get_name(), iconParams); |
232 | this._icon.actor.add_style_class_name('workspacestodock-caption-windowapps-menu-icon'); | |
231 | this._icon.add_style_class_name('workspacestodock-caption-windowapps-menu-icon'); | |
233 | 232 | this._icon.setIconSize(this._mySettings.get_double('workspace-caption-menu-icon-size')); |
234 | 233 | // this._label = new St.Label({ text: app.get_name(), style_class: 'workspacestodock-caption-windowapps-menu-label' }); |
235 | 234 | this._label = new St.Label({ text: this._metaWin.title, style_class: 'workspacestodock-caption-windowapps-menu-label' }); |
236 | 235 | |
237 | 236 | this._buttonBox = new St.BoxLayout({style_class:'workspacestodock-caption-windowapps-menu-button'}); |
238 | this._buttonBox.add(this._icon.actor, {x_fill: false, y_fill: false, x_align: St.Align.START, y_align: St.Align.MIDDLE}); | |
237 | this._buttonBox.add(this._icon, {x_fill: false, y_fill: false, x_align: St.Align.START, y_align: St.Align.MIDDLE}); | |
239 | 238 | this._buttonBox.add(this._label, {x_fill: true, y_fill: false, x_align: St.Align.START, y_align: St.Align.MIDDLE, expand: true}); |
240 | 239 | |
241 | 240 | this._closeButton = new St.Button({style_class:'workspacestodock-caption-windowapps-menu-close'}); |
334 | 333 | global.window_manager.connect('switch-workspace', |
335 | 334 | this.activeWorkspaceChanged.bind(this)); |
336 | 335 | |
337 | this._menuManager = new PopupMenu.PopupMenuManager(this); | |
336 | this._menuManager = new PopupMenu.PopupMenuManager(this.actor); | |
338 | 337 | |
339 | 338 | this._initCaption(); |
340 | this._thumbnailRealizeId = this._thumbnail.actor.connect("realize", this._initTaskbar.bind(this)); | |
339 | this._thumbnailRealizeId = this._thumbnail.connect("realize", this._initTaskbar.bind(this)); | |
341 | 340 | } |
342 | 341 | |
343 | 342 | destroy() { |
512 | 511 | |
513 | 512 | // Add caption to thumbnail actor |
514 | 513 | this.actor.add_actor(this._wsCaption); |
515 | this._thumbnail.actor.add_actor(this._wsCaptionBackground); | |
516 | this._thumbnail.actor.add_actor(this.actor); | |
514 | this._thumbnail.add_actor(this._wsCaptionBackground); | |
515 | this._thumbnail.add_actor(this.actor); | |
517 | 516 | |
518 | 517 | // Make thumbnail background transparent so that it doesn't show through |
519 | 518 | // on edges where border-radius is set on caption |
520 | this._thumbnail.actor.set_style("background-color: rgba(0,0,0,0.0)"); | |
519 | this._thumbnail.set_style("background-color: rgba(0,0,0,0.0)"); | |
521 | 520 | |
522 | 521 | // Create menu and menuitems |
523 | 522 | let side = this._position; |
571 | 570 | _initTaskbar() { |
572 | 571 | if (_DEBUG_ && !this._thumbnail._removed) global.log("myWorkspaceThumbnail: _initTaskbar for metaWorkspace "+this._thumbnail.metaWorkspace.index()); |
573 | 572 | if(this._thumbnailRealizeId > 0){ |
574 | this._thumbnail.actor.disconnect(this._thumbnailRealizeId); | |
573 | this._thumbnail.disconnect(this._thumbnailRealizeId); | |
575 | 574 | this._thumbnailRealizeId = 0; |
576 | 575 | } else { |
577 | 576 | return; |
Binary diff not shown