diff --git a/workspaces-to-dock@passingthru67.gmail.com/dockedWorkspaces.js b/workspaces-to-dock@passingthru67.gmail.com/dockedWorkspaces.js index d79c1fc..3bf141f 100644 --- a/workspaces-to-dock@passingthru67.gmail.com/dockedWorkspaces.js +++ b/workspaces-to-dock@passingthru67.gmail.com/dockedWorkspaces.js @@ -15,6 +15,7 @@ const GLib = imports.gi.GLib; const Gio = imports.gi.Gio; const GObject = imports.gi.GObject; const Clutter = imports.gi.Clutter; +const Graphene = imports.gi.Graphene; const Lang = imports.lang; const Shell = imports.gi.Shell; const Signals = imports.signals; @@ -133,8 +134,8 @@ var MyThumbnailsSlider = GObject.registerClass({ super._init(params); } - vfunc_allocate(box, flags) { - this.set_allocation(box, flags); + vfunc_allocate(box) { + this.set_allocation(box); if (this.child == null) return; @@ -168,7 +169,7 @@ var MyThumbnailsSlider = GObject.registerClass({ childBox.y2 = slideoutSize + this._slidex * (childHeight - slideoutSize); } - this.child.allocate(childBox, flags); + this.child.allocate(childBox); this.child.set_clip(-childBox.x1, -childBox.y1, -childBox.x1+availWidth, -childBox.y1 + availHeight); } @@ -523,14 +524,14 @@ var DockedWorkspaces = class WorkspacesToDock_DockedWorkspaces { // Connect DashToDock hover signal if the extension is already loaded and enabled this._hoveringDash = false; - + DashToDockExtension = Main.extensionManager.lookup(DashToDock_UUID); UbuntuDockExtension = Main.extensionManager.lookup(UbuntuDock_UUID); - + if (UbuntuDockExtension) { DashToDockExtension = UbuntuDockExtension; } - + if (DashToDockExtension) { if (DashToDockExtension.state == ExtensionUtils.ExtensionState.ENABLED) { if (_DEBUG_) global.log("dockeWorkspaces: init - DashToDock extension is installed and enabled"); @@ -1005,29 +1006,11 @@ var DockedWorkspaces = class WorkspacesToDock_DockedWorkspaces { geometry.height -= controlsHeight; if (_DEBUG_) global.log("WORKSPACESDISPLAY - FINAL GEOMETRY.X = "+geometry.x+" Y = "+geometry.y+" W = "+geometry.width+" H = "+geometry.height); - this._workspacesViews[i].setMyActualGeometry(geometry); + const { gx, gy, gwidth, gheight } = geometry; + this._workspacesViews[i].set({ gx, gy, gwidth, gheight }); } }; - // This override is needed to prevent calls from updateWorkspacesActualGeometry bound to the workspacesDisplay object - // without destroying and recreating Main.overview.viewSelector._workspacesDisplay. - // We replace this function with a new setMyActualGeometry function (see below) - // TODO: This is very hackish. We need to find a better way to accomplish this - GSFunctions['WorkspacesViewBase_setActualGeometry'] = WorkspacesView.WorkspacesViewBase.prototype.setActualGeometry; - WorkspacesView.WorkspacesViewBase.prototype.setActualGeometry = function(geom) { - if (_DEBUG_) global.log("WORKSPACESVIEW - setActualGeometry"); - //GSFunctions['WorkspacesView_setActualGeometry'].call(this, geom); - return; - }; - - // This additional function replaces the WorkspacesView setActualGeometry function above. - // TODO: This is very hackish. We need to find a better way to accomplish this - WorkspacesView.WorkspacesViewBase.prototype.setMyActualGeometry = function(geom) { - if (_DEBUG_) global.log("WORKSPACESVIEW - setMyActualGeometry"); - this._actualGeometry = geom; - this._syncActualGeometry(); - }; - this._overrideComplete = true; } @@ -2353,25 +2336,21 @@ var DockedWorkspaces = class WorkspacesToDock_DockedWorkspaces { width = this._monitor.width - (margin * 2); } - // Get y position, height, and anchorpoint + // Get y position and height height = this._thumbnailsBox._thumbnailsBoxHeight + shortcutsPanelThickness + screenEdgePadding; if (this._position == St.Side.TOP) { y = this._monitor.y; - anchorPoint = Clutter.Gravity.NORTH_WEST; } else { - y = this._monitor.y + this._monitor.height; - anchorPoint = Clutter.Gravity.SOUTH_WEST; + y = this._monitor.y + this._monitor.height - (height + 1); } } else { - // Get x position, width, and anchorpoint + // Get x position and widtht width = this._thumbnailsBox._thumbnailsBoxWidth + shortcutsPanelThickness + screenEdgePadding; if (this._position == St.Side.LEFT) { x = this._monitor.x; - anchorPoint = Clutter.Gravity.NORTH_WEST; } else { - x = this._monitor.x + this._monitor.width; - anchorPoint = Clutter.Gravity.NORTH_EAST; + x = this._monitor.x + this._monitor.width - (width + 1); } // Get y position and height @@ -2473,11 +2452,6 @@ var DockedWorkspaces = class WorkspacesToDock_DockedWorkspaces { this.actor.set_size(width + this._triggerWidth, height); } } - - // Set anchor points - this.actor.move_anchor_point_from_gravity(anchorPoint); - this._struts.move_anchor_point_from_gravity(anchorPoint); - // Update slider slideout width let slideoutSize = this._settings.get_boolean('dock-edge-visible') ? this._triggerWidth + DOCK_EDGE_VISIBLE_WIDTH : this._triggerWidth; this._slider.slideoutSize = slideoutSize; diff --git a/workspaces-to-dock@passingthru67.gmail.com/intellihide.js b/workspaces-to-dock@passingthru67.gmail.com/intellihide.js index bf8b818..1d5c740 100644 --- a/workspaces-to-dock@passingthru67.gmail.com/intellihide.js +++ b/workspaces-to-dock@passingthru67.gmail.com/intellihide.js @@ -854,28 +854,30 @@ var Intellihide = class WorkspacesToDock_Intellihide { let rect = win.get_frame_rect(); let [dx, dy] = this._dock.actor.get_position(); let [dw, dh] = this._dock.actor.get_size(); - let [dcx, dcy] = this._dock.actor.get_transformed_position(); - let [dcw, dch] = this._dock.actor.get_size(); // SANITY CHECK // global.log("dx="+dx+" dy="+dy+" || dcx="+Math.round(dcx)+" dcy="+dcy); // global.log("dw="+dw+" dh="+dh+" || dcw="+dcw+" dch="+dch); if (this._dock._isHorizontal) { - dx = dcx; - dw = dcw; let intellihideAction = this._settings.get_enum('intellihide-action'); if (intellihideAction == IntellihideAction.SHOW_PARTIAL || intellihideAction == IntellihideAction.SHOW_PARTIAL_FIXED) { - if (this._dock._slider.partialSlideoutSize) - dh = this._dock._slider.partialSlideoutSize; + if (this._dock._slider.partialSlideoutSize){ + if(this._dock._position == St.Side.BOTTOM) { + dy += (dh - this._dock._slider.partialSlideoutSize); + } + dh -= (dh - this._dock._slider.partialSlideoutSize); + } } } else { - dy = dcy; - dh = dch; let intellihideAction = this._settings.get_enum('intellihide-action'); if (intellihideAction == IntellihideAction.SHOW_PARTIAL || intellihideAction == IntellihideAction.SHOW_PARTIAL_FIXED) { - if (this._dock._slider.partialSlideoutSize) - dw = this._dock._slider.partialSlideoutSize; + if (this._dock._slider.partialSlideoutSize){ + if(this._dock._position == St.Side.RIGHT) { + dx += (dw - this._dock._slider.partialSlideoutSize); + } + dw -= (dw - this._dock._slider.partialSlideoutSize); + } } } @@ -884,9 +886,9 @@ var Intellihide = class WorkspacesToDock_Intellihide { if (this._dock._position == St.Side.LEFT || this._dock._position == St.Side.TOP) { test = (rect.x < dx + dw) && (rect.x + rect.width > dx) && (rect.y < dy + dh) && (rect.y + rect.height > dy); } else if (this._dock._position == St.Side.RIGHT) { - test = (rect.x < dx) && (rect.x + rect.width > dx - dw) && (rect.y < dy + dh) && (rect.y + rect.height > dy); + test = (rect.x < dx + dw) && (rect.x + rect.width > dx) && (rect.y < dy + dh) && (rect.y + rect.height > dy); } else if (this._dock._position == St.Side.BOTTOM) { - test = (rect.x < dx + dw) && (rect.x + rect.width > dx) && (rect.y + rect.height > dy - dh) && (rect.y < dy); + test = (rect.x < dx + dw) && (rect.x + rect.width > dx) && (rect.y + rect.height > dy) && (rect.y < dy + dy); } if (test) { overlaps = true; diff --git a/workspaces-to-dock@passingthru67.gmail.com/metadata.json b/workspaces-to-dock@passingthru67.gmail.com/metadata.json index f37c2b3..fa8d01b 100644 --- a/workspaces-to-dock@passingthru67.gmail.com/metadata.json +++ b/workspaces-to-dock@passingthru67.gmail.com/metadata.json @@ -2,9 +2,9 @@ "name": "Workspaces to Dock", "description": "Transform Gnome Shell's overview workspaces into an intelligent dock.", "original-author": "passingthru67@gmail.com", - "shell-version": ["3.36"], + "shell-version": ["3.38"], "url": "https://github.com/passingthru67/workspaces-to-dock", "uuid": "workspaces-to-dock@passingthru67.gmail.com", "gettext-domain": "workspacestodock", - "version": 53 + "version": 54 } diff --git a/workspaces-to-dock@passingthru67.gmail.com/myWorkspaceSwitcher.js b/workspaces-to-dock@passingthru67.gmail.com/myWorkspaceSwitcher.js index 21be466..9ca9080 100644 --- a/workspaces-to-dock@passingthru67.gmail.com/myWorkspaceSwitcher.js +++ b/workspaces-to-dock@passingthru67.gmail.com/myWorkspaceSwitcher.js @@ -17,7 +17,6 @@ const Lang = imports.lang; const Main = imports.ui.main; const WorkspacesView = imports.ui.workspacesView; const WindowManager = imports.ui.windowManager; -const Tweener = imports.ui.tweener; const Me = imports.misc.extensionUtils.getCurrentExtension(); const Convenience = Me.imports.convenience; diff --git a/workspaces-to-dock@passingthru67.gmail.com/myWorkspaceThumbnail.js b/workspaces-to-dock@passingthru67.gmail.com/myWorkspaceThumbnail.js index 3f96c37..8b4fa8c 100644 --- a/workspaces-to-dock@passingthru67.gmail.com/myWorkspaceThumbnail.js +++ b/workspaces-to-dock@passingthru67.gmail.com/myWorkspaceThumbnail.js @@ -696,8 +696,14 @@ var MyWorkspaceThumbnail = GObject.registerClass({ if (this.state > ThumbnailState.NORMAL) return false; - if (source.realWindow) { - let win = source.realWindow; + if (source.metaWindow) { + var win; + if(source.realWindow) { + win = source.realWindow; + } else { + win = source.metaWindow.get_compositor_private(); + } + if (this._isMyWindow(win)) return false; @@ -1104,7 +1110,7 @@ var MyThumbnailsBox = GObject.registerClass({ // Draggable target interface handleDragOver(source, actor, x, y, time) { - if (!source._caption && !source.realWindow && + if (!source._caption && !source.metaWindow && (!source.app || !source.app.can_open_new_window()) && (source.app || !source.shellWorkspaceLaunch) && source != Main.xdndHandler) @@ -1654,8 +1660,8 @@ var MyThumbnailsBox = GObject.registerClass({ this.queue_relayout(); } - vfunc_allocate(box, flags) { - this.set_allocation(box, flags); + vfunc_allocate(box) { + this.set_allocation(box); this._thumbnailsBoxWidth = this.width; this._thumbnailsBoxHeight = this.height; @@ -1809,7 +1815,7 @@ var MyThumbnailsBox = GObject.registerClass({ childBox.y2 = y2; childBox.x1 = Math.round(x); childBox.x2 = Math.round(x + placeholderWidth); - this._dropPlaceholder.allocate(childBox, flags); + this._dropPlaceholder.allocate(childBox); Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { this._dropPlaceholder.show(); }); @@ -1839,7 +1845,7 @@ var MyThumbnailsBox = GObject.registerClass({ childBox.y2 = y1 + portholeHeight + (captionBackgroundHeight/roundedVScale); thumbnail.set_scale(roundedHScale, roundedVScale); - thumbnail.allocate(childBox, flags); + thumbnail.allocate(childBox); // passingthru67 - set myWorkspaceThumbnail labels if (this._mySettings.get_boolean('workspace-captions')) @@ -1885,7 +1891,7 @@ var MyThumbnailsBox = GObject.registerClass({ childBox.x2 = x2; childBox.y1 = Math.round(y); childBox.y2 = Math.round(y + placeholderHeight); - this._dropPlaceholder.allocate(childBox, flags); + this._dropPlaceholder.allocate(childBox); Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { this._dropPlaceholder.show(); }); @@ -1917,7 +1923,7 @@ var MyThumbnailsBox = GObject.registerClass({ childBox.y2 = y1 + portholeHeight + (captionBackgroundHeight/roundedVScale); thumbnail.set_scale(roundedHScale, roundedVScale); - thumbnail.allocate(childBox, flags); + thumbnail.allocate(childBox); // passingthru67 - set myWorkspaceThumbnail labels if (this._mySettings.get_boolean('workspace-captions')) @@ -1944,7 +1950,7 @@ var MyThumbnailsBox = GObject.registerClass({ childBox.y2 = (indicatorY2 ? indicatorY2 + captionBackgroundHeight : (indicatorY1 + thumbnailHeight + captionBackgroundHeight)) + indicatorBottomFullBorder; } - this._indicator.allocate(childBox, flags); + this._indicator.allocate(childBox); } _activeWorkspaceChanged(_wm, _from, _to, _direction) { diff --git a/workspaces-to-dock@passingthru67.gmail.com/shortcutsPanel.js b/workspaces-to-dock@passingthru67.gmail.com/shortcutsPanel.js index 3c50d10..e344cf0 100644 --- a/workspaces-to-dock@passingthru67.gmail.com/shortcutsPanel.js +++ b/workspaces-to-dock@passingthru67.gmail.com/shortcutsPanel.js @@ -259,7 +259,7 @@ var ShortcutButton = GObject.registerClass({ // Adjust 'places' symbolic icons by reducing their size // and setting a special class for button padding this._iconSize -= 4; - this.actor.add_style_class_name('workspacestodock-shortcut-button-symbolic'); + this.add_style_class_name('workspacestodock-shortcut-button-symbolic'); return new St.Icon({gicon: this.app.icon, icon_size: iconSize}); } else if (this._type == ApplicationType.RECENT) { let gicon = Gio.content_type_get_icon(this.app.mime); diff --git a/workspaces-to-dock@passingthru67.gmail.com/thumbnailCaption.js b/workspaces-to-dock@passingthru67.gmail.com/thumbnailCaption.js index 81afe81..856ec10 100644 --- a/workspaces-to-dock@passingthru67.gmail.com/thumbnailCaption.js +++ b/workspaces-to-dock@passingthru67.gmail.com/thumbnailCaption.js @@ -2,12 +2,14 @@ const _DEBUG_ = false; const GLib = imports.gi.GLib; const Gio = imports.gi.Gio; +const GObject = imports.gi.GObject; const Clutter = imports.gi.Clutter; const Lang = imports.lang; const Meta = imports.gi.Meta; const Shell = imports.gi.Shell; const Signals = imports.signals; const St = imports.gi.St; +const Graphene = imports.gi.Graphene; const Main = imports.ui.main; const WorkspacesView = imports.ui.workspacesView; @@ -55,8 +57,10 @@ function getPosition(settings) { return position; } -var TaskbarIcon = class WorkspacesToDock_TaskbarIcon { - constructor(app, metaWin, caption) { + +var TaskbarIcon = GObject.registerClass({}, +class WorkspacesToDock_TaskbarIcon extends GObject.Object { + _init(app, metaWin, caption) { this._caption = caption; this._mySettings = caption._mySettings; this._app = app; @@ -227,7 +231,7 @@ var TaskbarIcon = class WorkspacesToDock_TaskbarIcon { } }); } -}; +}); var MenuTaskListItem = class WorkspacesToDock_MenuTaskListItem { constructor(app, metaWin, caption) { @@ -334,7 +338,6 @@ var ThumbnailCaption = class WorkspacesToDock_ThumbnailCaption { name: 'workspacestodockCaptionContainer', reactive: false, style_class: 'workspacestodock-workspace-caption-container', - x_fill: true, y_align: this._captionYAlign, x_align: Clutter.ActorAlign.START }); @@ -643,23 +646,22 @@ var ThumbnailCaption = class WorkspacesToDock_ThumbnailCaption { let app = tracker.get_window_app(metaWin); if (app) { if (_DEBUG_) global.log("myWorkspaceThumbnail: _initTaskbar - window button app = "+app.get_name()); - let button = new TaskbarIcon(app, metaWin, this); - if (metaWin.has_focus()) { - button.actor.add_style_class_name('workspacestodock-caption-windowapps-button-active'); - } + if(this._taskBarBox){ + let button = new TaskbarIcon(app, metaWin, this); + if (metaWin.has_focus()) { + button.actor.add_style_class_name('workspacestodock-caption-windowapps-button-active'); + } - if ((this._isMyWindow(windows[i]) && this._isOverviewWindow(windows[i])) || - (this._isMyWindow(windows[i]) && this._isMinimizedWindow(windows[i])) || - this._showWindowAppOnThisWorkspace(windows[i])) { - button.actor.visible = true; - } else { - button.actor.visible = false; - } + if ((this._isMyWindow(windows[i]) && this._isOverviewWindow(windows[i])) || + (this._isMyWindow(windows[i]) && this._isMinimizedWindow(windows[i])) || + this._showWindowAppOnThisWorkspace(windows[i])) { + button.actor.visible = true; + } else { + button.actor.visible = false; + } - if (this._taskBarBox) { this._taskBarBox.add_actor(button.actor); } - let winInfo = {}; winInfo.app = app; winInfo.metaWin = metaWin; @@ -914,20 +916,19 @@ var ThumbnailCaption = class WorkspacesToDock_ThumbnailCaption { let app = tracker.get_window_app(metaWin); if (app) { if (_DEBUG_) global.log("myWorkspaceThumbnail: updateTaskbar - window button app = "+app.get_name()); - let button = new TaskbarIcon(app, metaWin, this); - if (metaWin.has_focus()) { - button.actor.add_style_class_name('workspacestodock-caption-windowapps-button-active'); - } - - if ((this._isMyWindow(metaWin, true) && this._isOverviewWindow(metaWin, true)) || - (this._isMyWindow(metaWin, true) && this._isMinimizedWindow(metaWin, true)) || - this._showWindowAppOnThisWorkspace(metaWin, true)) { - button.actor.visible = true; - } else { - button.actor.visible = false; - } - if (this._taskBarBox) { + let button = new TaskbarIcon(app, metaWin, this); + if (metaWin.has_focus()) { + button.actor.add_style_class_name('workspacestodock-caption-windowapps-button-active'); + } + + if ((this._isMyWindow(metaWin, true) && this._isOverviewWindow(metaWin, true)) || + (this._isMyWindow(metaWin, true) && this._isMinimizedWindow(metaWin, true)) || + this._showWindowAppOnThisWorkspace(metaWin, true)) { + button.actor.visible = true; + } else { + button.actor.visible = false; + } this._taskBarBox.add_actor(button.actor); }