Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix 43 #215

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added 2022-05-05 18-59-03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
Fedora38 Gnome 44 is OK


i like this extend, but it can not use now .I changed at 2022-05-05, it works now,but the setting panel can not be use. if you want to change the setting, change the xml file and then use

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works good for Ubuntu 22.04 GNOME 42.9

Thanks for the fix @dingmingglc

glib-compile-schemas ./schemas/

My OS is Fedora26,
gnome 42.1




![screenshot]( https://github.com/dingmingglc/workspaces-to-dock/blob/master/2022-05-05%2018-59-03.png)
workspaces-to-dock
==================

Expand Down
7 changes: 7 additions & 0 deletions [email protected]/convenience.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,16 @@ var globalSignalHandler = class WorkspacesToDock_globalSignalHandler {
}
for (let i = 0; i < elements.length; i++) {
let object = elements[i][0];

if(!object)
{
global.log("dockedWorkspaces: object is null",label);
continue;
}
let event = elements[i][1];
let id = object.connect(event, elements[i][2]);
this._signals[label].push([object, id]);

}
}

Expand Down
868 changes: 462 additions & 406 deletions [email protected]/dockedWorkspaces.js

Large diffs are not rendered by default.

19 changes: 14 additions & 5 deletions [email protected]/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@ const Convenience = Me.imports.convenience;
const Intellihide = Me.imports.intellihide;
const DockedWorkspaces = Me.imports.dockedWorkspaces;

const {
Clutter
} = imports.gi;


var intellihide = null;
var dock = null;
var settings = null;
var workspacesToDockStylesheet = null;

let dockss;


function loadStylesheet() {
if (_DEBUG_) global.log("WorkspacesToDock: _loadStylesheet");
// Get css filename
Expand Down Expand Up @@ -94,10 +102,11 @@ function init() {
function enable() {
if (_DEBUG_) global.log("WorkspacesToDock: ENABLE");
loadStylesheet();
dock = new DockedWorkspaces.DockedWorkspaces();
intellihide = new Intellihide.Intellihide(dock);
settings = Convenience.getSettings('org.gnome.shell.extensions.workspaces-to-dock');
bindSettingsChanges();

dock = new DockedWorkspaces.DockedWorkspaces();
intellihide = new Intellihide.Intellihide(dock);
settings = Convenience.getSettings('org.gnome.shell.extensions.workspaces-to-dock');
bindSettingsChanges();
}

function disable() {
Expand All @@ -106,7 +115,6 @@ function disable() {
intellihide.destroy();
dock.destroy();
settings.run_dispose();

dock = null;
intellihide = null;
settings = null;
Expand All @@ -128,6 +136,7 @@ function bindSettingsChanges() {
intellihide = new Intellihide.Intellihide(dock);
});
settings.connect('changed::dock-fixed', function(){

intellihide.destroy();
dock.destroy();
dock = new DockedWorkspaces.DockedWorkspaces();
Expand Down
84 changes: 72 additions & 12 deletions [email protected]/intellihide.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ var Intellihide = class WorkspacesToDock_Intellihide {
this._quickShowTimeoutId = 0;

// Connect global signals
this._signalHandler.push(
this._signalHandler.push (
// call updateVisibility when dock actor changes
[
this._dock,
Expand All @@ -123,7 +123,7 @@ var Intellihide = class WorkspacesToDock_Intellihide {
],
// Add timeout when window grab-operation begins and remove it when it ends.
// These signals only exist starting from Gnome-Shell 3.4
[
/* [
global.display,
'grab-op-begin',
this._grabOpBegin.bind(this)
Expand All @@ -133,6 +133,8 @@ var Intellihide = class WorkspacesToDock_Intellihide {
'grab-op-end',
this._grabOpEnd.bind(this)
],
*/

// direct maximize/unmazimize are not included in grab-operations
[
global.window_manager,
Expand All @@ -144,16 +146,20 @@ var Intellihide = class WorkspacesToDock_Intellihide {
'minimize',
this._onWindowMinimized.bind(this)
],
[
/* [
global.window_manager,
'size-change',
this._onWindowSizeChange.bind(this)
],
[


[
global.window_manager,
'size-changed',
this._onWindowSizeChanged.bind(this)
],
*/

// Probably this is also included in restacked?
[
global.window_manager,
Expand All @@ -166,11 +172,12 @@ var Intellihide = class WorkspacesToDock_Intellihide {
this._onFullscreenChanged.bind(this)
],
// trigggered for instance when a window is closed.
[
/* [
global.display,
'restacked',
this._onScreenRestacked.bind(this)
],
*/
// when windows are alwasy on top, the focus window can change
// without the windows being restacked. Thus monitor window focus change.
[
Expand Down Expand Up @@ -232,7 +239,7 @@ var Intellihide = class WorkspacesToDock_Intellihide {
'monitors-changed',
this._onMonitorsChanged.bind(this)
],
[
[
Main.panel.menuManager._grabHelper,
'focus-grabbed',
this._onPanelFocusGrabbed.bind(this)
Expand All @@ -242,16 +249,21 @@ var Intellihide = class WorkspacesToDock_Intellihide {
'focus-ungrabbed',
this._onPanelFocusUngrabbed.bind(this)
],
[
Main.overview.viewSelector,

/* [
// Main.overview.viewSelector,
Main.overview._overview,
'page-changed',
this._overviewPageChanged.bind(this)
]
*/


);

// if background manager valid, Connect grabHelper signals
let primaryIndex = Main.layoutManager.primaryIndex;
if (Main.layoutManager._bgManagers[primaryIndex]) {
/* if (Main.layoutManager._bgManagers[primaryIndex]) {
this._signalHandler.pushWithLabel(
'bgManagerSignals',
[
Expand All @@ -266,6 +278,10 @@ var Intellihide = class WorkspacesToDock_Intellihide {
]
);
}
*/



if (_DEBUG_) global.log("intellihide: init - signals being captured");

// Start main loop and bind initialize function
Expand All @@ -275,7 +291,10 @@ var Intellihide = class WorkspacesToDock_Intellihide {
_initialize() {
if (_DEBUG_) global.log("intellihide: initializing");
// enable intellihide now

// if (this._settings.get_boolean('intellihide') )
this._disableIntellihide = false;

if (_DEBUG_) global.log("intellihide: initialize - turn on intellihide");

// updte dock visibility
Expand Down Expand Up @@ -478,6 +497,7 @@ var Intellihide = class WorkspacesToDock_Intellihide {

// handler for when thumbnail windows dragging ended
_onWindowDragEnd() {
log("uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu5")
if (_DEBUG_) global.log("intellihide: _onWindowDragEnd");
if (this._toggledOverviewOnDrag) {
this._toggledOverviewOnDrag = false;
Expand Down Expand Up @@ -517,6 +537,9 @@ var Intellihide = class WorkspacesToDock_Intellihide {

// handler for when app icon dragging cancelled
_onItemDragCancelled() {

log("uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu6")

if (_DEBUG_) global.log("intellihide: _onItemDragCancelled");
if (this._toggledOverviewOnDrag) {
this._toggledOverviewOnDrag = false;
Expand Down Expand Up @@ -550,6 +573,7 @@ var Intellihide = class WorkspacesToDock_Intellihide {

// handler for when app icon dragging ended
_onItemDragEnd() {
log("uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu7")
if (_DEBUG_) global.log("intellihide: _onWindowDragEnd");
if (this._toggledOverviewOnDrag) {
this._toggledOverviewOnDrag = false;
Expand Down Expand Up @@ -597,7 +621,11 @@ var Intellihide = class WorkspacesToDock_Intellihide {
_overviewEntered() {
if (_DEBUG_) global.log("intellihide: _overviewEnter");
this._inOverview = true;
if (Main.overview.viewSelector._activePage == Main.overview.viewSelector._workspacesPage) {
//要修改
// if (Main.overview.viewSelector._activePage == Main.overview.viewSelector._workspacesPage) {


if (true) {
if (this._settings.get_boolean('dock-fixed')) {
this._show();
} else {
Expand Down Expand Up @@ -656,6 +684,11 @@ var Intellihide = class WorkspacesToDock_Intellihide {

// handler for when panel focus is grabbed (GS 38+)
_onPanelFocusGrabbed(source, event) {

log("uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu9")



if (this._settings.get_boolean('ignore-top-panel')) return;
let idx = source._grabStack.length - 1;
let focusedActor = source._grabStack[idx].actor;
Expand Down Expand Up @@ -774,6 +807,11 @@ var Intellihide = class WorkspacesToDock_Intellihide {

// intellihide function to hide dock
_hide(dontforce) {



log("uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu999",dontforce)

this.status = false;
if (this._settings.get_boolean('dock-fixed')) {
if (_DEBUG_) global.log("intellihide: _hide - fadeOutDock");
Expand Down Expand Up @@ -801,6 +839,8 @@ var Intellihide = class WorkspacesToDock_Intellihide {

// intellihide function to determine if dock overlaps a window
_updateDockVisibility() {


if (this._disableIntellihide)
return;

Expand Down Expand Up @@ -842,7 +882,6 @@ var Intellihide = class WorkspacesToDock_Intellihide {
break;
}
}

// If there isn't a focused app, use that of the window on top
//this._focusApp = this._tracker.focus_app || this._tracker.get_window_app(this._topWindow);

Expand Down Expand Up @@ -884,10 +923,31 @@ 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) && (rect.x + rect.width > dx - dw) && (rect.y < dy + dh) && (rect.y + rect.height > dy);

test = (rect.x < dx) && (rect.x + rect.width > dx - dw);

// test = (rect.x + rect.width) > dx



// test = (rect.x < dx) && (rect.x + rect.width > dx - dw) && (rect.y < dy + dh) && (rect.y + rect.height > dy);


// global.log("dx="+dx+" dy="+dy+" || dcx="+Math.round(dcx)+" dcy="+dcy);


} 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);
}

// global.log(this._dock._position,"dx="+dx+" dy="+dy+" dh="+dh +" dw="+dw + " rect.x="+rect.x + " rect.y="+rect.y +" rect.width="+rect.width +" rect.height="+rect.height )


//global.log("(rect.x < dx)="+(rect.x < dx)+" (rect.x + rect.width > dx - dw)="+(rect.x + rect.width > dx - dw)+" (rect.y < dy + dh)="+(rect.y < dy + dh) + "(rect.y + rect.height > dy)=" + (rect.y + rect.height > dy) )


if (test) {
overlaps = true;
break;
Expand Down
2 changes: 1 addition & 1 deletion [email protected]/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Workspaces to Dock",
"description": "Transform Gnome Shell's overview workspaces into an intelligent dock.",
"original-author": "[email protected]",
"shell-version": ["3.36"],
"shell-version": ["3.36","42","43"],
"url": "https://github.com/passingthru67/workspaces-to-dock",
"uuid": "[email protected]",
"gettext-domain": "workspacestodock",
Expand Down
2 changes: 1 addition & 1 deletion [email protected]/myWorkspaceSwitcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ 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 Tweener = imports.ui.tweener;

const Me = imports.misc.extensionUtils.getCurrentExtension();
const Convenience = Me.imports.convenience;
Expand Down
Loading